-
-
Notifications
You must be signed in to change notification settings - Fork 375
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
Fix Node 10 support #1493
Fix Node 10 support #1493
Conversation
|
Hey @prateekbh do you think you could maybe check this out? Thanks! |
@gaetanmaisse Nice catch.
Actually #1050 has me wondering if Node 10 is really something meant to be supported still. |
Node 10's end of life is 2021-04-30 so it feels right to not spend a lot of time to ensure compatibility. What's your opinion on that? Note: I discovered the problem with Storybook E2E tests as we are bootstrapping a fresh preact project and all our E2Es are currently running on Node 10 because the current version of Storybook is targeting Node 10+. |
I mean this PR itself is not a huge deal, but I do remember that it was a conscious call to keep the support to 12.0. I would not want to add |
Not sure to understand what I need to do then, revert the matrix change but keep my fix? or closed this PR, update the readme + package.json and ask for a major release? |
Revert the matrix, yeah. I wasn't privy to the conversation about support to 12.0 and I only caught how close we were to it being EOL after I sent the message originally. Engine stuff will certainly need to be updated eventually. |
…ility As stated in the Readme and in the `engine` property of the `package.json`, `preact-cli` 3.0.x should be compatible with Node 10. However, ec760ab introduced the use of `Array.prototype.flat()` (in `validate-args.js` file) which is available on Node 11+. To work around that and ensure Node 10 compatibility I replaced it with a good old `reduce` + `concat`.
f0d53ea
to
6400078
Compare
Ok, I just forced push to clean the branch and only get the fix commit ;) |
What kind of change does this PR introduce?
Bugfix: replace use of Array.prototype.flat() to ensure Node 10 compatibility
Did you add tests for your changes?
No
Summary
As stated in the Readme and in the
engine
property of thepackage.json
,preact-cli
3.0.x should be compatible with Node 10. However, https://github.com/preactjs/preact-cli/pull/1467/files#diff-490a9490c1fcd253d926ffeaea6b185b15522512e53f6a9f36493122fcae9d2eR4 introduced the use ofArray.prototype.flat()
(invalidate-args.js
file) which is available on Node 11+.To work around that and ensure Node 10 compatibility I replaced it with a good old
reduce
+concat
.Here is the current issue when running
npx preact-cli create preactjs-templates/default preact-latest
with Node 10:Does this PR introduce a breaking change?
No, it fixes one.