-
Notifications
You must be signed in to change notification settings - Fork 233
migrate to typescript & node.js-compatible es modules #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The head ref may contain hidden characters: "\u00F8"
Conversation
4a9134c
to
49bba9b
Compare
added a test workflow to |
114a9ed
to
b406160
Compare
@eleith took a week-long break to get fresh eyes. if i can't get it cracked open this weekend i'll ping you to ask for help. |
quick update: i've been too distracted by shinies, and no further work has been done. next update will be when i actually do something worth commenting on. |
i'll look at the failing test this weekend and see if anything pops up on my end |
that would be great, thank you :) |
@zackschuster i traced back the failure and have been able to isolate it and determine the root cause
i believe this line https://github.com/eleith/emailjs/blob/master/smtp/client.js#L143 to be the cause of the however, the if you change the timeout to ideally, we restart the timer after the last successfully sent message, to avoid this race condition. thoughts? |
@eleith good catch! i never would have thought to change the poll timer. i played with that setting & found honestly i'd feel very uneasy pushing a timer change. to me that signals some sort of huge performance hit in the library. whether that's due to e.g. running things through |
on master, i tuned |
i'll do another pass as well. there's also a bunch more dependency updates so i'll look into that. at the very least, once we get things sorted here i'll be looking into adding benchmarks to prevent things like this from reoccurring. |
if we change this _senddone(err: Error | null, stack: MessageStack) {
this.sending = false;
stack.callback(err, stack.message);
this._poll();
} to _senddone(err: Error | null, stack: MessageStack) {
this.sending = false;
stack.callback(err, stack.message);
if (err) {
this._poll();
}
} then all tests pass. i'm still trying to wrap my head around it though. fyi. |
according to profiles, we were spending a lot of time in regexes on the messages... in testing dependency after tracing back the code, it turns out the library was dynamically adding links to the html by default. disabling link generation (which isn't documented in the header files — how fun!) got everything working again. |
@eleith one million tada emojis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zackschuster great work. this was a big one, but with the attention to detail and keeping unit testing in place, it feels like a good move forward, even if there is a small chance of regression. i think the win of the types and a cleaner API makes it worth it.
} | ||
"name": "emailjs", | ||
"description": "send text/html emails and attachments (files, streams and strings) from node.js to any smtp server", | ||
"version": "2.2.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are introducing breaking changes with the new API. so either the API needs to be updated and this version bumped to 2.2.1 or we need to bump this up to 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given the sheer churn involved with this PR, i'm strongly for semver-major
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
re: the API changes — the ESM export should to me still be considered experimental, since we can't test it until userland catches up to the implementation. there might in fact be serious bugs with the code that we just won't see until we have a story for running it against tests. [edit: i remembered npm link
; i'll give that a shot in a minute]
i'm also worried i didn't get the conditional exports correct. according to node's docs we should be good, though i did just now add the "type": "module"
flag to be sure (i had taken it out before when i thought it might have something to do with testing breaking).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's bump to 3.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tested conditional exports with yarn link
& everything resolved correctly. i also diffed the bundles & they're practically identical. based on all this i think the ESM export can be considered "stable".
@zackschuster looks good to me with the version bump. anything else? |
@eleith i think this is ready! 🤞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⛵
@zackschuster lgtm. i'll let you merge when ready. |
continuation of #241