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

Support Node 22 (@W-17518271@) #2218

Merged
merged 19 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 32 additions & 16 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,22 @@ jobs:
fail-fast: false
matrix:
# Run all matrix env at once because we will not deploy demo app to MRT.
node: [16, 18, 20]
npm: [8, 9, 10]
exclude: # node 16 is not compatible with npm 10
node: [16, 18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
- node: 18
npm: 11
Comment on lines +19 to +22
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, thanks for adding these excludes.

runs-on: ubuntu-latest
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -58,18 +62,22 @@ jobs:
# Run one matrix env at a time because we need to deploy each app to MRT and run e2e tests there
max-parallel: 1
matrix:
node: [16, 18, 20]
npm: [8, 9, 10]
exclude: # node 16 is not compatible with npm 10
node: [16, 18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
- node: 18
npm: 11
runs-on: ubuntu-latest
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -155,18 +163,22 @@ jobs:
# Run one matrix env at a time because we need to deploy each app to MRT and run e2e tests there
max-parallel: 1
matrix:
node: [16, 18, 20]
npm: [8, 9, 10]
exclude: # node 16 is not compatible with npm 10
node: [16, 18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
- node: 18
npm: 11
runs-on: ubuntu-latest
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -251,18 +263,22 @@ jobs:
max-parallel: 1
matrix:
# Run all matrix env at once because we will not deploy demo app to MRT.
node: [16, 18, 20]
npm: [8, 9, 10]
exclude: # node 16 is not compatible with npm 10
node: [16, 18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
- node: 18
npm: 11
runs-on: ubuntu-latest
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
35 changes: 21 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,24 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [16, 18, 20]
npm: [8, 9, 10]
exclude: # node 16 is not compatible with npm 10
node: [16, 18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
- node: 18
npm: 11
runs-on: ubuntu-latest
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
# The current recommended version for Managed Runtime:
# https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-node-version.html
IS_MRT_NODE: ${{ matrix.node == 20 && matrix.npm == 10 }}
IS_MRT_NODE: ${{ matrix.node == 22 && matrix.npm == 10 }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you confirm the Node 22 is already out and supported on production mrt? If not, then I believe this should stay at the older Node 20.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, production mrt does not currently support Node 22 yet. When I push a bundle, I got this error:

info: Beginning upload to https://cloud.mobify.com
error: HTTP 400
SSRFunctionNodeVersion: Value 22.x is not one of 18.x, 20.x
For more information visit https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pushing-and-deploying-bundles.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Node 22 should be supported on product MRT soon, let me double check the timeline.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Node 22 support tentatively lands January 31st, 2025 in MRT production

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is resolved now, node 22 launched last night and I smoke-tested joel's node 22 bundle here

https://scaffold-pwa-joel-test-env.mobify-storefront.com/global/en-GB/category/mens-accessories-ties

steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -141,21 +144,25 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [16, 18, 20]
npm: [8, 9, 10]
exclude: # node 16 is not compatible with npm 10
node: [16, 18, 20, 22]
npm: [8, 9, 10, 11]
exclude: # node 16 with npm 10/11 and node 18 with npm 11 are not compatible
- node: 16
npm: 10
- node: 16
npm: 11
- node: 18
npm: 11
runs-on: windows-latest
env:
# The "default" npm is the one that ships with a given version of node.
# For more: https://nodejs.org/en/download/releases/
# (We also use this env var for making sure a step runs once for the current node version)
# Note: For node 18, the default was npm 9 until v18.19.0, when it became npm 10
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) }}
IS_DEFAULT_NPM: ${{ (matrix.node == 16 && matrix.npm == 8) || (matrix.node == 18 && matrix.npm == 10) || (matrix.node == 20 && matrix.npm == 10) || (matrix.node == 22 && matrix.npm == 10) }}
# The current recommended version for Managed Runtime:
# https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/upgrade-node-version.html
IS_MRT_NODE: ${{ matrix.node == 20 && matrix.npm == 10 }}
IS_MRT_NODE: ${{ matrix.node == 22 && matrix.npm == 10 }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -196,7 +203,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
node-version: 22

- name: Setup Ubuntu Machine
uses: "./.github/actions/setup_ubuntu"
Expand Down Expand Up @@ -295,7 +302,7 @@ jobs:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
node-version: 22

- name: Setup Windows Machine
uses: "./.github/actions/setup_windows"
Expand Down Expand Up @@ -339,7 +346,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [20] # Should match node version supported by MRT.
node: [22] # Should match node version supported by MRT.
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"syncpack": "^10.1.0"
},
"engines": {
"node": "^16.11.0 || ^18.0.0 || ^20.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0"
"node": "^16.11.0 || ^18.0.0 || ^20.0.0 || ^22.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
},
"dependencies": {
"node-fetch": "^2.6.9"
Expand Down
1 change: 1 addition & 0 deletions packages/commerce-sdk-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Update CacheUpdateMatrix for mergeBasket mutation [#2138](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2092)
- Clear auth state if session has been invalidated by a password change [#2092](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2092)
- DNT interface improvement [#2203](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2203)
- Support Node 22 [#2218](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2218)

## v3.1.0 (Oct 28, 2024)

Expand Down
4 changes: 2 additions & 2 deletions packages/commerce-sdk-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/commerce-sdk-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@
"react-router-dom": "^5.3.4"
},
"engines": {
"node": "^16.11.0 || ^18.0.0 || ^20.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0"
"node": "^16.11.0 || ^18.0.0 || ^20.0.0 || ^22.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
},
"publishConfig": {
"directory": "dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/internal-lib-build/configs/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const config = {
require('@babel/preset-env'),
{
targets: {
node: 18
node: 22
Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch, it looks like this did not get updated last time.

}
}
],
Expand Down
4 changes: 2 additions & 2 deletions packages/internal-lib-build/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/internal-lib-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
}
},
"engines": {
"node": "^16.11.0 || ^18.0.0 || ^20.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0"
"node": "^16.11.0 || ^18.0.0 || ^20.0.0 || ^22.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
}
}
1 change: 1 addition & 0 deletions packages/pwa-kit-create-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## v3.9.0-dev (Oct 29, 2024)
- Support Node 22 [#2218](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2218)

## v3.8.0 (Oct 28, 2024)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ module.exports = {
],
// Additional parameters that configure Express app behavior.
ssrParameters: {
ssrFunctionNodeVersion: '20.x',
ssrFunctionNodeVersion: '22.x',
proxyConfigs: [
{
host: '{{answers.project.commerce.shortCode}}.api.commercecloud.salesforce.com',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.0.1",
"license": "See license in LICENSE",
"engines": {
"node": "^18.0.0 || ^20.0.0",
"npm": "^9.0.0 || ^10.0.0"
"node": "^18.0.0 || ^20.0.0 || ^22.0.0",
"npm": "^9.0.0 || ^10.0.0 || ^11.0.0"
},
"ccExtensibility": {
"extends": "{{preset.templateSource.id}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ module.exports = {
],
// Additional parameters that configure Express app behavior.
ssrParameters: {
ssrFunctionNodeVersion: '20.x',
ssrFunctionNodeVersion: '22.x',
proxyConfigs: [
{
host: '{{answers.project.commerce.shortCode}}.api.commercecloud.salesforce.com',
Expand Down
4 changes: 2 additions & 2 deletions packages/pwa-kit-create-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/pwa-kit-create-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"verdaccio": "^5.22.1"
},
"engines": {
"node": "^16.11.0 || ^18.0.0 || ^20.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0"
"node": "^16.11.0 || ^18.0.0 || ^20.0.0 || ^22.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
}
}
1 change: 1 addition & 0 deletions packages/pwa-kit-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## v3.9.0-dev (Oct 29, 2024)
- Support Node 22 [#2218](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2218)

## v3.8.0 (Oct 28, 2024)

Expand Down
4 changes: 2 additions & 2 deletions packages/pwa-kit-dev/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/pwa-kit-dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@
}
},
"engines": {
"node": "^16.11.0 || ^18.0.0 || ^20.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0"
"node": "^16.11.0 || ^18.0.0 || ^20.0.0 || ^22.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
},
"publishConfig": {
"directory": "dist"
Expand Down
2 changes: 1 addition & 1 deletion packages/pwa-kit-dev/src/configs/babel/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const config = {
require('@babel/preset-env'),
{
targets: {
node: 18
node: 22
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions packages/pwa-kit-dev/src/configs/webpack/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "2.8.0-dev",
"license": "See license in LICENSE",
"engines": {
"node": "^16.11.0 || ^18.0.0 || ^20.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0"
"node": "^16.11.0 || ^18.0.0 || ^20.0.0 || ^22.0.0",
"npm": "^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0"
},
"ccExtensibility": {
"extends": "retail-react-app",
Expand Down
1 change: 1 addition & 0 deletions packages/pwa-kit-react-sdk/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## v3.9.0-dev (Oct 29, 2024)
- Fix the performance logging util to not round duration. [#2199](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2199)
- Add RedirectWithStatus component, allowing finer grained control of rediriects and their status code [#2173](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2173)
- Support Node 22 [#2218](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2218)

## v3.8.0 (Oct 28, 2024)
- [Server Affinity] - Attach dwsid to SCAPI request headers [#2090](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2090)
Expand Down
Loading
Loading