Skip to content
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

Doesn't work on node 6 #351

Closed
ljharb opened this issue Feb 23, 2021 · 9 comments · Fixed by #353 or #355
Closed

Doesn't work on node 6 #351

ljharb opened this issue Feb 23, 2021 · 9 comments · Fixed by #353 or #355
Labels

Comments

@ljharb
Copy link
Contributor

ljharb commented Feb 23, 2021

(v1.2.0, of course, has "main" as a TS file, so it breaks everywhere) v1.2.1 breaks on node 6 with a syntax error, which is a breaking change in a minor version. I think perhaps you're using exponentiation (a ** b) when Math.pow(a, b) would serve.

Additionally, v1.0.0+ uses .padStart, which is unavailable in node 6 - you can use https://npmjs.com/string.prototype.padstart for this.

Please fix this ASAP, so react-dates can continue depending on this package. I'll be happy to make a PR.

@ljharb
Copy link
Contributor Author

ljharb commented Feb 23, 2021

Filed #352.

@ricokahler
Copy link
Owner

Hello there!

Thank you for filing an issue and opening a PR so quickly. I appreciate it and I'll definitely try to resolve this within the next few hours.

v1.2.1 breaks on node 6 with a syntax error, which is a breaking change in a minor version

I apologize for this, that was not the intention whatsoever. Version 1.2 was the version I opted to have this lib be bundled by microbundle instead of my own rollup config. The irony of this is that the switch caused more noise than convenience.


Please fix this ASAP, so react-dates can continue depending on this package. I'll be happy to make a PR.

There's nothing wrong with your PR as-is, however, I'm currently hesitant on taking any sort of dependencies just by the principles of this lib. Let me spend a few minutes trying to come up with alternatives that don't add dependencies and I'll post here when that's done.


Out of curiosity, why does react-dates need to support Node 6 in the first place? Is there an upstream issue? Most ecosystems I've seen only support Node 10+. (e.g. create-react-app and next)

@github-actions
Copy link

🎉 This issue has been resolved in version 1.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@ricokahler
Copy link
Owner

Let me know if this does the trick!

I also added you as a co-author. Thanks for contributing!

@ricokahler
Copy link
Owner

@ljharb, I just opened #354 with the topic of adding Node 6 support tests in CI.

If you're familiar with how to do that kind of testing, some guidance (or even a PR) would be greatly appreciated and would ensure any changes that break Node 6 compatibility would become blockers.

@ljharb
Copy link
Contributor Author

ljharb commented Feb 23, 2021

react-dates supports much older nodes than 6; it’s a browser lib so it needs to support IE 11, for example.

It’s fine if you don’t want a dependency, altho more deps are better :-)

Sure, i can look into the tests.

@ricokahler
Copy link
Owner

Re-opening since you found this: #353 (comment)

@ljharb
Copy link
Contributor Author

ljharb commented Feb 23, 2021

Filed #355 for the fix; #356 for the tests.

@github-actions
Copy link

🎉 This issue has been resolved in version 1.2.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants