0
Fork 0
mirror of https://github.com/TanStack/router.git synced 2026-11-16 19:38:07 +00:00

chore(compiler): require Node with require(esm) for the CommonJS builds, and say what changes in the changesets

`yuku` is ESM-only and the CommonJS builds of router-utils, router-plugin
and router-generator (and the `tsr` binary) `require()` it: Node loads an
ES module through `require()` without a flag only from 20.19 and 22.12
(23 and later always). `engines` of those packages, and of router-cli,
now say `^20.19.0 || >=22.12.0` instead of `>=20.19`, which admitted
21 and 22.0–22.11, where a `webpack.config.js` requiring the plugin throws
ERR_REQUIRE_ESM. Loading yuku through a dynamic `import()` instead would
make the synchronous parse API asynchronous, so the range is the fix.

The Start and router-plugin changesets open with what changes for an app
that upgrades: every server function id changes, `generateFunctionId`
receives the stable name, production refuses HTTP calls to server
functions no client module imports, unparsable modules fail the client
build, esbuild refuses code splitting, the removed experimental hooks,
the one-time route tree formatting change, and the Node range.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Sheraff 2026-10-25 23:56:10 +01:00
commit b01bb76ee3
No known key found for this signature in database
8 changed files with 24 additions and 4 deletions