From 520bb7f52268495789c251cd020f0cf1f878a3f3 Mon Sep 17 00:00:00 2001 From: Cameron DeCoster Date: Tue, 23 Jun 2026 14:24:13 -0600 Subject: [PATCH 1/7] chore: Update "engines" to specify Node 22 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 232ecaab025..aba8bc9a5bd 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "plotly" ], "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" }, "scripts": { "custom-bundle": "node tasks/custom_bundle.mjs", From 980eb9a997244a3d3db798228fa687a5c4c0b287 Mon Sep 17 00:00:00 2001 From: Cameron DeCoster Date: Tue, 23 Jun 2026 14:28:35 -0600 Subject: [PATCH 2/7] build: Add .nvmrc file, use in workflows --- .github/actions/setup-workspace/action.yml | 7 +------ .github/workflows/ci.yml | 9 +++------ .github/workflows/publish-dist.yml | 2 +- .gitignore | 1 + .nvmrc | 1 + 5 files changed, 7 insertions(+), 13 deletions(-) create mode 100644 .nvmrc diff --git a/.github/actions/setup-workspace/action.yml b/.github/actions/setup-workspace/action.yml index c2e39d0f41b..20e1ff20727 100644 --- a/.github/actions/setup-workspace/action.yml +++ b/.github/actions/setup-workspace/action.yml @@ -1,17 +1,12 @@ name: 'Setup Workspace' description: 'Setup Node.js, install dependencies, and download build artifacts' -inputs: - node-version: - description: 'Node.js version to use' - default: '18' - runs: using: 'composite' steps: - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: - node-version: ${{ inputs.node-version }} + node-version-file: '.nvmrc' cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 721c3be1377..a3d33ff8f32 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,6 @@ concurrency: group: ci-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -env: - NODE_VERSION: '18' - jobs: detect-changes: runs-on: ubuntu-latest @@ -60,7 +57,7 @@ jobs: - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: - node-version: ${{ env.NODE_VERSION }} + node-version-file: '.nvmrc' cache: 'npm' - name: Install dependencies @@ -613,7 +610,7 @@ jobs: - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: - node-version: ${{ env.NODE_VERSION }} + node-version-file: '.nvmrc' cache: 'npm' - name: Set up build environment @@ -644,7 +641,7 @@ jobs: - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: - node-version: ${{ env.NODE_VERSION }} + node-version-file: '.nvmrc' cache: 'npm' - name: Set up build environment diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index eded04faf93..37af1dadb8a 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6 with: - node-version: '22.14.0' + node-version-file: '.nvmrc' cache: 'npm' - name: Set up build environment diff --git a/.gitignore b/.gitignore index 96cc0a9b7e2..c216f5288ab 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ tags !.github/ !.gitignore !.npmignore +!.nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000000..1c9aeda807d --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.23.0 From 00bc295a2b2598cd5f39e99cdf17f65e2b5d4b30 Mon Sep 17 00:00:00 2001 From: Cameron DeCoster Date: Tue, 23 Jun 2026 14:29:01 -0600 Subject: [PATCH 3/7] Update Node version in npm script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index aba8bc9a5bd..255130b79ab 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "start": "node devtools/test_dashboard/server.mjs", "baseline": "node test/image/make_baseline.mjs", "noci-baseline": "npm run cibuild && ./tasks/noci_test.sh image && git checkout dist && echo 'Please do not commit unless the change was expected!'", - "preversion": "check-node-version --node 18 --npm 10 && npm-link-check && npm ls --prod --all", + "preversion": "check-node-version --node 22 --npm 10 && npm-link-check && npm ls --prod --all", "version": "npm run build && git add -A lib dist build src/version.js", "postversion": "node -e \"console.log('Version bumped and committed. If ok, run: git push && git push --tags')\"", "postpublish": "node tasks/sync_packages.js" From 99d880eeeac71f22bbe3fab785dba3f4a64213fe Mon Sep 17 00:00:00 2001 From: Cameron DeCoster Date: Tue, 23 Jun 2026 14:34:29 -0600 Subject: [PATCH 4/7] Update docs --- CONTRIBUTING.md | 2 +- CUSTOM_BUNDLE.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 76d8f962e0b..4f956acbb96 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -78,7 +78,7 @@ We use the following [labels](https://github.com/plotly/plotly.js/labels) to tra #### Prerequisites - git -- [node.js](https://nodejs.org/en/). We recommend using node.js v18.x. +- [node.js](https://nodejs.org/en/). We recommend using node.js v22.x. Upgrading and managing node versions can be easily done using [`nvm`](https://github.com/nvm-sh/nvm) or its Windows alternatives. - [`npm`](https://www.npmjs.com/) v10.x and up to ensure that the diff --git a/CUSTOM_BUNDLE.md b/CUSTOM_BUNDLE.md index 40bccd62bba..3d62bc884d4 100644 --- a/CUSTOM_BUNDLE.md +++ b/CUSTOM_BUNDLE.md @@ -5,8 +5,9 @@ Make sure you have the versions of node/npm that's recommended: - plotly.js before 2.5: Node 12/npm 6 - plotly.js from 2.5: Node 16/npm 8 - plotly.js from 2.35: Node 18/npm 10 +- plotly.js from 4.0: Node 22/npm 10 -To download a specific node version look [here](https://nodejs.org/en/download/package-manager). +To download a specific node version look [here](https://nodejs.org/en/download). Note: For CI, it's faster to do `git clone --depth 1` to only get one commit. From 59e9a9e2dab621d45946a2488c958c1e63671eff Mon Sep 17 00:00:00 2001 From: Cameron DeCoster Date: Tue, 23 Jun 2026 14:57:09 -0600 Subject: [PATCH 5/7] Update lock file --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 674a406a1e1..50e82c31009 100644 --- a/package-lock.json +++ b/package-lock.json @@ -114,7 +114,7 @@ "virtual-webgl": "^1.0.7" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } }, "node_modules/@asamuzakjp/css-color": { From 0f007c6df13bf8e8c234e1c70ccf76507dad9137 Mon Sep 17 00:00:00 2001 From: Cameron DeCoster Date: Tue, 23 Jun 2026 15:25:10 -0600 Subject: [PATCH 6/7] Switch to composite action to use .nvmrc specified version of Node --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3d33ff8f32..4072bdcaa07 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -267,7 +267,7 @@ jobs: chrome-version: 'stable' - name: Run noCI tests - uses: coactions/setup-xvfb@b6b4fcfb9f5a895edadc3bc76318fae0ac17c8b3 # v1 + uses: ./.github/actions/run-xvfb with: run: ./tasks/noci_test.sh jasmine From 1e83547c0d250315642fa9142bd32ab145c7b3a7 Mon Sep 17 00:00:00 2001 From: Cameron DeCoster Date: Tue, 23 Jun 2026 15:29:20 -0600 Subject: [PATCH 7/7] Add draftlog --- draftlogs/7861_change.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/7861_change.md diff --git a/draftlogs/7861_change.md b/draftlogs/7861_change.md new file mode 100644 index 00000000000..4779bfd84d8 --- /dev/null +++ b/draftlogs/7861_change.md @@ -0,0 +1 @@ +- Update minimum required Node version to 22 [[#7861](https://github.com/plotly/plotly.js/pull/7861)]