feat: Drop Node.js 20 support. Node.js >=22.12 is now required#1033
feat: Drop Node.js 20 support. Node.js >=22.12 is now required#1033
Conversation
|
Claude finished @macdonst's task in 1m 10s —— View job Review
1. Changeset bump type should be
|
📦 Bundle Stats —
|
| Metric | Value | vs main (26102ba) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 11.04 MB | - |
| Bundled (gzip) | 2.07 MB | - |
| Import time | 856ms | +34ms, +4.1% |
bin:sanity
| Metric | Value | vs main (26102ba) |
|---|---|---|
| Internal (raw) | 734 B | -241 B, -24.7% |
| Internal (gzip) | 397 B | -63 B, -13.7% |
| Bundled (raw) | 9.84 MB | -242 B, -0.0% |
| Bundled (gzip) | 1.77 MB | -70 B, -0.0% |
| Import time | 1.96s | +10ms, +0.5% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (26102ba7)
| Metric | Value | vs main (26102ba) |
|---|---|---|
| Internal (raw) | 93.1 KB | - |
| Internal (gzip) | 21.9 KB | - |
| Bundled (raw) | 21.62 MB | - |
| Bundled (gzip) | 3.42 MB | - |
| Import time | 783ms | +2ms, +0.3% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against main (26102ba7)
| Metric | Value | vs main (26102ba) |
|---|---|---|
| Internal (raw) | 976 B | - |
| Internal (gzip) | 507 B | - |
| Bundled (raw) | 50.7 KB | - |
| Bundled (gzip) | 12.6 KB | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Coverage Delta
Comparing 1 changed file against main @ Overall Coverage
|
Signed-off-by: Simon MacDonald <simon.macdonald@gmail.com>
Signed-off-by: Simon MacDonald <simon.macdonald@gmail.com>
Signed-off-by: Simon MacDonald <simon.macdonald@gmail.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Signed-off-by: Simon MacDonald <simon.macdonald@gmail.com>
Description
Node 20 officially exited it's maintenance mode on April 30th, 2026. This means we can finally drop support for this version of Node in the CLI. The purpose of this PR is to update the code to warn users if they are running on a node version less than 22.12, update the engines version of node in all our package.json files and drop node 20 from our testing matrix.
This PR intentionally does not remove any node packages that may not be required anymore. For example:
rimraf- sticks around in case anyone is contributing from Windowstinyglobby- node 22 now supportsfs.globbut our usage oftinyglobbyincludes some options thatfs.globdoesn't support out of the box so more consideration is required here.nanoid- we only use one method in from this package,customAlphabet. To me this is a top candidate to get vendored as we can copy (with attribution) approximately 50 LOC from an MIT project instead of leaving us open to a supply chain for a package that gets over 100 million downloads a week. Single maintainer.execa- used frequently in this repo and we should probably examine if we can replace it withnode:child_processand once again not leave us open to a supply chain for a package that gets over 100 million downloads a week. Single maintainer.What to review
Should be pretty self explanatory. Did I miss any node 20 references?
Testing
All existing tests are passing. I didn't think it was necessary to add a test
isSupportedNodeVersion.Note
Medium Risk
This is a breaking runtime/packaging change: installs and executions on Node 20 will now fail due to updated
enginesand CLI startup version checks. CI and E2E coverage also shift to Node 22/24 only, which may hide issues specific to older runtimes.Overview
Drops Node.js 20 support across the monorepo by bumping all affected
package.jsonengines.nodeconstraints to>=22.12and updating the CLI entrypoint (bin/run.js) to hard-error unless running on Node>=22.12.Updates GitHub Actions workflows to remove Node 20 from test/e2e matrices, move coverage collection/artifact upload to Node 22, and set release/preview workflows to run on Node 22. Removes Node-version-specific E2E test skips that were only needed for Node 20/yarn v1, and adds a changeset marking the CLI packages for a minor bump.
Reviewed by Cursor Bugbot for commit eb39577. Bugbot is set up for automated code reviews on this repo. Configure here.