Repository navigation
Conversation
Matches trunk's .nvmrc. Node.js 24.20 bundles npm 11.19.
Includes an upgrade to `simple-git` v2.35.0, which allows us to retain our progress meter. Co-authored-by: Noah Allen <noahtallen@gmail.com> (cherry picked from commit d7f3337)
(cherry picked from commit 1cacd5e)
LibSass (node-sass 4.14.1) has no Node.js 24 binary and does not compile against Node.js 24. node-sass becomes an alias of sass 1.32.8, the version WordPress 5.4 builds its own styles with. bin/packages/build-worker.js keeps calling render(). Dart Sass reads an imported .css file as plain CSS, so the react-dates stylesheet, which calls darken(), fails to compile. An importer passes that file to Sass as SCSS, as LibSass read it.
webpack 4 hashes with md4, which OpenSSL 3 disables, so webpack and the Jest tests that run webpack get --openssl-legacy-provider. `wp-scripts build` and `wp-scripts start` start webpack in a new process, which does not receive the flag, so the scripts run webpack's binary with node directly. Jest also gets --unhandled-rejections=warn, Node.js 14's behavior: packages/data/src/test/registry.js and packages/env/test/config.js leave promises rejected, which otherwise ends their Jest workers on Node.js 15 and later.
Converts the npm 6 lockfile to lockfileVersion 3 and records the backported simple-git change. `legacy-peer-deps = true` makes npm 11 resolve peer dependencies as npm 6 did. simple-git is 2.35.0, with @kwsites/file-exists and @kwsites/promise-deferred 1.1.1, the versions gutenberg#28848 installed. nodegit 0.27.0 and its dependencies are removed, and sass 1.32.8 replaces node-sass 4.14.1 and its dependencies. 18 nested entries that nothing requires are dropped. No other installed version changes.
|
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. |
`wp-scripts env test-php` builds the PHPUnit config path from npm_package_wp_env_plugin_dir, which npm 6 set from package.json's "wp-env" field. npm 7 and later no longer export arbitrary package.json fields, so on npm 11 the path is wp-content/plugins/undefined/. test-unit-php and test-unit-php-multisite set it to gutenberg, the "wp-env" "plugin-dir" value. test-php.js reads no other npm_package_wp_env_* variable.
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.4, as on trunk, and makes the branch install, build and run its unit tests with Node.js 24 and npm 11.Why?
The wordpress-develop 5.4 branch moves to Node.js 24 in WordPress/wordpress-develop#15697. This branch's CI takes Node.js from
.nvmrc, and with only that changenpm cifails on Node.js 24 and npm 11.How?
.nvmrcis 24.20.wp-envclones, fetches (with--tags) and checks out git sources withsimple-gitinstead of NodeGit, which does not build on Node.js 24 and failsnpm ci. On this branch the code is inpackages/env/lib/download-source.jsand usessource.path.packages/envdepends onsimple-git^2.35.0in place ofnodegit, the rootsimple-gitdevDependency moves from 1.113.0 to^2.35.0, andpackages/env/CHANGELOG.mdgets the backported breaking change entry.bin/commander.jskeepsrequire( 'simple-git/promise' ), which simple-git 2.35.0 still provides. The backported change tobin/plugin/lib/git.jsis left out, because that file does not exist on this branch.node-sassdevDependency (LibSass 4.14.1, which has no Node.js 24 binary and does not compile against it) becomesnpm:sass@1.32.8, thesassversion WordPress 5.4 uses.bin/packages/build-worker.jspasses Sass an importer that returnsnode_modules/react-dates/lib/css/_datepicker.cssas SCSS: Dart Sass reads an imported.cssfile as plain CSS and rejects itsdarken()call, which LibSass compiled.buildanddevrun webpack asnode --openssl-legacy-provider ./node_modules/webpack/bin/webpack.jsin place ofwp-scripts buildandwp-scripts start, because webpack 4 hashes with md4, which OpenSSL 3 disables. Thewp-scriptscommands start webpack in a new process, which a flag on the outernodedoes not reach.buildsetsNODE_ENV=production, aswp-scripts builddid.test-unitruns@wordpress/scripts'test-unit-js.jswithnode --openssl-legacy-provider --unhandled-rejections=warn, which is whatwp-scripts test-unit-jsran. The webpack plugin test suites run webpack inside Jest, andpackages/data/src/test/registry.jsandpackages/env/test/config.jsleave a promise rejected, which ends the Jest worker on Node.js 15 and later. Node.js 14 only warned.test-unit-phpandtest-unit-php-multisitesetnpm_package_wp_env_plugin_dir=gutenbergwithcross-env.wp-scripts env test-phpbuilds the PHPUnit config path from that variable, which npm 6 set from package.json'swp-envfield and npm 7 and later no longer set, so PHPUnit looked inwp-content/plugins/undefined/..npmrcsetslegacy-peer-deps = true, which keeps npm 6's peer dependency handling.package-lock.jsonfrom lockfile version 1 to 3 with npm 11. Installed versions change only through the changes above:sass1.32.8 replacesnode-sass4.14.1, whose dependencies are removed;simple-gitmoves from 1.113.0 to 2.35.0, the version wp-env: Use Simple Git instead of NodeGit #28848 locked, and its nesteddebugandmsfrom 4.1.1 and 2.1.1 to 4.4.3 and 2.1.3;@kwsites/file-exists1.1.1 (with a nesteddebug4.4.3 andms2.1.3) and@kwsites/promise-deferred1.1.1 are added;nodegit0.27.0 and the packages only it used, such asgot10 andnode-pre-gyp, are removed. 18 nested entries that no package requires, under@lerna/*,@jest/reporters,file-system-cache,fstreamandmetro-cache, are dropped.Testing Instructions
With Node.js 24 and npm 11:
npm ci && npm run build && npm run test-unit.The built JavaScript and every other non-CSS file is byte-identical to a Node.js 14 build of
wp/5.4, and the unit test results are the same. The built CSS has the same rules; Dart Sass writes them in a different notation: 10 decimals instead of 5,@charset "UTF-8"with literal characters instead of escapes incontent, unquoted attribute selector values, hex instead ofrgb(), and one@mediablock per rule instead of merged blocks.Use of AI Tools
AI assistance: Yes
Tools: Claude Code
Model: Claude Opus 5.5
Used for: Backporting the two PRs, applying the changes, regenerating the lockfile, building and testing on Node.js 14 and 24 and comparing the output, and drafting this description.