Repository navigation
Conversation
npm 11 rejects the `npm <7` bound. With engine-strict, it also rejects eslint-plugin-jsdoc 36.0.8 and @es-joy/jsdoccomment 0.10.8, whose engines end at Node.js 16.
npm 11 rewrites the lockfile version 1 file on install, which fails the check for local changes. legacy-peer-deps keeps npm 6's peer dependency handling, so no peer dependency is added. Versions are unchanged apart from three appium dependencies, which npm 11 installs from appium's npm-shrinkwrap.json: ws 8.2.3 to 8.2.1 and 8.2.2, npmlog 5.0.1 to 5.0.0.
webpack 5.47.1 hashes with md4, which OpenSSL 3 in Node.js 17 and later disables. Set --openssl-legacy-provider for the build, dev and test-unit scripts.
The test leaves an unhandled promise rejection, which Node.js 15 and later treat as fatal, crashing the test worker. Trunk removed the test in #36344.
Lockfile version 3 has no top-level dependencies object, so the script threw. Trunk made the same change in #53426.
This reverts commit 2dbbb52.
Node.js 15 and later exit on an unhandled promise rejection, where Node.js 14 warned. A @wordpress/data registry test leaves one, which crashed its test worker. Set --unhandled-rejections=warn for the test-unit script to keep Node.js 14's behavior.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
bin/test-create-block.sh runs wp-scripts build directly, so the build script's setting does not apply. Without it, webpack fails on md4 under OpenSSL 3.
npm 9 removed `npm bin`, so `$( npm bin )/wp-scripts` fails before any test runs. Trunk made the same change in #53426.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Sets
.nvmrcto Node.js 24.20 onwp/5.9, as on trunk, and makes the branch install, build, lint and run its unit tests with Node.js 24 and npm 11.Why?
The wordpress-develop 5.9 branch moves to Node.js 24 in WordPress/wordpress-develop#15693. This branch's CI takes Node.js from
.nvmrc. npm 11 rejects the branch'sengines, andnpm installrewrites its version 1 lockfile, which fails the Static Analysis check.How?
.nvmrcis 24.20.engines.npmdrops its<7bound, which rejects npm 11, and.npmrcdropsengine-strict = true: with it, npm 11 refuseseslint-plugin-jsdoc36.0.8 and@es-joy/jsdoccomment0.10.8, whoseenginesend at Node.js 16. npm now only warns about those two..npmrcsetslegacy-peer-deps = true, which keeps npm 6's peer dependency handling. Without it npm 11 adds missing peer dependencies to the lockfile, such asreact15.7.0,enzyme2.9.1 andpuppeteer2.1.1.build,devandtest-unitrunwp-scriptswithcross-env NODE_OPTIONS=--openssl-legacy-provider: webpack 5.47.1 and@wordpress/dependency-extraction-webpack-pluginhash with md4, which OpenSSL 3 disables.wp-scriptsstarts webpack in a new process, so the option goes inNODE_OPTIONSrather than on anodecommand.test-unitalso sets--unhandled-rejections=warnin the sameNODE_OPTIONS. The@wordpress/dataregistry test "should resolve promise non-action to dispatch" leaves a promise rejected, which ends the Jest worker on Node.js 15 and later. Node.js 14 only warned.bin/validate-package-lock.jsreads the lockfile'spackagessection instead ofdependencies, which lockfile version 3 does not have, as minimal node and npm upgrade #53426 did on trunk.bin/test-create-block.shruns itswp-scripts buildwithcross-env NODE_OPTIONS=--openssl-legacy-providertoo. The script callswp-scriptsdirectly, so thebuildscript's setting does not reach it, and the Create Block check failed on md4..github/workflows/end2end-test.ymlrunsnpx wp-scripts test-e2einstead of$( npm bin )/wp-scripts test-e2e: npm 9 removednpm bin, so the Puppeteer end-to-end jobs failed before running a test. Trunk made the same change in minimal node and npm upgrade #53426.package-lock.jsonwith npm 11 (npm install --package-lock-only, thennpm ciandnpm install, until the file no longer changes), which converts it from lockfile version 1 to 3. The only installed version changes are insideappium, which runs the native end-to-end tests: npm 11 installs the versions in appium's ownnpm-shrinkwrap.json, which npm 6 did not apply here.wsmoves from 8.2.3 to 8.2.2 underappium-android-driverandappium-xcuitest-driverand to 8.2.1 underappium-base-driver, andnpmlogfrom 5.0.1 to 5.0.0 underappium-support, which then uses appium'sare-we-there-yet1.1.5 instead of a nested 2.0.0. Four entries that no package requires are dropped:enzyme's nestedreact-is,semveranddom-serializer, anddel's nestedpath-type.Testing Instructions
With Node.js 24 and npm 11:
npm ci && npm run build && npm run lint && npm run test-unit.The build output is byte-identical to a Node.js 14 build of
wp/5.9, and the unit test results are the same.Use of AI Tools
AI assistance: Yes
Tools: Claude Code
Model: Claude Opus 5.5
Used for: Applying the changes, regenerating the lockfile, building and testing on Node.js 14 and 24 and comparing the output, and drafting this description.