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

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

merged 19 commits into from
Jan 30, 2025

Conversation

joeluong-sfcc
Copy link
Collaborator

@joeluong-sfcc joeluong-sfcc commented Jan 23, 2025

This PR adds support for node 22 and npm 11.

There are follow up tickets already created for the following work:

  • Upgrade dependencies to remove deprecation warnings
    • this is not required to support node 22
  • Remove node 16 as a part of v4 of PWA Kit work

Deployed storefront on MRT test environment on node 22 can be found here: https://joel-test-env-production.mobify-storefront-staging.com/

Screenshot 2025-01-27 at 10 48 28 AM

Description

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

Smoke test deployed storefront using node 22 on MRT: https://joel-test-env-production.mobify-storefront-staging.com/

OR

Test locally

  1. git checkout ju/support-node-22
  2. npm ci
  3. locally run template-retail-react-app and smoke test
  4. generate project using node 22 with ./packages/pwa-kit-create-app/scripts/create-mobify-app-dev.js and smoke test generated project

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@joeluong-sfcc joeluong-sfcc added skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated and removed skip changelog Skip the "Changelog Check" GitHub Actions step even if the Changelog.md files are not updated labels Jan 23, 2025
@joeluong-sfcc joeluong-sfcc marked this pull request as ready for review January 27, 2025 17:42
@joeluong-sfcc joeluong-sfcc requested a review from a team as a code owner January 27, 2025 17:42
package.json Outdated Show resolved Hide resolved
alexvuong
alexvuong previously approved these changes Jan 28, 2025
Comment on lines +19 to +22
- node: 16
npm: 11
- node: 18
npm: 11
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.

# 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

@@ -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.

Signed-off-by: Joel Uong <88680517+joeluong-sfcc@users.noreply.github.com>
@joeluong-sfcc joeluong-sfcc merged commit 0778438 into develop Jan 30, 2025
39 checks passed
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.

4 participants