mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
test(router-plugin): extend the route HMR harness
- `hotUpdate` returns the `window` the modules ran with, and with webpack configures the plugins through their `webpack(compiler)` hook with a compiler that has the React Refresh plugin or none (`webpackCompiler`), so a fix that detects React Refresh from the bundler configuration is seen. - `createRouteLoader` compiles successive versions of a route file with one code-splitter plugin instance, as a dev server does; `loadRoute` and `compileRouteModules` take the Vite `command`. - `isRefreshable` (registered, or a memo/forwardRef of a registered component) and `evaluateRouteModule` (exports, Route, registrations) are exported. - dev-server.ts: `routerPackageStub(target)` serves a router package whose lazy options can be loaded, `importRouteModule` serves and imports a route module, plus the route-module-export assertions shared by the dev-server tests. - `@vitejs/plugin-react` becomes a devDependency (catalog) for the plugin-react HMR boundary control; lockfile regenerated with `pnpm install --no-frozen-lockfile`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
2d84189760
commit
5634f0f009
4 changed files with 321 additions and 66 deletions
Loading…
Add table
Add a link
Reference in a new issue