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

chore: upgrade to node version 20 (FE-6252) #6424

Merged
merged 4 commits into from
Dec 7, 2023
Merged

Conversation

Parsium
Copy link
Contributor

@Parsium Parsium commented Nov 14, 2023

Proposed behaviour

  • Upgrade Carbon packages, CI config and scripts to support Node 20 - the latest LTS version.
  • Actively tests components on node 18
  • No longer actively testing components on node 16
  • Regenerate package-lock.json to use the latest file format (more details in the npm docs)

Current behaviour

Checklist

  • Commits follow our style guide
  • Related issues linked in commit messages if required
  • Screenshots are included in the PR if useful
  • All themes are supported if required
  • Unit tests added or updated if required
  • Cypress automation tests added or updated if required
  • Playwright automation tests added or updated if required
  • Storybook added or updated if required
  • Translations added or updated (including creating or amending translation keys table in storybook) if required
  • Typescript d.ts file added or updated if required
  • Related docs have been updated if required

QA

  • Tested in CodeSandbox/storybook
  • Add new Cypress test coverage if required
  • Carbon implementation matches Design System/designs
  • UI Tests GitHub check reviewed if required

Additional context

To assist with regenerating the package lock file, several packages have been locked to specific versions/ restricted to specific version ranges. These packages and their locked versions are below:

  • @playwright/experimental-core-react17 to ~1.36.2
  • @playwright/test to ~1.36.2
  • @axe-core/playwright to ~4.7.3
  • @sage/design-tokens (dev dependency only) to ~4.17.0
  • @floating-ui/dom to ~1.2.9
  • @floating-ui/react-dom to ~1.3.0
  • cypress to ~12.13.0
  • @types/styled-components to 5.1.171
  • @tanstack/react-virtual to 3.0.0-beta.54

These will eventually need updating to later versions.

Testing instructions

Pre-setup
  1. Install latest Node LTS using nvm: nvm install lts/iron
  2. Run npm ci
Tests
  • Ensure no regressions with npm scripts
  • Ensure no regressions with final Carbon build
  • Ensure no regressions with GitHub Actions
  • Ensure the Codesandbox CI successfully builds sandbox

Footnotes

  1. Should be 4.4.x to match [email protected], but type errors were encountered on the latest 4.4.x version.

Copy link

codesandbox-ci bot commented Nov 16, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit ecbe103:

Sandbox Source
carbon-quickstart Configuration
carbon-quickstart-typescript Configuration

@@ -4,5 +4,5 @@
"carbon-quickstart-typescript-6sjfuz"
],
"buildCommand": "precompile",
"node": "16"
"node": "18"
Copy link
Contributor Author

@Parsium Parsium Nov 23, 2023

Choose a reason for hiding this comment

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

note: the Codesandbox CI bot currently doesn't support Node 20, Node 18 is the latest version it supports

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah they're usually a bit behind on updating (understandably)

@Parsium Parsium force-pushed the FE-6252-node-20 branch 7 times, most recently from 6141b7e to 8339132 Compare December 7, 2023 13:51
@edleeks87 edleeks87 marked this pull request as ready for review December 7, 2023 14:37
@edleeks87 edleeks87 requested review from a team as code owners December 7, 2023 14:37
@@ -1,4 +1,4 @@
import { Page } from "playwright-core";
import { Page } from "@playwright/test";
Copy link
Contributor Author

@Parsium Parsium Dec 7, 2023

Choose a reason for hiding this comment

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

note: for future Playwright migrations, we should import any needed TypeScript types from this package as opposed to playwright-core, since playwright-core is an internal package and the Playwright team could change this at any time.

DipperTheDan
DipperTheDan previously approved these changes Dec 7, 2023
divyajindel
divyajindel previously approved these changes Dec 7, 2023
Temporarily restrict the following packages to assist with updating:
- @playwright/experimental-ct-react17
- @axe-core/playwright
- @types/styled-components
- @sage/design-tokens (dev dependency only)
- @floating-ui/dom
- @floating-ui/react-dom
- @tanstack/react-virtual
- cypress

Install @playwright/test at same version as @playwright/experimental-ct-react17,
to address issue with imported TypeScript types not being found.
Override version of playwright-core, so @axe-core/playwright and
@playwright-experiment-ct-react17 reference the same package. Without this,
npm would install two different versions of playwright-core, which would
cause TypeScript types between the two versions to clash.
@edleeks87 edleeks87 merged commit d658b24 into master Dec 7, 2023
23 checks passed
@edleeks87 edleeks87 deleted the FE-6252-node-20 branch December 7, 2023 17:31
@carbonci
Copy link
Collaborator

carbonci commented Dec 8, 2023

🎉 This PR is included in version 124.2.1 🎉

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
Development

Successfully merging this pull request may close these issues.

5 participants