Develop and test with Node.js 26
The Temporal bindings (#9044) need the Temporal global, which Node.js 22 lacks and Node.js 26 provides, so their tests and doc examples can run in CI only on Node.js 26. .nvmrc now names 26. The build, coverage and publish jobs read it through the setup-node action and pkg-pr-new reads it directly; the changelog check now reads it too instead of naming 22. The dev container and CONTRIBUTING.md move to 26 as well.
The installation tests keep Node.js 22, the oldest version the packages support (engines >=22). build-compiler no longer runs the stdlib tests on 22, so both installation jobs now run them there. They copy the compiled tests in tests/tests/src/stdlib next to the installed packages, install @babel/code-frame, which Test.mjs imports, at the version tests/tests declares, and run Stdlib_TestSuite.mjs and Stdlib_TempTests.mjs against the runtime from pkg.pr.new.
Node.js 25 stopped bundling corepack. The dev container's Node feature enables corepack where Node.js bundles it and installs yarn with npm otherwise, so postCreate.sh no longer runs corepack enable, which would fail on 26.
Review
- Do any tests behave differently on 26? The runtime doc examples for
RegExp.escapeandDataView.getFloat16/setFloat16, whichDocTest.resskips below Node.js 24, now run in CI. They pass on 26.12.1, as does the rest ofmake test. - Do the copied stdlib tests need anything else from the repository? No. Apart from
@babel/code-framethey import only each other,./Test.mjs,@rescript/runtime/lib/es6and Node.js built-ins.Test.mjsreads the.ressource next to it only to print a failure, and the copy includes the sources. - Where do tests of APIs that Node.js 22 lacks go? Not into
Stdlib_TestSuiteorStdlib_TempTests, which now also run on 22. Comments on the workflow step and inStdlib_TestSuite.ressay so. The Temporal tests will need an entry point that onlyscripts/test.jsruns. - Does the new step work on Windows? It copies with the same Git Bash
cpas the existinginstallation_testcopy, and the tests find the runtime throughnode_modules.Test.mjstakes its directory from the pathname ofimport.meta.url, which starts with/C:/on Windows, so a failing assertion there reports a missing.resfile instead of a code frame. The step still fails, just as the stdlib tests in the Windows build-compiler job do today. - Does anything else rely on corepack? No. Only
postCreate.shran it; the workflows never do.