-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[v13] Miniumum required node version updated to v20.10.0 #11844
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jesstelford
force-pushed
the
node-20
branch
2 times, most recently
from
April 5, 2024 03:15
3e081d9
to
eb8da22
Compare
jesstelford
changed the title
Miniumum node version updated to v20.11.1
[v13] Miniumum node version updated to v20.11.1
Apr 5, 2024
jesstelford
added
the
v13.0.0
Tracking all work for @shopify/polaris-react v13.0.0
label
Apr 5, 2024
jesstelford
changed the title
[v13] Miniumum node version updated to v20.11.1
[v13] Miniumum node version updated to v20.10.0
Apr 5, 2024
jesstelford
changed the title
[v13] Miniumum node version updated to v20.10.0
[v13] Miniumum required node version updated to v20.10.0
Apr 5, 2024
jesstelford
force-pushed
the
node-20
branch
2 times, most recently
from
April 5, 2024 05:05
b9bf9b6
to
cb05e32
Compare
restore-keys: | | ||
${{ runner.os }}-node${{ matrix.node-version }}-test-v3- | ||
${{ runner.os }}-node${{ steps.setup_node.outputs.node-version }}-test-v4- |
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.
Nice update!
alex-page
approved these changes
Apr 9, 2024
alex-page
reviewed
Apr 9, 2024
aaronccasanova
approved these changes
Apr 9, 2024
Merged
AnnaCheba
pushed a commit
to AnnaCheba/polaris
that referenced
this pull request
Apr 22, 2024
Refs https://github.com/Shopify/polaris-internal/issues/1524 [Node 16 is EOL](https://nodejs.org/en/about/previous-releases), and [Node 18 is in Maintenance Mode](https://nodejs.org/en/about/previous-releases), so we're updating the minimum required Node version to v20.10.0 (the latest supported by `node-releases`/`browserslist` at the time this project started). ## When is node used? Node is used in 2 contexts: 1. By our consumers when they import, run, and bundle our libraries 2. By us, the Polaris team, while we develop our libraries These are very different, and have their own configs within our repository... ### 1. Consumer's node version When a consumer uses one of our libraries, they're importing whatever is in the `build/*` folder. Those assets are generated by our build process (Rollup) which transforms (via babel) whatever version of Javascript we write our code in into a version that's compatible with the [`targets` setting we provide](https://github.com/Shopify/polaris/blob/a8ceec19306b62a0c0a5033efc633232da59ff9e/polaris-react/rollup.config.mjs#L72). For example, `Array#findLast` was only made available in node v18, so when we write code like: ```javascript [1, 2, 3, 2, 1].findLast(x => x < 2); ``` The output will be different depending on our Babel config: ```javascript // with babel config: { targets: 'node 16.0' } import "core-js/modules/esnext.array.find-last.js"; [1, 2, 3, 2, 1].findLast(x => x < 2); ``` ```javascript // with babel config: { targets: 'node 18.0' } [1, 2, 3, 2, 1].findLast(x => x < 2); ``` _(try it [here](https://babeljs.io/repl#?browsers=&build=&builtIns=usage&corejs=3.21&spec=false&loose=false&code_lz=NoRgNABATJDMkwiAugOgGYEsB2ATAMgIYDOALgBQAeEAvAHwTUA80AlANxA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env&prettier=false&targets=Node-16.0&version=7.24.0&externalPlugins=&assumptions=%7B%7D) - set the "Env preset > Node" version to `18.0`)_ The `node 18.0` example above does not include a polyfill for `Array#findLast`, which means if our consumers try to run Polaris in a node environment (eg; during SSR) that doesn't support `Array#findLast`, they will get an error. The way we let our consumers know what is the minimum version of node they can use is via the `packages.json#engines.node` field. As long as this matches the version specified in `Babel#targets`, any consumer trying to install our library in an unsupported version of Node will receive an error. This PR updates the minimum required node version of our consumers to `20.10.0`. ### 2. Our node version while developing Polaris Similarly, the tools we use to develop Polars (Babel, Postcss, etc) may have a minimum node version requirement. They do it by specifying a `package.json#engines.node` version in their own library. Then when we install their package, if our version of node isn't compatible we'll receive an error. However, the version of node required to run Babel _has no impact on its ability to transform our code to work on older versions of node_. As long as we tell Babel which version of node to output code for in `targets`, it doesn't matter what our `.nvmrc` file says. Shopify#11739 updated the node version for developing with Polaris to `20.11.1`. --------- Co-authored-by: Aaron Casanova <aaron.casanova@shopify.com>
rtymchyk
reviewed
Oct 1, 2024
@@ -120,6 +120,7 @@ | |||
"last 3 safari versions", | |||
"last 3 chromeandroid versions", | |||
"last 1 firefoxandroid versions", | |||
"ios >= 13.4" | |||
"ios >= 13.4", | |||
"node 20.10.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.
Why is this fixed to 20.10.0? Shouldn't it be >= 20.10.0
? I am on 20.16.0
and this is causing build errors
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs https://github.com/Shopify/polaris-internal/issues/1524
Node 16 is EOL, and Node 18 is in Maintenance Mode, so we're updating the minimum required Node version to v20.10.0 (the latest supported by
node-releases
/browserslist
at the time this project started).When is node used?
Node is used in 2 contexts:
These are very different, and have their own configs within our repository...
1. Consumer's node version
When a consumer uses one of our libraries, they're importing whatever is in the
build/*
folder. Those assets are generated by our build process (Rollup) which transforms (via babel) whatever version of Javascript we write our code in into a version that's compatible with thetargets
setting we provide.For example,
Array#findLast
was only made available in node v18, so when we write code like:The output will be different depending on our Babel config:
(try it here - set the "Env preset > Node" version to
18.0
)The
node 18.0
example above does not include a polyfill forArray#findLast
, which means if our consumers try to run Polaris in a node environment (eg; during SSR) that doesn't supportArray#findLast
, they will get an error.The way we let our consumers know what is the minimum version of node they can use is via the
packages.json#engines.node
field. As long as this matches the version specified inBabel#targets
, any consumer trying to install our library in an unsupported version of Node will receive an error.This PR updates the minimum required node version of our consumers to
20.10.0
.2. Our node version while developing Polaris
Similarly, the tools we use to develop Polars (Babel, Postcss, etc) may have a minimum node version requirement.
They do it by specifying a
package.json#engines.node
version in their own library. Then when we install their package, if our version of node isn't compatible we'll receive an error.However, the version of node required to run Babel has no impact on its ability to transform our code to work on older versions of node. As long as we tell Babel which version of node to output code for in
targets
, it doesn't matter what our.nvmrc
file says.#11739 updated the node version for developing with Polaris to
20.11.1
.