mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
test(router-plugin): React Refresh outcomes in a real page; delete the refresh runtime model
User ruling 2026-10-18: no copies of React HMR logic in tests. Deleted (copies of React Refresh / plugin-react behaviour): - regression-helpers `isRefreshable` / `expectRefreshableRouteOption`: modelled how React Refresh's runtime resolves memo / forwardRef to a registered family. - react-refresh-route-components "a React route module compiled for Vite stays a Fast Refresh boundary" (6 tests): evaluated the module twice with one hot context and called plugin-react's validateRefreshBoundaryAndEnqueueUpdate by hand, as its accept glue does. - react-refresh-route-components "React Refresh registers split route components" (memo / forwardRef rows) and "hoists the components of the module's Route when another route is created first". - known-bugs-route-hmr "React Refresh registration": the memo(Page) control, the "registers an inline component written as $name" pins and "registers a method-shorthand component of a split route". Replacements on the real page harness (route-hmr-page.ts, Vite + @vitejs/plugin-react, headless Chromium): - route-hmr-browser: a route without a component and a root route with an inline stateful component apply their edits in place (state kept, no reload), autoCodeSplitting on and off; split components written inline in memo / forwardRef calls, and inline components after another route the module creates (unsplit component, and the route module's pendingComponent when split), show their edits without a reload. `extra` is no longer exported there: an exported route object makes plugin-react reload the page (React Refresh boundary rule), which was not what the source test was about. - known-bugs-route-hmr "route HMR in a real page": control memo(Page) unsplit; pins (each verified red by one run without .fails: the page keeps "inline v1" / "root v1", no reload) for `as any`, `satisfies`, memo(() => ...), forwardRef(function ...), method shorthand (unsplit and split) and React.memo(forwardRef(...)) on a root route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d14697f7b0
commit
ac3f8d5ac9
4 changed files with 310 additions and 317 deletions
Loading…
Add table
Add a link
Reference in a new issue