Skip to content

Conversation

@zackschuster
Copy link
Collaborator

@zackschuster zackschuster commented Jun 22, 2018

Test assertions use output from the original moment.js code in require('./smtp/message').create.

Also added a lockfile & bumped all the "safe" dependencies to latest.

"emailjs-mime-codec": "^2.0.5",
"moment": "2.20.1",
"starttls": "1.0.1"
"emailjs-mime-codec": "^2.0.7",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before there was a yarn/package.json lock file, i had some experience with even minor bumps introducing bugs that impacted deployments that did not intend to have anything upgraded.

now with locks, i don't see that happen as much. what are you thoughts on it? for dev dependencies, i don't think it matters as much, but for direct dependencies, it's worth thinking about.

since you removed moment and changed startls to be 'compatible' they are now all consistent. so that is good.

let me know what you think and we can run with this or to be safe we can change them all to be locked to one version.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally my stance is, now that lockfiles are normalized, an end user can and should be able to ensure their builds are reproducible without libraries needing to pin themselves -- in fact, libraries should avail themselves of all the latest versions of libraries they can take without breaking tests. that's the best way (in my mind) to ensure the most secure and bug-free code is shipped.

that being said, latest version of node 6 ships with npm 3.10.3, and package-lock wasn't introduced until npm 5 -- i wouldn't want to dismiss people in that situation out-of-hand, knowing that e.g. joyent will still be on 0.10 for some time.

i wonder, though, if people in that situation would even bother touching their dependencies, especially if the next release is cut as semver major. it might be a moot point altogether, in which case i fall back to my original argument.

smtp/message.js Outdated

let counter = 0;

function getRFC2822Date(date = new Date(), useUtc = false) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about pulling these out into a utility file like RFC2822.js?

i don't feel too strongly about it, but since you are exporting these functions, it would provide an opportunity to extract them an expose the functions on a file that is more granular focused.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved these to a new file, ./smtp/date.js. also moved the tests to a new file & split them by purpose (UTC vs. non-UTC).

@eleith eleith self-assigned this Jun 23, 2018
@eleith eleith merged commit 59265f9 into eleith:master Jun 24, 2018
@zackschuster zackschuster deleted the drop-moment branch July 6, 2018 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants