Semantic Diff

#9059 Develop and test with Node.js 26

1 commit

230405f3663725799120d75be576018b4967754f..pr-9059

8ba10b3e8 · mununki · Oct 26, 2026, 14:43 UTC

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.escape and DataView.getFloat16/setFloat16, which DocTest.res skips below Node.js 24, now run in CI. They pass on 26.12.1, as does the rest of make test.
  • Do the copied stdlib tests need anything else from the repository? No. Apart from @babel/code-frame they import only each other, ./Test.mjs, @rescript/runtime/lib/es6 and Node.js built-ins. Test.mjs reads the .res source 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_TestSuite or Stdlib_TempTests, which now also run on 22. Comments on the workflow step and in Stdlib_TestSuite.res say so. The Temporal tests will need an entry point that only scripts/test.js runs.
  • Does the new step work on Windows? It copies with the same Git Bash cp as the existing installation_test copy, and the tests find the runtime through node_modules. Test.mjs takes its directory from the pathname of import.meta.url, which starts with /C:/ on Windows, so a failing assertion there reports a missing .res file 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.sh ran it; the workflows never do.