diff --git a/.changeset/clever-buttons-push.md b/.changeset/clever-buttons-push.md new file mode 100644 index 0000000000..d9fb637d2d --- /dev/null +++ b/.changeset/clever-buttons-push.md @@ -0,0 +1,12 @@ +--- +'@tanstack/router-cli': minor +'@tanstack/router-plugin': minor +'@tanstack/router-vite-plugin': minor +'@tanstack/start-plugin-core': minor +'@tanstack/react-start': minor +'@tanstack/solid-start': minor +'@tanstack/vue-start': minor +'@tanstack/react-start-rsc': minor +--- + +Require Node.js 22.22.0 or later for Router and Start build tooling. Upgrade file watching to Chokidar 6. diff --git a/.changeset/itchy-chairs-melt.md b/.changeset/itchy-chairs-melt.md new file mode 100644 index 0000000000..2ea0e1e902 --- /dev/null +++ b/.changeset/itchy-chairs-melt.md @@ -0,0 +1,5 @@ +--- +'@tanstack/router-plugin': patch +--- + +Preserve JSX and TypeScript syntax when splitting route components wrapped in calls such as React `memo` and Vue `defineComponent`. diff --git a/.changeset/route-modules-devtools.md b/.changeset/route-modules-devtools.md new file mode 100644 index 0000000000..e60fb2c888 --- /dev/null +++ b/.changeset/route-modules-devtools.md @@ -0,0 +1,5 @@ +--- +'@tanstack/router-devtools-core': minor +--- + +Experimental: The router devtools show route modules. Each mounted module's routes form a collapsible group, nested where the module is mounted, and a filter narrows the route tree to one module. A module panel shows the module's mount path, parent module, routes with their module-local and final paths, and active matches. Matches carry a module badge, and match details show the module, the local path and the final path. diff --git a/.changeset/route-modules-eslint.md b/.changeset/route-modules-eslint.md new file mode 100644 index 0000000000..cc98d7db17 --- /dev/null +++ b/.changeset/route-modules-eslint.md @@ -0,0 +1,5 @@ +--- +'@tanstack/eslint-plugin-router': minor +--- + +Experimental: Add the `route-module-imports` rule, enabled in the recommended configs: files of a route module must import routing and Start APIs from the module's generated route scope, and must not import, in values or in types, from a module the package lists in `uses`. The rule only applies to packages that declare `tanstack.router.module`. diff --git a/.changeset/route-modules-generator.md b/.changeset/route-modules-generator.md new file mode 100644 index 0000000000..443773327e --- /dev/null +++ b/.changeset/route-modules-generator.md @@ -0,0 +1,7 @@ +--- +'@tanstack/router-generator': minor +'@tanstack/router-cli': minor +'@tanstack/router-plugin': minor +--- + +Experimental: Generate route modules. A package that declares `tanstack.router.module` in its `package.json` gets qualified route ids (`:`), a generated route scope (`routeScope.gen.ts`, with one namespace file per included or used module, placed by the `routeScopeNamespaceFiles` option: `'indexed'`, `'named'`, `'folder'` or a function), a public contract (`routeContract.gen.ts`, exported as `./route-types` after the package's own declaration build), a runtime entry (`routeModule.gen.ts`, exported as `./route-module`) and a topology manifest (`.tanstack/route-module.json`) for includers. Module identity is the package name. Applications and modules mount modules with the `routeModules` option: `includes` chooses the host route and mount path of each module and `uses` references modules mounted elsewhere. An application installs a module several times by including it once per installation, each named with `as`; every installation gets its own namespace and route ids, and a module that uses it links to the installation mounted above it. A module mounted under path params gets a namespace typed with them in its includers; the generator rejects a module that uses it without being mounted below those params, and rejects mounts whose full paths collide. `tsr generate` emits the module files. Packages emit and check declarations with their own TypeScript projects; Nx or similar workspace tooling reruns generation and compilation in dependency order when sources, configuration or provider artifacts change. `tsr watch` retains its standalone route-directory and configuration watching. The bundler plugin compiles, code-splits and hot-updates mounted module routes, including every installation of a module installed several times. Route modules can use each other in both directions, and a module can use the module that includes it: `uses` is a contract relation, so generation reads only the used package's `package.json`, and the declaration build compiles against generated stand-ins for the used contracts (`.tanstack/route-types-stubs.d.ts`, to be included by the package's declaration build only); only the source check reads the real contracts. A used module may be declared in `dependencies`, `devDependencies` or `peerDependencies`. A module's contract (`routeContract.gen.ts`, which now declares the module's register and router types) reaches its own files, the framework and the contracts of included modules only; the routes of used modules are addressed through their namespaces. `includes` cycles are rejected with a diagnostic. Applications without route modules generate the same output as before. diff --git a/.changeset/route-modules-router.md b/.changeset/route-modules-router.md new file mode 100644 index 0000000000..b8f42ebc86 --- /dev/null +++ b/.changeset/route-modules-router.md @@ -0,0 +1,8 @@ +--- +'@tanstack/router-core': minor +'@tanstack/react-router': minor +'@tanstack/solid-router': minor +'@tanstack/vue-router': minor +--- + +Experimental: Add route modules: workspace packages that own a subtree of file-based routes and are mounted into applications or other modules. The generated host route tree mounts a module root under a host route and type-checks the mount: a static mount path, no required search params above the module, the router context the module requires, and serializable lifecycle results in server-rendered applications. Module routes, links, navigation, redirects and hooks come from the module's generated route scope and take module-local paths and qualified route ids wherever the module is mounted; `getRouteApi` and route-bound hooks resolve the nearest installation. A module mounted under path params keeps the params of the current location in its own links, and `HostedRouter` types the links of code that mounts it. A module installed several times gets one copy of its routes per installation, with ids `#:/…`; module-local ids, destinations, redirects and not-found errors resolve to the installation of the route that uses them, and `InstallationRoutesById` types an installation's routes. Matches of module routes carry `localRouteId`, the installation-independent id, and the generated `isScopedMatch` guard narrows whole-router matches to the routes of a scope. Applications without route modules are unaffected. diff --git a/.changeset/route-modules-start.md b/.changeset/route-modules-start.md new file mode 100644 index 0000000000..fea474bcd0 --- /dev/null +++ b/.changeset/route-modules-start.md @@ -0,0 +1,9 @@ +--- +'@tanstack/start-client-core': minor +'@tanstack/start-plugin-core': minor +'@tanstack/react-start': minor +'@tanstack/solid-start': minor +'@tanstack/vue-start': minor +--- + +Experimental: Support route modules in TanStack Start. A module that depends on the Start framework package gets `createServerFn`, `createMiddleware` and `createStartModule` in its generated route scope. It declares the context it requires from the application by augmenting `StartModuleRequirements`, keyed by its package name, with `requestContext` and `functionContext`; the declaration emits no JavaScript. A module that contributes serialization adapters or middleware exports a fragment created with `createStartModule` from `start.ts`, and applications install the generated list with `createStart(() => ({ extends: startModules }))`; the application's own entries run first and entries are deduplicated by identity. The generated `startModules.gen.ts` type-checks that the application installs every fragment and provides the required context. The Start plugin lists module routes in the routes manifest, selects the providers' client tree views for client builds, discovers prerenderable module pages and extends import protection to installed module packages. diff --git a/.changeset/router-core-extensions.md b/.changeset/router-core-extensions.md new file mode 100644 index 0000000000..eb667c584e --- /dev/null +++ b/.changeset/router-core-extensions.md @@ -0,0 +1,10 @@ +--- +'@tanstack/router-core': minor +'@tanstack/react-router': minor +'@tanstack/solid-router': minor +'@tanstack/vue-router': minor +'@tanstack/start-client-core': patch +'@tanstack/react-start-rsc': patch +--- + +Declarations emitted by packages that use the router now import router types from the framework package, for example `@tanstack/react-router`, instead of `@tanstack/router-core`, which pnpm does not let those packages resolve unless they depend on it. The framework packages augment the new `@tanstack/router-core/extensions` entry instead of `@tanstack/router-core`, and the router packages export router-core's `Route` interface, which `createFileRoute` returns, as `RouteCore`. Existing augmentations of `@tanstack/router-core` keep working. diff --git a/.changeset/salty-dryers-move.md b/.changeset/salty-dryers-move.md new file mode 100644 index 0000000000..d9612eaf47 --- /dev/null +++ b/.changeset/salty-dryers-move.md @@ -0,0 +1,5 @@ +--- +'@tanstack/router-generator': patch +--- + +Use the package name as the route module's identity. Remove the experimental custom module ID override so generated routes and consumer scopes use the same identity. diff --git a/.changeset/start-modules-many-fragments.md b/.changeset/start-modules-many-fragments.md new file mode 100644 index 0000000000..99e34250c2 --- /dev/null +++ b/.changeset/start-modules-many-fragments.md @@ -0,0 +1,5 @@ +--- +'@tanstack/start-client-core': patch +--- + +Type-check `createStart(() => ({ extends: startModules }))` for applications that install the Start fragments of many route modules. With about 50 fragments, TypeScript reported "Type instantiation is excessively deep and possibly infinite". diff --git a/.changeset/start-rsbuild-compiler-esm-resolve.md b/.changeset/start-rsbuild-compiler-esm-resolve.md new file mode 100644 index 0000000000..fe04e03124 --- /dev/null +++ b/.changeset/start-rsbuild-compiler-esm-resolve.md @@ -0,0 +1,5 @@ +--- +'@tanstack/start-plugin-core': patch +--- + +Rsbuild: the Start compiler resolves the imports it follows, such as those of a module that re-exports `createServerFn`, as ES module imports. It used the loader's base resolver, so packages whose exports only list `import`, like `@tanstack/react-start`, failed to resolve and the build stopped. diff --git a/.changeset/true-houses-behave.md b/.changeset/true-houses-behave.md new file mode 100644 index 0000000000..722483ca4d --- /dev/null +++ b/.changeset/true-houses-behave.md @@ -0,0 +1,16 @@ +--- +'@tanstack/router-core': patch +'@tanstack/react-router': patch +'@tanstack/solid-router': patch +'@tanstack/vue-router': patch +'@tanstack/router-devtools-core': patch +'@tanstack/router-cli': patch +'@tanstack/router-generator': patch +'@tanstack/start-client-core': patch +'@tanstack/start-plugin-core': patch +'@tanstack/react-start': patch +'@tanstack/solid-start': patch +'@tanstack/vue-start': patch +--- + +Correct experimental route-module installation identity, scope ownership, framework navigation parity, and Start context validation. Generate independently tree-shakeable scope APIs and explicit dependency namespaces, and keep module composition helpers internal. Use ordinary TypeScript declaration builds, refresh route topology during development, and include provider routes in Start client pruning and prerender discovery. diff --git a/benchmarks/bundle-size/.gitignore b/benchmarks/bundle-size/.gitignore index bd05a98cee..9de4c739f1 100644 --- a/benchmarks/bundle-size/.gitignore +++ b/benchmarks/bundle-size/.gitignore @@ -2,6 +2,9 @@ node_modules dist dist-debug scenarios/*/src/routeTree.gen.ts +# Generated by the route-module scenarios. +scenarios/*/src/*.gen.* +modules/*/src/*.gen.* results/*.json results/*.md diff --git a/benchmarks/bundle-size/modules/feature/generate.ts b/benchmarks/bundle-size/modules/feature/generate.ts new file mode 100644 index 0000000000..3d8da20486 --- /dev/null +++ b/benchmarks/bundle-size/modules/feature/generate.ts @@ -0,0 +1,15 @@ +import { fileURLToPath } from 'node:url' +import { Generator, getConfig } from '@tanstack/router-generator' + +const root = fileURLToPath(new URL('.', import.meta.url)) + +/** + * Generates and publishes the route module, like `tsr generate` in the + * module's package: an application can only mount a generated module. + */ +export async function generateFeatureModule() { + await new Generator({ + root, + config: getConfig({ disableLogging: true, target: 'react' }, root), + }).run() +} diff --git a/benchmarks/bundle-size/modules/feature/package.json b/benchmarks/bundle-size/modules/feature/package.json new file mode 100644 index 0000000000..1b678115cd --- /dev/null +++ b/benchmarks/bundle-size/modules/feature/package.json @@ -0,0 +1,19 @@ +{ + "name": "@benchmarks/feature", + "private": true, + "type": "module", + "sideEffects": false, + "tanstack": { + "router": { + "module": true + } + }, + "exports": { + "./route-module": "./src/routeModule.gen.ts", + "./package.json": "./package.json" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0" + } +} diff --git a/benchmarks/bundle-size/modules/feature/src/routes/__root.tsx b/benchmarks/bundle-size/modules/feature/src/routes/__root.tsx new file mode 100644 index 0000000000..3aa681ac8e --- /dev/null +++ b/benchmarks/bundle-size/modules/feature/src/routes/__root.tsx @@ -0,0 +1,15 @@ +import { Outlet } from '@tanstack/react-router' +import { Link, createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ + component: FeatureLayout, +}) + +function FeatureLayout() { + return ( + <> + Feature home + + + ) +} diff --git a/benchmarks/bundle-size/modules/feature/src/routes/index.tsx b/benchmarks/bundle-size/modules/feature/src/routes/index.tsx new file mode 100644 index 0000000000..b34c2d4490 --- /dev/null +++ b/benchmarks/bundle-size/modules/feature/src/routes/index.tsx @@ -0,0 +1,20 @@ +import { createFileRoute, useLocation, useMatch } from '../routeScope.gen' + +export const Route = createFileRoute('@benchmarks/feature:/')({ + component: FeatureIndex, +}) + +// Reads the router through the module's scope: a framework hook and an +// id-based hook that takes the module's own route ids. +function FeatureIndex() { + const pathname = useLocation({ select: (location) => location.pathname }) + const routeId = useMatch({ + from: '@benchmarks/feature:/', + select: (match) => match.routeId, + }) + return ( +
+ {routeId} {pathname} +
+ ) +} diff --git a/benchmarks/bundle-size/package.json b/benchmarks/bundle-size/package.json index ca34cd6cd7..39b9a00735 100644 --- a/benchmarks/bundle-size/package.json +++ b/benchmarks/bundle-size/package.json @@ -54,6 +54,7 @@ } }, "dependencies": { + "@benchmarks/feature": "workspace:*", "@tanstack/react-router": "workspace:^", "@tanstack/react-router-ssr-query": "workspace:^", "@tanstack/solid-router": "workspace:^", @@ -70,6 +71,7 @@ "devDependencies": { "@rsbuild/core": "^2.3.1", "@rsbuild/plugin-react": "^2.0.0", + "@tanstack/router-generator": "workspace:^", "@tanstack/router-plugin": "workspace:^", "@types/react": "^19.0.8", "@types/react-dom": "^19.0.3", diff --git a/benchmarks/bundle-size/scenarios/react-router-route-modules/index.html b/benchmarks/bundle-size/scenarios/react-router-route-modules/index.html new file mode 100644 index 0000000000..5de4e4e509 --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-router-route-modules/index.html @@ -0,0 +1,12 @@ + + + + + + react-router-minimal + + +
+ + + diff --git a/benchmarks/bundle-size/scenarios/react-router-route-modules/src/main.tsx b/benchmarks/bundle-size/scenarios/react-router-route-modules/src/main.tsx new file mode 100644 index 0000000000..667de2cdc7 --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-router-route-modules/src/main.tsx @@ -0,0 +1,19 @@ +import ReactDOM from 'react-dom/client' +import { RouterProvider, createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' + +const router = createRouter({ routeTree }) + +declare module '@tanstack/react-router' { + interface Register { + router: typeof router + } +} + +const rootElement = document.getElementById('app') +if (!rootElement) { + throw new Error('Root element `#app` not found') +} +if (!rootElement.innerHTML) { + ReactDOM.createRoot(rootElement).render() +} diff --git a/benchmarks/bundle-size/scenarios/react-router-route-modules/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/react-router-route-modules/src/routes/__root.tsx new file mode 100644 index 0000000000..889395056b --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-router-route-modules/src/routes/__root.tsx @@ -0,0 +1,9 @@ +import { Outlet, createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute({ + component: RootComponent, +}) + +function RootComponent() { + return +} diff --git a/benchmarks/bundle-size/scenarios/react-router-route-modules/src/routes/index.tsx b/benchmarks/bundle-size/scenarios/react-router-route-modules/src/routes/index.tsx new file mode 100644 index 0000000000..a6542ec95f --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-router-route-modules/src/routes/index.tsx @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' +import { feature } from '../routeScope.gen' + +export const Route = createFileRoute('/')({ + component: IndexComponent, +}) + +// Links into the mounted route module through its namespace. +function IndexComponent() { + return Feature +} diff --git a/benchmarks/bundle-size/scenarios/react-router-route-modules/vite.config.ts b/benchmarks/bundle-size/scenarios/react-router-route-modules/vite.config.ts new file mode 100644 index 0000000000..a72380c909 --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-router-route-modules/vite.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import { tanstackRouter } from '@tanstack/router-plugin/vite' +import { generateFeatureModule } from '../../modules/feature/generate' + +// The minimal app with a mounted route module, which must be generated first. +await generateFeatureModule() + +export default defineConfig({ + plugins: [ + tanstackRouter({ + target: 'react', + autoCodeSplitting: true, + routeModules: { + includes: [{ module: '@benchmarks/feature', at: '/feature' }], + }, + }), + react(), + ], +}) diff --git a/benchmarks/bundle-size/scenarios/react-start-route-modules/src/router.tsx b/benchmarks/bundle-size/scenarios/react-start-route-modules/src/router.tsx new file mode 100644 index 0000000000..9d87d8748b --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-start-route-modules/src/router.tsx @@ -0,0 +1,9 @@ +import { createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' + +export function getRouter() { + return createRouter({ + routeTree, + scrollRestoration: true, + }) +} diff --git a/benchmarks/bundle-size/scenarios/react-start-route-modules/src/routes/__root.tsx b/benchmarks/bundle-size/scenarios/react-start-route-modules/src/routes/__root.tsx new file mode 100644 index 0000000000..ff1da4c304 --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-start-route-modules/src/routes/__root.tsx @@ -0,0 +1,24 @@ +import { + HeadContent, + Outlet, + Scripts, + createRootRoute, +} from '@tanstack/react-router' + +export const Route = createRootRoute({ + component: RootComponent, +}) + +function RootComponent() { + return ( + + + + + + + + + + ) +} diff --git a/benchmarks/bundle-size/scenarios/react-start-route-modules/src/routes/index.tsx b/benchmarks/bundle-size/scenarios/react-start-route-modules/src/routes/index.tsx new file mode 100644 index 0000000000..a6542ec95f --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-start-route-modules/src/routes/index.tsx @@ -0,0 +1,11 @@ +import { createFileRoute } from '@tanstack/react-router' +import { feature } from '../routeScope.gen' + +export const Route = createFileRoute('/')({ + component: IndexComponent, +}) + +// Links into the mounted route module through its namespace. +function IndexComponent() { + return Feature +} diff --git a/benchmarks/bundle-size/scenarios/react-start-route-modules/vite.config.ts b/benchmarks/bundle-size/scenarios/react-start-route-modules/vite.config.ts new file mode 100644 index 0000000000..3fa8b58215 --- /dev/null +++ b/benchmarks/bundle-size/scenarios/react-start-route-modules/vite.config.ts @@ -0,0 +1,20 @@ +import { defineConfig } from 'vite' +import viteReact from '@vitejs/plugin-react' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import { generateFeatureModule } from '../../modules/feature/generate' + +// The minimal app with a mounted route module, which must be generated first. +await generateFeatureModule() + +export default defineConfig({ + plugins: [ + tanstackStart({ + router: { + routeModules: { + includes: [{ module: '@benchmarks/feature', at: '/feature' }], + }, + }, + }), + viteReact(), + ], +}) diff --git a/benchmarks/client-nav/link-performance/cases.ts b/benchmarks/client-nav/link-performance/cases.ts index a25eac563b..9203d3ff35 100644 --- a/benchmarks/client-nav/link-performance/cases.ts +++ b/benchmarks/client-nav/link-performance/cases.ts @@ -25,6 +25,12 @@ export const LINK_CASES = [ label: 'Relative targets', description: 'Parent and child targets inherit current params and search.', }, + { + id: 'route-bound', + label: 'Route-bound relative targets', + description: + 'The relative case through Route.Link, which resolves from its route.', + }, { id: 'middleware', label: 'Search middleware chain', @@ -103,6 +109,7 @@ export function sourceSearch( switch (caseId) { case 'location-updaters': case 'relative': + case 'route-bound': case 'middleware': case 'active': return { @@ -157,6 +164,7 @@ function url(pathname: string, search: Partial = {}, hash = '') { function sourcePath(caseId: LinkCaseId, stateIndex: number) { switch (caseId) { case 'relative': + case 'route-bound': return `/teams/team-${stateIndex}/item-${stateIndex}` case 'numeric-params': return `/numbers/${stateIndex}` @@ -210,6 +218,7 @@ function expectedHref(caseId: LinkCaseId, stateIndex: number, index: number) { `source-${stateIndex}-link-${index % 5}`, ) case 'relative': + case 'route-bound': return url( index % 2 === 0 ? `/teams/team-${stateIndex}` diff --git a/benchmarks/client-nav/link-performance/src/workload.tsx b/benchmarks/client-nav/link-performance/src/workload.tsx index 8315b85b8b..62107e525c 100644 --- a/benchmarks/client-nav/link-performance/src/workload.tsx +++ b/benchmarks/client-nav/link-performance/src/workload.tsx @@ -238,6 +238,7 @@ function sourceOptions(caseId: LinkCaseId, stateIndex: number) { } switch (caseId) { case 'relative': + case 'route-bound': return linkOptions({ ...common, to: '/teams/$teamId/$itemId', @@ -386,6 +387,15 @@ function measuredLink( search /> ) + case 'route-bound': + return ( + + ) case 'middleware': return ( [!WARNING] +> This rule supports [route modules](../routing/route-modules.md), which are experimental. The rule may change with them in any release. + +Files of a [route module](../routing/route-modules.md) must import routing and Start APIs from the module's generated route scope (`routeScope.gen.ts`), which types them against the module's own routes. The same APIs imported from `@tanstack/react-router`, `@tanstack/solid-router`, `@tanstack/vue-router` or the framework's Start package are typed against an application the module does not know. + +The rule reports value imports of these APIs from the framework packages: + +- Route constructors and routing APIs: `createFileRoute`, `Link`, `createLink`, `linkOptions`, `Navigate`, `useNavigate`, `redirect`, `MatchRoute`, `useMatchRoute`, `useRouter`, `getRouteApi`, `useMatch`, `useMatches`, `useParentMatches`, `useChildMatches`, `useLoaderData`, `useLoaderDeps`, `useSearch`, `useParams`, `useRouteContext`, `useLocation`, `useRouterState`, `useLinkProps`, `useBlocker` and `notFound`. +- Root route constructors (`createRootRoute`, `createRootRouteWithContext`): a module root is created with `createModuleRoot`. +- Start APIs of Start route modules: `createServerFn`, `createMiddleware` and `createStartModule`. + +The rule also reports every import from a module the package lists in `uses` (`"@acme/products"` or any of its entry points), including type-only imports, re-exports and dynamic imports. A route module links into the modules it uses through the generated namespaces; its declaration build compiles against a stand-in for each used contract, so a type imported from a used module would be emitted with the stand-in's types. Move code that several modules share into a package both depend on. + +The rule only applies to files whose nearest `package.json` declares `tanstack.router.module`. It ignores generated files, and type-only imports of the framework packages. + +## Rule Details + +Examples of **incorrect** code for this rule: + +```tsx title="packages/products/src/routes/$productId.tsx" +/* eslint "@tanstack/router/route-module-imports": "error" */ +import { createFileRoute, Link } from '@tanstack/react-router' + +export const Route = createFileRoute('@acme/products:/$productId')({ + component: () => All products, +}) +``` + +```tsx title="packages/products/src/routes/index.tsx" +/* eslint "@tanstack/router/route-module-imports": "error" */ +// package.json: "tanstack": { "router": { "module": { "uses": ["@acme/account"] } } } +import type { Order } from '@acme/account/api' +import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@acme/products:/')({ + loader: (): Promise> => fetchOrders(), +}) +``` + +Examples of **correct** code for this rule: + +```tsx title="packages/products/src/routes/$productId.tsx" +/* eslint "@tanstack/router/route-module-imports": "error" */ +import { Outlet } from '@tanstack/react-router' +import { createFileRoute, Link } from '../routeScope.gen' + +export const Route = createFileRoute('@acme/products:/$productId')({ + component: () => All products, +}) +``` + +```tsx title="packages/products/src/routes/index.tsx" +/* eslint "@tanstack/router/route-module-imports": "error" */ +import type { Order } from '@acme/orders-types' +import { account, createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@acme/products:/')({ + loader: (): Promise> => fetchOrders(), + component: () => ( + + My last order + + ), +}) +``` + +## Attributes + +- [x] ✅ Recommended +- [ ] 🔧 Fixable diff --git a/docs/router/routing/route-modules.md b/docs/router/routing/route-modules.md new file mode 100644 index 0000000000..9077b34814 --- /dev/null +++ b/docs/router/routing/route-modules.md @@ -0,0 +1,513 @@ +--- +id: route-modules +title: Route Modules (Experimental) +--- + +> [!WARNING] +> Route modules are experimental. Their APIs, generated files, `package.json` fields, CLI commands and TanStack Start integration may change in any release, including minor and patch releases. Pin your TanStack Router versions when you adopt them. + +A **route module** is a workspace package that owns a subtree of file-based routes. Applications, and other route modules, mount it into their route tree. Each module is generated and type-checked by its own package, and links into it stay fully typed wherever it is mounted. + +Use route modules when several teams or applications share routes in a monorepo: + +- A feature (a product catalog, an account area) lives in its own package with its own routes, loaders and components. +- Applications choose where a module is mounted, so the same module can appear at `/shop/products` in one app and at `/catalog` in another. +- A module only sees what it declares: its own routes, the modules it mounts or uses, and the router context it requires. + +Route modules are opt-in. Applications without them are generated exactly as before. + +> [!NOTE] +> Route modules require TypeScript, and the generator rejects `disableTypes`. Lazy route files (`createLazyFileRoute`, `.lazy.tsx`) are not supported in route modules: [automatic code splitting](../guide/automatic-code-splitting.md) splits module routes like any other route. + +## Declaring a route module + +A package is a route module when its `package.json` has a `tanstack.router.module` field: + +```json title="packages/products/package.json" +{ + "name": "@acme/products", + "type": "module", + "tanstack": { + "router": { + "module": {} + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "build:types": "node -e \"require('node:fs').rmSync('.tanstack/types', { recursive: true, force: true })\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "^1.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "^1.0.0", + "typescript": "^5.6.0" + } +} +``` + +The module's identity is its `package.json` name. Generated route IDs use that +name as their prefix, for example `@acme/products:/$productId`. + +The module field accepts these options. `true` is the same as `{}`. + +| Option | Description | +| ---------- | -------------------------------------------------------------------------- | +| `includes` | Modules installed into this module's tree, with includer-owned mount paths | +| `uses` | Explicit references to other modules' routes; defaults to an empty list | + +The two `exports` entries are the module's public surface: + +- `./route-types` points to the emitted declarations of the module's contract: its router type and route ids. Consumers only read these declarations, never the module's sources. +- `./route-module` points to the module's runtime entry, which includers mount. Applications compile it from source like any other workspace code. + +Route ids and module-local paths are part of this public surface. Consumers reference them in `getRouteApi`, `useMatch`, namespaced links and `isScopedMatch`, so renaming or moving a route file is a breaking change for them, like renaming an export. + +The package build must verify that its exported declarations and their imports resolve in consumers. Build and check declarations before publishing, including a consumer with `skipLibCheck: false` and no provider source files. + +Declarations are emitted with a `tsconfig.route-types.json` that you own: + +```json title="packages/products/tsconfig.route-types.json" +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src", ".tanstack/route-types-stubs.d.ts"] +} +``` + +The declaration build includes `.tanstack/route-types-stubs.d.ts`. The generator writes it on every run: it declares a stand-in for the contract of every module this module [uses](#linking-across-modules), and it is empty when the module uses nothing. The stand-ins let the declaration build run without the other modules' declarations, so modules can link to each other in both directions. Do not include the file in `tsconfig.json`: the source check must read the real contracts. + +## Authoring module routes + +Module routes live in the module's routes directory as usual. Two things differ from an application: + +1. **Import routing APIs from the generated scope.** `src/routeScope.gen.ts` exports `createFileRoute`, `createModuleRoot`, `Link`, `useNavigate`, `redirect`, the hooks and `useRouter`, all typed against the module's own routes. Imports from `@tanstack/react-router` would be typed against an application the module does not know. The [`route-module-imports`](../eslint/route-module-imports.md) lint rule enforces this. +2. **Route ids are qualified with the module id.** The generator writes them, exactly as it writes ids in an application. + +```tsx title="packages/products/src/routes/$productId.tsx" +import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@acme/products:/$productId')({ + loader: ({ params, context }) => + context.productsApi.getProduct(params.productId), + component: ProductPage, +}) + +function ProductPage() { + const product = Route.useLoaderData() + return ( +
+

{product.name}

+ {/* Module-local path: resolves to wherever the module is mounted. */} + All products +
+ ) +} +``` + +Paths inside a module are **module-local**. `to="/"` is the module's index route, whether the module is mounted at `/products` or `/shop/catalog`. + +### The module root and its requirements + +`src/routes/__root.tsx` creates the module root with `createModuleRoot`. Its type parameter is the router context the module requires from wherever it is mounted: + +```tsx title="packages/products/src/routes/__root.tsx" +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' +import type { ProductsApi } from '../api' + +export const Route = createModuleRoot<{ productsApi: ProductsApi }>()({ + component: () => , +}) +``` + +The module type-checks on its own against this requirement. When an application mounts the module, the mount fails to type-check unless the parent route provides that context. It does not matter whether the context comes from the application's root, `createRouter({ context })`, or a layout's `beforeLoad`. + +Shared libraries with nominal types, such as a `QueryClient` class, must resolve to one declaration in the whole workspace. Make them `peerDependencies` of route modules. + +## Mounting modules + +An application mounts modules with the `routeModules` option. It is accepted by `tsr.config.json`, the bundler plugin and the `router` option of TanStack Start: + +```json title="apps/web/tsr.config.json" +{ + "routesDirectory": "./src/routes", + "generatedRouteTree": "./src/routeTree.gen.ts", + "routeModules": { + "includes": [ + { "module": "@acme/storefront", "at": "/shop" }, + { + "module": "@acme/account", + "parent": "/_authenticated", + "at": "/account" + } + ] + } +} +``` + +A route module mounts other modules with `includes` in its own `package.json`. A string entry mounts the module under the root without adding a path segment. Use an object to select the mount and installation name: + +| Field | Description | +| -------- | ------------------------------------------------------------------------------ | +| `module` | Package name of the module, declared as a dependency of the includer | +| `parent` | Host route ID; defaults to the root | +| `at` | Static path below the parent; defaults to no additional segment | +| `as` | Generated namespace and installation name, including for a single installation | + +The includer owns the URL. Relative and leading-slash `at` spellings are normalized as paths below the selected parent before collision checks. + +Mounting follows these rules, and the generator or the type checker reports every violation: + +- **The host chain has no required search params.** Links carry the path params of the current location over, but not its search params, so a module's own links could not provide them. Routes above a module may have path params (see [Mounting under path params](#mounting-under-path-params)). `at` itself must be a static path. +- **The parent provides the context the module root requires.** +- **A module is mounted once per route tree,** unless an application names several installations of it (see [Installing a module several times](#installing-a-module-several-times)). Several includers can depend on the same module, but only one of them can mount it. The others use it. +- **Each package declares its direct providers.** Declare the modules it mounts as dependencies and the modules it uses as dependencies or peer dependencies. Generated declarations reference those providers' symbolic contracts; each provider resolves its own dependencies from its package. An application need not list every transitive module as a direct dependency. The package declaration build reports unresolved imports. +- **Full paths must not collide** with routes of the includer or other modules. + +Generated code performs the mounting and emits the corresponding type checks. Mounting helpers are internal; author composition through configuration and generated APIs. + +### Mounting under path params + +A module can be mounted below routes with path params, for example once per organization: + +```json title="apps/web/tsr.config.json" +{ + "routeModules": { + "includes": [ + { "module": "@acme/team", "parent": "/orgs/$orgId", "at": "/team" } + ] + } +} +``` + +The module never sees `orgId` in its types: its own links keep the path params of the current location, which always has them while the module renders. At runtime `useParams()` and `match.params` contain them, like the final paths in `match.fullPath`. Whatever an installation needs about its host comes through the context its root requires, which the host route provides: + +```tsx title="apps/web/src/routes/orgs.$orgId.tsx" +export const Route = createFileRoute('/orgs/$orgId')({ + beforeLoad: ({ params }) => ({ org: { id: params.orgId } }), +}) +``` + +The includer's namespace for the module is typed from where it is mounted, so links from outside the module pass the host params: + +```tsx + + Ada + +``` + +A module that only uses a module mounted under path params fills them from the current location, so the generator requires it to be mounted below the routes that declare them. It reports a using module mounted elsewhere, naming both modules and the routes with the params. + +### Installing a module several times + +An application can install a module more than once, for example the same settings per organization and per person. Every include of the module names its installation with `as`: + +```json title="apps/web/tsr.config.json" +{ + "routeModules": { + "includes": [ + { + "module": "@acme/settings", + "parent": "/orgs/$orgId", + "at": "/settings", + "as": "orgSettings" + }, + { + "module": "@acme/settings", + "parent": "/people/$personId", + "at": "/settings", + "as": "personSettings" + } + ] + } +} +``` + +Each installation gets its own routes, with ids `#:` such as `@acme/settings#orgSettings:/profile`. They share the module's components, loaders and code-split chunks, and a hot update reaches every installation. An explicitly named single installation uses this identity too. Only an unnamed single installation uses `:`, so adding another installation does not rename an existing named one. + +The module's code does not change. Its route ids, `Route` APIs, links, navigation and redirects resolve to the installation it renders under. Configure each installation through the context the module root requires: each host route provides its own. + +Outside the module, address one installation at a time: + +- **Through its namespace.** The application gets a namespace per installation, named by `as`. It takes the module's local paths and ids and addresses that installation: `orgSettings.Link`, `orgSettings.getRouteApi('@acme/settings:/profile')`. +- **By its installation ids.** `useMatch({ from: '@acme/settings#orgSettings:/profile' })`. The module's plain ids (`@acme/settings:/profile`) are type errors outside the module. + +A module that uses a module installed several times links to the installation whose host routes are above its own mount: a billing module mounted below `/orgs/$orgId` links to `orgSettings`. The generator reports a using module with no such installation, or with several. + +Only applications install a module several times. A module installed several times cannot itself install other modules. + +## Linking across modules + +Every module the includer mounts or uses gets a **namespace** in its `routeScope.gen.ts`. A namespace has the same APIs as the module's own scope, typed against that module's local paths: + +```tsx title="apps/web/src/routes/index.tsx" +import { createFileRoute } from '@tanstack/react-router' +import { products } from '../routeScope.gen' + +export const Route = createFileRoute('/')({ + component: () => ( + + Pick of the day + + ), +}) +``` + +The namespace name is the last segment of the package name in camel case. Choose another with `as` when two modules would get the same name. + +In `includes`, `as` also names the installation. In a `uses` reference, `{ "module": "@acme/products", "as": "catalog" }` only renames the local namespace; it does not create or rename an installation. + +An application cannot link to a module route by its final path: `` is a type error. This keeps modules independent of where they are mounted. + +APIs that take a route id work across modules with qualified ids. An application's own scope knows every installed route: + +```tsx +const productApi = getRouteApi('@acme/products:/$productId') +const match = useMatch({ from: '@acme/products:/$productId' }) +``` + +A module's own scope knows its own routes and the routes of the modules it includes. The routes of a module it only uses are addressed through that module's namespace, so the module's contract never depends on the contracts it links into: + +```tsx +import { products } from '../routeScope.gen' + +const productApi = products.getRouteApi('@acme/products:/$productId') +const match = products.useMatch({ from: '@acme/products:/$productId' }) +``` + +A module can reference another module's routes without mounting it by listing it in `uses`: + +```json title="packages/account/package.json" +{ + "name": "@acme/account", + "tanstack": { + "router": { + "module": { "uses": ["@acme/products"] } + } + }, + "peerDependencies": { "@acme/products": "workspace:*" } +} +``` + +The application must install that provider somewhere, directly or through an include. The generator reports a reference whose provider is not installed. A dependency used only for schemas, utilities or server functions needs no `uses` entry and imposes no route-installation requirement. Dependencies are resolved as packages; they are not automatically discovered as route consumers. An include already exposes its installed subtree, so it need not be repeated in `uses`. + +A used module can be declared in `dependencies`, `devDependencies` or `peerDependencies`. Prefer `peerDependencies`: the application installs the used module anyway, and Turborepo and pnpm do not treat a peer dependency as a package-graph edge, which keeps their task graphs acyclic when modules use each other. + +### Linking in both directions + +`uses` is a type-only relation and may be cyclic: products can link to account while account links to products, and a module can use the module that includes it, for example a products route linking to the cart of the storefront that mounts it. Three rules make this work: + +1. Generation reads only the used module's `package.json`, never its generated files, so `tsr generate` needs no ordering between modules that use each other. +2. The declaration build compiles against the generated stand-ins in `.tanstack/route-types-stubs.d.ts` (see [Declaring a route module](#declaring-a-route-module)), so it needs no ordering either. Only the source check reads the real contracts and must run after the used modules' declaration builds. +3. A module links into the modules it uses through their namespaces and must not import from them, neither values nor types. A type imported from a used module would make this module's emitted declarations depend on that module, which no stand-in can provide. Put types that several modules share into a package below both. The [`route-module-imports`](../eslint/route-module-imports.md) lint rule reports imports from used modules. The same holds for types obtained through the namespace: an exported helper such as `export function useOrderedProduct() { return products.getRouteApi('@acme/products:/$productId').useLoaderData() }` is emitted with the stand-in's types by the declaration build. Keep such helpers unexported, or annotate their types. + +Only `includes` must stay acyclic: a module cannot include a module that includes it, and the generator reports such a cycle. + +Namespaces are read-only generated ESM namespaces. Each API and namespace can be tree-shaken independently: using `products.Link` should not retain every routing helper. Do not mutate namespace members. + +Options created by a scope retain their ownership. Reuse `products.linkOptions(...)` with the products APIs; passing them to a conflicting scope is rejected instead of silently changing their destination. A `mask` is built in the scope of its destination: a module mask on an application destination, or on a destination of another module, is rejected the same way. + +### Match identity and whole-router state + +`match.routeId` is the final installed ID. Module matches also carry `match.localRouteId`, for example `@acme/settings:/profile` even when the final ID is `@acme/settings#orgSettings:/profile`. Ordinary application matches omit this property. + +Scoped `useMatches` keeps the whole active match chain, including foreign host routes. Those foreign matches retain common metadata, but their loader data and context are `unknown`. Narrow membership before using module-specific data. `isScopedMatch` accepts every route of the modules in the scope, identified by their module id, including routes a module adds later: + +```ts +import { isScopedMatch, useMatches } from '../routeScope.gen' + +for (const match of useMatches()) { + if ( + isScopedMatch(match) && + match.localRouteId === '@acme/settings:/profile' + ) { + const profile = match.loaderData + } +} +``` + +Known-route APIs such as `useMatch({ from: ... })` retain precise types. Constructing `getRouteApi(...)` at module scope is valid; its hooks resolve the nearest installation when called in a component. An ambiguous lookup outside a matching context needs an explicit installation. + +The generated scope also includes `useLinkProps`, `useBlocker` and targeted `notFound`. `useBlocker` observes whole-router transitions. Import `Outlet` from the framework package. `Navigate` navigates on mount and on option changes across React, Solid and Vue; it does not navigate during SSR. + +Generated validation type aliases bind the module's router while retaining the corresponding framework type's other argument order and defaults: + +- `ValidateLinkOptions` and `ValidateLinkOptionsArray` +- `ValidateNavigateOptions` and `ValidateNavigateOptionsArray` +- `ValidateRedirectOptions` and `ValidateRedirectOptionsArray` +- `ValidateUseSearchOptions` and `ValidateUseParamsOptions` +- `ValidateId`, `ValidateFromPath`, `ValidateToPath`, `ValidateSearch` and `ValidateParams` + +> [!NOTE] +> A module match's `fullPath` is the final installed path pattern and is typed as `string`; the paths accepted by its generated APIs are module-local. Read `match.pathname` for the current concrete URL. Module source route objects are shared definitions, so use the current match when you need an installation's identity or path. + +## Generated files + +| File | Purpose | +| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | +| `src/routeTree.gen.ts` | Full route tree and type maps | +| `src/routeTree.gen.client.ts` | Provider-owned client view used by Start's client bundlers | +| `src/routeScope.gen.ts` | Module-scoped exports and namespace re-exports | +| `src/routeScope.gen.namespace.ts` | Independent ESM exports for a referenced installation (see below) | +| `src/routeContract.gen.ts` | Public route contract with the module's register and router types, exposed as `./route-types` after declaration emission | +| `src/routeModule.gen.ts` | Runtime entry exposed as `./route-module` | +| `src/startModules.gen.ts` | Start contributions and erased application contract checks | +| `.tanstack/route-module.json` | Portable route/source topology, installation metadata and client-view paths | +| `.tanstack/route-types-stubs.d.ts` | Stand-ins for the contracts of used modules, included only by the declaration build | +| `.tanstack/types/` | Example declaration output directory, owned by the package build | + +Each namespace (`products.Link`) is a separate file, so a bundler keeps only the scope APIs an application uses. The `routeScopeNamespaceFiles` option places these files: + +| Value | Files | +| ------------------------------------------ | ---------------------------------------------------------------------------- | +| `'indexed'` (default) | `routeScope.gen.namespace0.ts`, `routeScope.gen.namespace1.ts`, … | +| `'named'` | `routeScope.gen.products.ts`, `routeScope.gen.orgSettings.ts`, … | +| `'folder'` | `routeScope.gen/products.ts`, `routeScope.gen/orgSettings.ts`, … | +| `({ name, moduleId, key, index }) => path` | The returned path, relative to the route tree's directory, without extension | + +```ts +tanstackRouter({ + routeScopeNamespaceFiles: ({ name }) => `scopes/${name}.gen`, +}) +``` + +Paths must stay inside the route tree's directory and outside the routes directory, and namespace files must differ in more than letter case. A function is only available in JavaScript configurations, such as plugin options; `tsr.config.json` accepts the string values. Changing the layout removes the files of the previous one. + +The generated files sit beside the configured route tree. Do not edit them. They can be committed or ignored; generation must precede any task that reads them. Add `.tanstack` to `.gitignore`. + +Package runtime exports must retain every referenced route source or compiled JavaScript file, generated namespace/client-tree file and topology manifest. Declaration exports must retain their complete reachable declaration graph. Keep framework versions compatible with the generated source's internal implementation imports. + +## Building and watching + +Router generates routes; the package's TypeScript build emits and checks declarations; a task runner schedules, caches and reruns those operations when inputs change. + +| Command | Responsibility | +| ---------------------------------- | --------------------------------------------------------------- | +| `tsr generate` | Generate the package's route topology, source APIs and manifest | +| `tsc -p tsconfig.route-types.json` | Emit declarations with the package's own compiler project | +| `tsc --noEmit` | Check a package's sources against current provider declarations | + +A declaration build should clean its configured output first, because TypeScript does not remove declarations for deleted source files. The example `build:types` script above owns that cleanup. A failed build must fail the task graph. Router has no declaration-status file, compiler wrapper or stale-output health check. + +Order work by the route-package dependency graph. Including a module orders tasks; using one orders only the source check: + +1. Generate included providers before the packages that include them. Modules that only use each other generate in any order. +2. Emit included providers' declarations before emitting the includer's. Declaration builds of modules that use each other run in any order. +3. Check a package's sources after the declaration builds of the modules it includes and uses. +4. Regenerate packages that include a provider after its topology changes; recheck consumers after contract changes. +5. Build the application from the resulting artifacts. + +An implementation edit can produce identical declaration bytes. Whether that suppresses a consumer task depends on the task runner's cache policy, not Router. + +Router CLI and bundler plugins require Node.js 22.22.0 or later. + +### Nx and Turborepo + +Expose ordinary `generate`, `build:types` and `check` package scripts. For example, an Nx graph can start with these uncached targets: + +```json title="nx.json" +{ + "targetDefaults": { + "generate": { "cache": false, "dependsOn": ["^generate"] }, + "build:types": { + "cache": false, + "dependsOn": ["generate", "^build:types"] + }, + "check": { + "cache": false, + "dependsOn": ["generate", "^build:types"] + } + } +} +``` + +The equivalent Turborepo tasks use `dependsOn: ["^generate"]` for generation and `dependsOn: ["generate", "^build:types"]` for declaration builds/checks. Use the task runner's watch mode to rerun these finite tasks in dependency order. + +Modules that use each other need two adjustments, because `^target` follows every package-graph edge: + +- **Turborepo** forms no edge for `peerDependencies`. Declare used modules as peers and `^generate`/`^build:types` follow only `includes`. pnpm warns about the workspace cycle at install time; set `ignoreWorkspaceCycles` to silence it, and declare the tasks of the packages in the cycle explicitly if you use pnpm's task orchestration. Add the check's dependency on each used module explicitly, for example `"@acme/products#check": { "dependsOn": ["@acme/account#build:types"] }` in `turbo.json`. +- **Nx** forms an edge for every dependency field. In a package that uses modules, replace `^generate` and `^build:types` by explicit project lists of the modules it includes, so `^` never follows a `uses` edge; the task graph stays acyclic while the project graph and `nx affected` keep every edge: + + ```json title="packages/products/package.json" + { + "nx": { + "targets": { + "generate": { "dependsOn": [] }, + "build:types": { "dependsOn": ["generate"] }, + "check": { + "dependsOn": [ + "generate", + { "projects": ["@acme/account"], "target": "build:types" } + ] + } + } + } + } + ``` + + A module that also includes other modules lists them the same way (`{ "projects": ["@acme/catalog"], "target": "build:types" }` on `build:types`). `--nxIgnoreCycles` is not a substitute: when A uses B and B includes A it may drop the include ordering, and B's declaration build then fails until the next run. + +Configure that workflow to react to route source and generation-config changes, module `package.json` metadata, and Start-entry additions or removals beside the configured route tree. A provider topology change must regenerate packages that include or reference it. Provider declaration changes must rebuild or recheck their consumers. Include custom generated directories and TypeScript project inputs in the task configuration. + +`tsr watch` remains available for standalone route-directory and configuration watching. Route-module development uses the workspace task runner to watch the complete build graph and invoke `tsr generate`. + +When enabling caches, model every source/configuration and provider artifact a task reads. Restore every generated scope/namespace/client-tree file, the topology manifest, the complete declaration output/maps and the intended runtime output. Match custom generation directories and declaration `outDir` settings. A task whose inputs include ignored generated workloads must model those inputs or remain uncached. Cache hits must restore the same usable package as a successful uncached run. + +The application bundler compiles module runtime source and handles code splitting/HMR. It also consumes provider manifests; it does not generate into provider packages. Run the workspace task watcher alongside the application dev server so provider artifacts stay current. + +## TanStack Start + +Route modules work in TanStack Start applications. A module can declare type-only Start context requirements and can separately contribute an executable **Start fragment** that the application installs. See [Route Modules in TanStack Start](../../start/framework/react/guide/route-modules.md). + +A module without Start features can be mounted in a Start application as is. When the application renders on the server, the mount checks that the loader and `beforeLoad` results of the module's routes can be serialized. + +## Migrating from a router package + +The `router-monorepo-*` examples share one router between packages: a router package builds the route tree from routes defined in feature packages and registers it globally. To move a feature package to a route module: + +1. Move its routes into `src/routes` of the package and add `tanstack.router.module` and the `exports` entries to its `package.json`. +2. Replace route constructors and routing APIs imported from the framework package with imports from `./routeScope.gen`. Create the root with `createModuleRoot` and declare the context the routes need. +3. Replace absolute paths that pointed into other features, in the features and in the application, with their namespaces. The type checker reports each one: + + ```tsx + // Before + + // After + + ``` + +4. Mount the module from the application with `routeModules.includes`, and remove the hand-written route tree assembly and the shared `Register` augmentation. +5. Declare cross-module route references in `uses`. Add generation, ordinary declaration-build and source-check tasks in dependency order. + +## Limitations + +- Route modules require TypeScript and emit declarations with the module's own compiler. TypeScript 5.6 or newer is supported. +- Consumer declarations use `moduleResolution: "bundler"`. `node16`/`nodenext` compatibility is not supported by this workflow. +- A module is mounted at a static path, under a host chain without required search params. Only applications install a module more than once, and a module installed several times cannot install other modules. +- A module that another module installs cannot link to a module the application installs several times. +- Lazy route files are not supported in route modules. +- A route module must not import values or types from a module it uses; it links through the generated namespaces. Types shared by several modules belong in a package below them. +- Modules may use each other in both directions, and a module may use a module that includes it. A module cannot include a module that includes it. +- `Register.server.requestContext` of TanStack Start stays global to the application. +- Mixed code-based and file-based route-module composition is a future TODO. Use generated file-based composition for now; the mounting and scope factories remain internal. Existing physical/virtual file-routing configuration remains supported. +- Router instances own their runtime state, including request-specific SSR state; shared module definitions must not store user context. diff --git a/docs/start/config.json b/docs/start/config.json index 36af0e6e0d..df475b821d 100644 --- a/docs/start/config.json +++ b/docs/start/config.json @@ -90,6 +90,10 @@ "label": "Import Protection", "to": "framework/react/guide/import-protection" }, + { + "label": "Route Modules (Experimental)", + "to": "framework/react/guide/route-modules" + }, { "label": "Path Aliases", "to": "framework/react/guide/path-aliases" diff --git a/docs/start/framework/react/guide/route-modules.md b/docs/start/framework/react/guide/route-modules.md new file mode 100644 index 0000000000..82fb9745e1 --- /dev/null +++ b/docs/start/framework/react/guide/route-modules.md @@ -0,0 +1,198 @@ +--- +id: route-modules +title: Route Modules (Experimental) +--- + +Start build tooling requires Node.js 22.22.0 or later. + +> [!WARNING] +> Route modules are experimental. Their APIs, generated files and build integration may change in any release, including minor and patch releases. Pin your TanStack Start versions when you adopt them. + +[Route modules](../../../../router/routing/route-modules.md) are packages that own a subtree of file-based routes. A module that depends on `@tanstack/react-start` also receives generated Start APIs. The same design applies to Solid and Vue through their framework packages. + +```json title="packages/catalog/package.json" +{ + "name": "@acme/catalog", + "tanstack": { "router": { "module": {} } }, + "dependencies": { + "@tanstack/react-router": "^1.0.0", + "@tanstack/react-start": "^1.0.0" + } +} +``` + +Use `createServerFn`, `createMiddleware` and `createStartModule` from the module's generated `routeScope.gen.ts`. These APIs select the module's requirements and serialization types. The application continues to import its APIs from `@tanstack/react-start`. + +## Declare required context with types + +Requirements describe context that the host must provide. Augment `StartModuleRequirements` in the framework package, keyed by the module's package name: + +```ts title="packages/catalog/src/requirements.ts" +export type { StartModuleRequirements } from '@tanstack/react-start' + +interface User { + id: string +} + +declare module '@tanstack/react-start' { + interface StartModuleRequirements { + '@acme/catalog': { + requestContext: { user: User } + functionContext: { permissions: Array } + } + } +} +``` + +The two fields are optional and independent: + +- `requestContext` is available during requests and server functions. The application can supply it through `handler.fetch` context or request middleware. +- `functionContext` is required by server functions and their server middleware. Global function middleware can provide it, in addition to the request context already available at that stage. It does not describe client middleware or context sent over the transport. + +The generated application assertion selects installed route modules. An application's unrelated dependency does not impose a requirement merely because TypeScript loads its types. Installing a module more than once reuses its package's requirement. Explicitly consuming module middleware in a server function or in another middleware also checks its requirements at that consumer; the `server.middleware` list of a route does not. + +A field typed `any` or `never` cannot certify a requirement: the context a provider establishes must be typed. Only declared requirements are checked. The context a module's own fragment middleware produces is visible to the module's server functions, but another module installed later may overwrite it; declare it as a requirement when the module depends on it. + +These declarations emit no JavaScript and need no runtime marker, middleware entry or empty Start fragment. They are separate from `Register.server.requestContext`, which describes context supplied by the host. + +### Preserve requirements in published declarations + +Consumers must reach the augmentation through the package's declaration exports. Keep it in a `.ts` source file, preserve the framework registry re-export above, and add a type-only re-export to the module's root route: + +```tsx title="packages/catalog/src/routes/__root.tsx" +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' +export type {} from '../requirements' + +export const Route = createModuleRoot()({ + component: () => , +}) +``` + +The emitted route contract reaches the root declaration, which reaches `requirements.d.ts`. Both re-exports are erased from JavaScript. A standalone `.d.ts` that is never referenced by an exported declaration is insufficient; ordinary declaration emission does not copy arbitrary input declaration files. An unused empty type import may also disappear during emission. + +Verify the published package from a consumer that has only its declarations, with `skipLibCheck: false`. Requirements can also be authored in a shared package, provided the module's public declaration graph retains the augmentation and its framework registry reference. + +## Author middleware and server functions + +The generated middleware factory knows the module's requirements without reading the inferred type of its Start fragment: + +```ts title="packages/catalog/src/api.ts" +import { createMiddleware, createServerFn } from './routeScope.gen' + +const pricing = createMiddleware({ type: 'function' }).server( + ({ context, next }) => + next({ + context: { + currency: context.permissions.includes('europe') ? 'EUR' : 'USD', + }, + }), +) + +export const getProduct = createServerFn() + .middleware([pricing]) + .validator((id: string) => id) + .handler(({ data, context }) => ({ + id: data, + shopper: context.user.id, + currency: context.currency, + })) +``` + +Middleware attached to a server function runs for that function. This is the appropriate place for feature-specific authorization or pricing logic. Global contributions run for the whole application. + +Context validation follows middleware execution order, including nested middleware and replacement of existing context properties. A later incompatible replacement cannot be hidden by an earlier valid provider. The checks also apply when module middleware is consumed from an application or another module. Use concrete compatible context types; an `any` value cannot establish the required contract. + +## Contribute application-wide behavior + +A Start fragment contains executable contributions: `serializationAdapters`, `requestMiddleware` and `functionMiddleware`. Create one only when the module contributes such behavior. Put it in `start.ts` or `start.tsx` next to the configured generated route tree, and export it as `start`: + +```ts title="packages/catalog/src/start.ts" +import { createStartModule } from './routeScope.gen' +import { moneyAdapter } from './money' + +export const start = createStartModule(() => ({ + serializationAdapters: [moneyAdapter], +})) +``` + +A fragment cannot set application-wide options such as `defaultSsr` or `serverFns`. Its factory is independent of the application's Start instance. Loader and `beforeLoad` results, as well as server-function results, are checked for serialization with the appropriate adapters. + +| Need | Author it with | +| ---------------------------------------------------------- | ----------------------------------------------------- | +| Context supplied by the host | `StartModuleRequirements` augmentation | +| Logic used by particular server functions | Generated `createMiddleware` and `.middleware([...])` | +| Middleware or adapters installed for the whole application | `createStartModule(() => ({ ... }))` | + +Shared authentication normally belongs in the host. Modules can require the resulting user context instead of contributing duplicate authentication middleware. Runtime deduplication recognizes the same middleware or adapter object; two separately created objects still both run. + +Run `tsr generate` after adding or removing the fragment file. During development, configure Nx or another workspace task runner to rerun generation and dependent builds/checks for these changes. Include the fragment beside the configured route tree in the task inputs, including when that directory is outside `src`. + +## Install modules in an application + +Choose mount paths in the application configuration: + +```ts title="apps/web/vite.config.ts" +import { defineConfig } from 'vite' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' + +export default defineConfig({ + plugins: [ + tanstackStart({ + router: { + routeModules: { + includes: [{ module: '@acme/catalog', at: '/shop' }], + }, + }, + }), + ], +}) +``` + +For modules with executable fragments, install the generated list in the application's Start instance: + +```ts title="apps/web/src/start.ts" +import { createMiddleware, createStart } from '@tanstack/react-start' +import { startModules } from './startModules.gen' + +const user = createMiddleware().server(({ next }) => + next({ context: { user: { id: 'ada' } } }), +) +const permissions = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { permissions: ['europe'] } }), +) + +export const startInstance = createStart(() => ({ + extends: startModules, + requestMiddleware: [user], + functionMiddleware: [permissions], +})) +``` + +The generated type check validates the requirements of every installed module, including modules without a fragment. A requirements-only module needs no `extends` entry. Executable contributions still need installation through `extends: startModules`. + +Validation needs concrete tuples and rejects a required entry or provider that may be absent. It checks request and function lists independently: conditionally supplying the same field through one list or the other may work at runtime but cannot establish the contract. Keep a common provider in an unconditional tuple entry when the requirement depends on that relationship. + +Prefer named context properties for module requirements. A `Record` does not establish that a required `user` property exists. Optional properties and index signatures may leave earlier context values untouched. The validator keeps those possibilities; repairing one named property may not prove a broad index contract again. + +Application entries run first, followed by contributed entries. Entries are deduplicated by object identity, preserving their first position. If an application explicitly places a contributed middleware earlier in its own list, that is its execution position. Compatible host context providers can satisfy a requirement; they need not come from a particular authentication package. Subsequent middleware must preserve the context promised to each consumer. + +Without an application `start.ts`, requirements-only modules are checked against the default Start configuration, including registered `handler.fetch` context. Create an entry exporting `startInstance` when the application needs its own middleware or must install executable fragments. Executable fragments require that entry and `extends: startModules`; mounting them into an application without the framework's Start package is rejected. + +## Build and publish modules + +Use the [ordinary package build workflow](../../../../router/routing/route-modules.md#building-and-watching): route generation, the package's TypeScript declaration build, and consumer source checks in dependency order. Nx, Turborepo or another task runner owns scheduling, caching and rerunning tasks when sources, package metadata or provider artifacts change. Router does not run TypeScript, publish declaration health records or detect whether a task runner restored stale declarations. + +Publish the generated runtime entry, its referenced route sources or compiled JavaScript, the generated client tree views, the topology manifest and the complete reachable declaration output. Include all of them in cached task outputs when caching is enabled. A package build must remove obsolete declaration output and verify its export paths and dependencies. + +## Client and server builds + +Vite and Rsbuild use the same rules across React, Solid and Vue: + +- Module sources participate in normal code splitting, Start compilation and [import protection](./import-protection.md). +- Client trees remove a route whose only recorded option is `server` when all of its children are also removed. Mixed UI/server routes and ancestors needed by surviving children remain. Server trees preserve the endpoints. +- Providers generate their own client tree views. The host bundler selects those views for client imports; it does not write files into provider packages or filter routes in the browser. +- Automatic prerender discovery includes eligible mounted module pages, including nested and named installations. Dynamic installed URLs and handler-only endpoints are excluded. Explicit pages, disabling discovery, filters and basepaths continue to apply. + +> [!NOTE] +> In a module installed several times, loader and `beforeLoad` redirects resolve from the matched route. Redirects returned through a component's `useServerFn` do not yet capture its nearest installation. Return data and navigate with the module's `useNavigate` in that case. diff --git a/e2e/react-router/route-modules/.gitignore b/e2e/react-router/route-modules/.gitignore new file mode 100644 index 0000000000..2634249916 --- /dev/null +++ b/e2e/react-router/route-modules/.gitignore @@ -0,0 +1,8 @@ +# Generated by the route generator and TypeScript; the tests generate +# them from a clean copy of the packages. +**/routeTree.gen.ts +**/routeScope.gen.ts +**/routeContract.gen.ts +**/routeModule.gen.ts +**/routeScope.gen.*.ts +**/routeTree.gen.*.ts diff --git a/e2e/react-router/route-modules/e2e-dev/devtools.spec.ts b/e2e/react-router/route-modules/e2e-dev/devtools.spec.ts new file mode 100644 index 0000000000..6fb9e0a0ea --- /dev/null +++ b/e2e/react-router/route-modules/e2e-dev/devtools.spec.ts @@ -0,0 +1,46 @@ +import { expect, test } from '@playwright/test' + +test('the router devtools group the routes of mounted modules', async ({ + page, +}) => { + await page.goto('/shop/products/7') + await page + .getByRole('button', { name: 'Open TanStack Router Devtools' }) + .click() + + // A module's group sits inside the group of the module that mounts it. + const outer = page.getByRole('group', { + name: 'Route module @route-modules/storefront', + }) + await expect(outer).toBeVisible() + await expect( + outer.getByRole('group', { name: 'Route module @route-modules/products' }), + ).toBeVisible() + + await page + .getByRole('button', { + name: 'Open module details for @route-modules/products', + }) + .first() + .click() + const details = page.getByRole('region', { name: 'Module details' }) + await expect(details).toContainText('Mount path:/shop/products') + await expect(details).toContainText('Parent module:@route-modules/storefront') +}) + +test('the router devtools show each installation of a module installed twice', async ({ + page, +}) => { + await page.goto('/people/ada/settings') + await page + .getByRole('button', { name: 'Open TanStack Router Devtools' }) + .click() + + for (const installation of ['orgSettings', 'personSettings']) { + await expect( + page.getByRole('group', { + name: `Route module @route-modules/settings#${installation}`, + }), + ).toBeVisible() + } +}) diff --git a/e2e/react-router/route-modules/e2e-dev/hmr.spec.ts b/e2e/react-router/route-modules/e2e-dev/hmr.spec.ts new file mode 100644 index 0000000000..7eacbaaa9e --- /dev/null +++ b/e2e/react-router/route-modules/e2e-dev/hmr.spec.ts @@ -0,0 +1,109 @@ +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { expect } from '@playwright/test' +import { createHmrFileEditor, test } from '@tanstack/router-e2e-utils' +import { Generator, getConfig } from '@tanstack/router-generator' + +const packages = path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + '../packages', +) +const products = path.join(packages, 'products') + +const editor = createHmrFileEditor({ + rootDir: products, + files: { + product: 'src/routes/$productId.tsx', + }, +}) +const settingsEditor = createHmrFileEditor({ + rootDir: path.join(packages, 'settings'), + files: { + profile: 'src/routes/profile.tsx', + }, +}) + +test.afterEach(async () => { + await editor.restoreFiles() + await settingsEditor.restoreFiles() +}) + +test('editing a module route file hot-updates it in the application', async ({ + page, +}) => { + await page.goto('/shop/products/7') + await expect(page.getByRole('heading')).toHaveText('Product 7') + await page.evaluate(() => { + ;(window as any).__beforeHmr = true + }) + + await editor.replaceText( + 'product', + '

{product.name}

', + '

Updated {product.name}

', + ) + await expect(page.getByRole('heading')).toHaveText('Updated Product 7') + // A hot update, not a reload: page state survives. + expect(await page.evaluate(() => (window as any).__beforeHmr)).toBe(true) + await expect(page).toHaveURL('/shop/products/7?tab=specs') +}) + +test('editing a route of a module installed twice hot-updates every installation', async ({ + page, +}) => { + await page.goto('/people/ada/settings/profile') + await expect(page.getByRole('heading', { name: 'Profile' })).toBeVisible() + await page.evaluate(() => { + ;(window as any).__beforeHmr = true + }) + + await settingsEditor.replaceText( + 'profile', + '

Profile

', + '

Updated profile

', + ) + await expect( + page.getByRole('heading', { name: 'Updated profile' }), + ).toBeVisible() + + // The installation of the organizations runs the updated route too. + await page.evaluate(() => + (window as any).__TSR_ROUTER__.navigate({ + to: '/orgs/acme/settings/profile', + }), + ) + await expect(page.getByTestId('profile-kind')).toHaveText('organization') + await expect( + page.getByRole('heading', { name: 'Updated profile' }), + ).toBeVisible() + // Hot updates, not reloads: page state survives. + expect(await page.evaluate(() => (window as any).__beforeHmr)).toBe(true) +}) + +test('a route added to a module is served after the module regenerates', async ({ + page, +}) => { + const newRoute = path.join(products, 'src/routes/brands.tsx') + const { writeFile, rm } = await import('node:fs/promises') + await writeFile( + newRoute, + `import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/products:/brands')({ + component: () =>

Brands

, +}) +`, + ) + try { + // A workspace task reruns the provider's generation after the edit. + const config = getConfig({ disableLogging: true }, products) + await new Generator({ config, root: products }).run() + + await page.goto('/shop/products/brands') + await expect(page.getByRole('heading')).toHaveText('Brands') + } finally { + await rm(newRoute) + const config = getConfig({ disableLogging: true }, products) + await new Generator({ config, root: products }).run() + } +}) diff --git a/e2e/react-router/route-modules/e2e/app.spec.ts b/e2e/react-router/route-modules/e2e/app.spec.ts new file mode 100644 index 0000000000..51afb3509d --- /dev/null +++ b/e2e/react-router/route-modules/e2e/app.spec.ts @@ -0,0 +1,126 @@ +import { expect, test } from '@playwright/test' + +test('the application links into mounted modules by namespace', async ({ + page, +}) => { + await page.goto('/') + await expect(page.getByRole('link', { name: 'Cart' })).toHaveAttribute( + 'href', + '/shop/cart', + ) + await page.getByRole('link', { name: 'Pick of the day' }).click() + await expect(page).toHaveURL('/shop/products/home-pick?tab=specs') + await expect(page.getByRole('heading')).toHaveText('Product home-pick') +}) + +test('module-local links resolve inside the module', async ({ page }) => { + await page.goto('/shop/products/3') + await page.getByRole('link', { name: 'All products' }).click() + await expect(page).toHaveURL('/shop/products') + await expect(page.getByRole('link', { name: 'Product 1' })).toHaveAttribute( + 'href', + '/shop/products/1', + ) +}) + +test('a module mounted under a layout gets its context and links into other modules', async ({ + page, +}) => { + await page.goto('/account') + await expect(page.getByRole('heading')).toHaveText('u-1') + await expect( + page.getByRole('link', { name: 'Last viewed product' }), + ).toHaveAttribute('href', '/shop/products/last-viewed?tab=reviews') + + await page.getByRole('link', { name: 'Last order' }).click() + await expect(page).toHaveURL('/account/orders/1') + await page.getByRole('button', { name: 'Ordered product' }).click() + await expect(page).toHaveURL('/shop/products/p-1?tab=specs') + await expect(page.getByRole('heading')).toHaveText('Product p-1') +}) + +test('module routes are code-split from the application bundle', async ({ + page, +}) => { + const scripts: Array = [] + page.on('request', (request) => { + if (request.resourceType() === 'script') { + scripts.push(new URL(request.url()).pathname) + } + }) + await page.goto('/') + await expect(page.getByRole('link', { name: 'Home' })).toBeVisible() + expect(scripts.some((script) => script.includes('_productId'))).toBe(false) + + await page.getByRole('link', { name: 'Pick of the day' }).click() + await expect(page.getByRole('heading')).toHaveText('Product home-pick') + expect(scripts.some((script) => script.includes('_productId'))).toBe(true) +}) + +test('a module mounted under path params links within its organization', async ({ + page, +}) => { + await page.goto('/') + // The application passes the path params above the module. + await page.getByRole('link', { name: 'Acme team' }).click() + await expect(page).toHaveURL('/orgs/acme/team') + await expect( + page.getByRole('heading', { name: 'Team of ACME' }), + ).toBeVisible() + + // Module-local links keep the path params of the current location. + await page.getByRole('link', { name: 'grace' }).click() + await expect(page).toHaveURL('/orgs/acme/team/members/grace') + await expect( + page.getByRole('heading', { name: 'grace at ACME' }), + ).toBeVisible() + await page.getByRole('link', { name: 'All members' }).click() + await expect(page).toHaveURL('/orgs/acme/team') +}) + +test('a module that uses a module mounted under path params fills them from the location', async ({ + page, +}) => { + await page.goto('/orgs/globex/billing') + const contact = page.getByRole('link', { name: 'Billing contact' }) + await expect(contact).toHaveAttribute('href', '/orgs/globex/team/members/ada') + await contact.click() + await expect( + page.getByRole('heading', { name: 'ada at GLOBEX' }), + ).toBeVisible() +}) + +test('a module installed twice renders each installation with its own owner', async ({ + page, +}) => { + await page.goto('/') + await page.getByRole('link', { name: 'Globex settings' }).click() + await expect(page).toHaveURL('/orgs/globex/settings') + await expect( + page.getByRole('heading', { name: 'Settings of GLOBEX' }), + ).toBeVisible() + // Module-local links stay in the installation they render under. + await page.getByRole('link', { name: 'Profile' }).click() + await expect(page).toHaveURL('/orgs/globex/settings/profile') + await expect(page.getByTestId('profile-kind')).toHaveText('organization') + + await page.goto('/') + await page.getByRole('link', { name: "Ada's profile" }).click() + await expect(page).toHaveURL('/people/ada/settings/profile') + await expect( + page.getByRole('heading', { name: 'Settings of Ada' }), + ).toBeVisible() + await expect(page.getByTestId('profile-kind')).toHaveText('person') + await page.getByRole('link', { name: 'All settings' }).click() + await expect(page).toHaveURL('/people/ada/settings') +}) + +test('a module that uses a module installed twice links to the installation above it', async ({ + page, +}) => { + await page.goto('/orgs/globex/billing') + const profile = page.getByRole('link', { name: 'Organization profile' }) + await expect(profile).toHaveAttribute('href', '/orgs/globex/settings/profile') + await profile.click() + await expect(page.getByTestId('profile-kind')).toHaveText('organization') +}) diff --git a/e2e/react-router/route-modules/e2e/circular-references.spec.ts b/e2e/react-router/route-modules/e2e/circular-references.spec.ts new file mode 100644 index 0000000000..663b57e305 --- /dev/null +++ b/e2e/react-router/route-modules/e2e/circular-references.spec.ts @@ -0,0 +1,21 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' + +test('modules that use each other link in both directions', async ({ + page, +}) => { + await page.goto('/account') + await page.getByRole('link', { name: 'Last viewed product' }).click() + await expect(page).toHaveURL('/shop/products/last-viewed?tab=reviews') + await page.getByRole('link', { name: 'All products' }).click() + await expect(page).toHaveURL('/shop/products') + await page.getByRole('link', { name: 'My last order' }).click() + await expect(page).toHaveURL('/account/orders/1') +}) + +test('a module links into the module that mounts it', async ({ page }) => { + await page.goto('/shop/products') + await page.getByRole('link', { name: 'Go to cart' }).click() + await expect(page).toHaveURL('/shop/cart') + await expect(page.getByRole('heading')).toHaveText('Cart') +}) diff --git a/e2e/react-router/route-modules/e2e/scope-parity.spec.ts b/e2e/react-router/route-modules/e2e/scope-parity.spec.ts new file mode 100644 index 0000000000..6793cc39d8 --- /dev/null +++ b/e2e/react-router/route-modules/e2e/scope-parity.spec.ts @@ -0,0 +1,215 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' + +for (const base of ['/orgs/globex/settings', '/people/ada/settings']) { + test(`RouteApi and custom links resolve ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await expect( + page.getByRole('link', { name: 'API members' }), + ).toHaveAttribute('href', `${base}/members`) + await expect( + page.getByRole('link', { name: 'Custom members' }), + ).toHaveAttribute('href', `${base}/members`) + expect( + await page + .getByRole('link', { name: 'API members' }) + .getAttribute('_module'), + ).toBeNull() + expect( + await page + .getByRole('link', { name: 'Custom members' }) + .getAttribute('_module'), + ).toBeNull() + const hostId = base.split('/')[2]! + const hostParams = base.startsWith('/orgs/') + ? { orgId: hostId } + : base.startsWith('/people/') + ? { personId: hostId } + : { userId: hostId } + await expect(page.getByTestId('runtime-params')).toHaveText( + JSON.stringify(hostParams), + ) + await expect(page.getByText('PROFILE_MATCH', { exact: true })).toBeVisible() + await expect(page.getByText('MEMBERS_MATCH', { exact: true })).toHaveCount( + 0, + ) + await page.getByRole('link', { name: 'API members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test(`useLinkProps navigates within the document under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + await expect( + page.getByRole('link', { name: 'Custom members' }), + ).toBeVisible() + const documentRequests: Array = [] + page.on('request', (request) => { + if ( + request.isNavigationRequest() && + request.frame() === page.mainFrame() + ) { + documentRequests.push(request.url()) + } + }) + await page.getByRole('link', { name: 'Custom members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + expect(documentRequests).toEqual([]) + }) + + test(`RouteApi navigation resolves ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await page.getByRole('button', { name: 'Navigate members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test(`Navigate captures installation under ${base}`, async ({ page }) => { + await page.goto(`${base}/forward`) + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test.describe(`component notFound under ${base}`, () => { + test.use({ + // React reports the deliberately thrown value before the boundary handles it. + whitelistErrors: [ + /^\{routeId: @route-modules\/settings:, isNotFound: true\}$/, + ], + }) + test('reaches the module boundary', async ({ page }) => { + await page.goto(`${base}/missing`) + await expect(page.getByText('MODULE_NOT_FOUND')).toBeVisible() + }) + }) + for (const button of ['Route up', 'Explicit from home']) { + test(`${button} uses the route origin under ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await page.getByRole('button', { name: button, exact: true }).click() + await expect(page).toHaveURL(base) + await expect( + page.getByRole('link', { name: 'Profile', exact: true }), + ).toHaveAttribute('href', `${base}/profile`) + }) + } + + test(`scoped router view builds and navigates under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + await expect(page.getByTestId('scoped-href')).toHaveText(`${base}/members`) + await page.getByRole('button', { name: 'Router members' }).click() + await expect(page).toHaveURL(`${base}/members`) + const profile = page.getByRole('link', { name: 'Profile', exact: true }) + await expect(profile).toHaveAttribute('href', `${base}/profile`) + await profile.click() + await expect(page).toHaveURL(`${base}/profile`) + }) + + test(`Route.Link keeps the installation under ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + const home = page.getByRole('link', { name: 'Route home', exact: true }) + await expect(home).toHaveAttribute('href', base) + await home.click() + await expect(page).toHaveURL(base) + await expect( + page.getByRole('link', { name: 'Profile', exact: true }), + ).toHaveAttribute('href', `${base}/profile`) + }) + + test(`scoped lifecycle redirects retain the installation under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/legacy`) + await expect(page).toHaveURL(`${base}/profile`) + await expect(page.getByText('PROFILE_MATCH', { exact: true })).toBeVisible() + }) + + test(`framework imports keep application coordinates inside ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + const home = page.getByRole('link', { name: 'Application home' }) + await expect(home).toHaveAttribute('href', '/') + await home.click() + await expect(page).toHaveURL('/') + }) +} + +test('a local Link resolves options already wrapped by the same local scope', async ({ + page, +}) => { + await page.goto('/orgs/globex/settings/profile') + const members = page.getByRole('link', { + name: 'Acme members', + exact: true, + }) + await expect(members).toHaveAttribute('href', '/orgs/acme/settings/members') + await members.click() + await expect(page).toHaveURL('/orgs/acme/settings/members') + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() +}) + +test('module observers and router views follow real installation changes', async ({ + page, +}) => { + await page.goto('/orgs/globex/settings/profile') + await expect(page.getByTestId('organization-profile')).toHaveText( + '@route-modules/settings#orgSettings:/profile', + ) + await expect(page.getByTestId('scoped-href')).toHaveText( + '/orgs/globex/settings/members', + ) + await page.getByRole('link', { name: 'API members' }).click() + await expect(page).toHaveURL('/orgs/globex/settings/members') + await page.getByRole('link', { name: 'Switch to person' }).click() + await expect(page).toHaveURL('/people/ada/settings/profile') + await expect(page.getByTestId('organization-profile')).toHaveText('none') + await expect(page.getByTestId('scoped-href')).toHaveText( + '/people/ada/settings/members', + ) + await page.getByRole('link', { name: 'Switch to organization' }).click() + await expect(page).toHaveURL('/orgs/globex/settings/profile') + await expect(page.getByRole('link', { name: 'API members' })).toHaveAttribute( + 'href', + '/orgs/globex/settings/members', + ) + const readObserved = () => + page.evaluate( + () => + ( + window as Window & { + observedModuleMatches: Array + } + ).observedModuleMatches, + ) + await expect + .poll(readObserved) + .toContain('@route-modules/settings#personSettings:/profile') + const observed = await readObserved() + expect(observed).toContain('@route-modules/settings#orgSettings:/profile') + expect(observed).not.toContain(undefined) +}) + +test('singleton scoped redirects and namespaced search input survive generation', async ({ + page, +}) => { + await page.goto('/shop/products/legacy') + await expect( + page.getByRole('heading', { name: 'Product 42', exact: true }), + ).toBeVisible() + expect(new URL(page.url()).pathname).toBe('/shop/products/42') + await expect(page.getByText('Dimensions, materials and care.')).toBeVisible() + + await page.goto('/shop') + const compare = page.getByRole('link', { name: 'Compare', exact: true }) + await expect(compare).toHaveAttribute( + 'href', + '/shop/products/compare?ids=%5B%221%22%2C%222%22%5D', + ) + await compare.click() + await expect(page.getByText('Comparing products 1 and 2.')).toBeVisible() +}) diff --git a/e2e/react-router/route-modules/package.json b/e2e/react-router/route-modules/package.json new file mode 100644 index 0000000000..b5964bcad6 --- /dev/null +++ b/e2e/react-router/route-modules/package.json @@ -0,0 +1,26 @@ +{ + "name": "tanstack-router-e2e-react-route-modules", + "private": true, + "type": "module", + "scripts": { + "test:e2e": "node scripts/prepare.mjs && pnpm --filter @route-modules/web generate && vitest run && playwright test --project=chromium && playwright test --config playwright.dev.config.ts --project=chromium", + "test:types": "node scripts/prepare.mjs && pnpm --filter @route-modules/web generate && pnpm --filter @route-modules/web check:contracts" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@route-modules/web": "workspace:*", + "@tanstack/router-e2e-utils": "workspace:^", + "@tanstack/router-generator": "workspace:^", + "@types/node": "catalog:", + "vite": "^8.0.14", + "vite-plugin-solid": "^2.11.11", + "vitest": "catalog:" + }, + "nx": { + "implicitDependencies": [ + "@tanstack/react-start", + "@tanstack/solid-start", + "@tanstack/vue-start" + ] + } +} diff --git a/e2e/react-router/route-modules/packages/account/package.json b/e2e/react-router/route-modules/packages/account/package.json new file mode 100644 index 0000000000..28650d44a3 --- /dev/null +++ b/e2e/react-router/route-modules/packages/account/package.json @@ -0,0 +1,70 @@ +{ + "name": "@route-modules/account", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": { + "uses": [ + "@route-modules/products" + ] + } + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json", + "./scope": { + "types": "./.tanstack/types/src/routeScope.gen.d.ts", + "default": "./src/routeScope.gen.ts" + } + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@types/react": "^19.0.8" + }, + "nx": { + "targets": { + "generate": { + "dependsOn": [ + "^build" + ] + }, + "emit-types": { + "dependsOn": [ + "generate" + ] + }, + "check": { + "dependsOn": [ + "generate", + { + "projects": [ + "@route-modules/products" + ], + "target": "emit-types" + } + ] + } + } + }, + "peerDependencies": { + "@route-modules/products": "workspace:*" + } +} diff --git a/e2e/react-router/route-modules/packages/account/src/routes/__root.tsx b/e2e/react-router/route-modules/packages/account/src/routes/__root.tsx new file mode 100644 index 0000000000..6941c2546a --- /dev/null +++ b/e2e/react-router/route-modules/packages/account/src/routes/__root.tsx @@ -0,0 +1,25 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +// Account pages need the signed-in user, provided by whatever host route the +// application mounts the module under. +export const Route = createModuleRoot<{ user: { id: string } }>()({ + component: AccountRoom, +}) + +// The module's region: a room tagged with its package and where it is +// mounted (with the URL it resolved to when the mount path has params). +function AccountRoom() { + const pathname = Route.useMatch({ select: (match) => match.pathname }) + return ( +
+

+ @route-modules/account {Route.fullPath} + {pathname !== Route.fullPath && ( + → {pathname} + )} +

+ +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/account/src/routes/index.tsx b/e2e/react-router/route-modules/packages/account/src/routes/index.tsx new file mode 100644 index 0000000000..bfaa88f9de --- /dev/null +++ b/e2e/react-router/route-modules/packages/account/src/routes/index.tsx @@ -0,0 +1,35 @@ +import { Link, createFileRoute, products } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/account:/')({ + component: AccountHome, +}) + +function AccountHome() { + const { user } = Route.useRouteContext() + return ( +
+

{user.id}

+

+ Signed in. Your orders and what you looked at last. +

+
    +
  • + + Last order + + Order 1 +
  • +
  • + + Last viewed product + + Opens its reviews +
  • +
+
+ ) +} diff --git a/e2e/react-router/route-modules/packages/account/src/routes/orders.$orderId.tsx b/e2e/react-router/route-modules/packages/account/src/routes/orders.$orderId.tsx new file mode 100644 index 0000000000..59cd3bea3c --- /dev/null +++ b/e2e/react-router/route-modules/packages/account/src/routes/orders.$orderId.tsx @@ -0,0 +1,40 @@ +import { createFileRoute, products } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/account:/orders/$orderId')( + { + loader: ({ params }) => ({ orderId: params.orderId, productId: 'p-1' }), + component: OrderPage, + }, +) + +function OrderPage() { + const order = Route.useLoaderData() + // Routes of a used module are addressed through its namespace: the module's + // own scope only knows its own routes and the modules it includes. + const navigateToProduct = products.useNavigate() + return ( +
+

{order.orderId}

+
+
Status
+
Delivered
+
Product
+
+ {order.productId} +
+
+ +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/account/tsconfig.json b/e2e/react-router/route-modules/packages/account/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-router/route-modules/packages/account/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-router/route-modules/packages/account/tsconfig.route-types.json b/e2e/react-router/route-modules/packages/account/tsconfig.route-types.json new file mode 100644 index 0000000000..95f6cee32f --- /dev/null +++ b/e2e/react-router/route-modules/packages/account/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src", ".tanstack/route-types-stubs.d.ts"] +} diff --git a/e2e/react-router/route-modules/packages/billing/package.json b/e2e/react-router/route-modules/packages/billing/package.json new file mode 100644 index 0000000000..a3825c5af8 --- /dev/null +++ b/e2e/react-router/route-modules/packages/billing/package.json @@ -0,0 +1,69 @@ +{ + "name": "@route-modules/billing", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": { + "uses": [ + "@route-modules/settings", + "@route-modules/team" + ] + } + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@types/react": "^19.0.8" + }, + "nx": { + "targets": { + "generate": { + "dependsOn": [ + "^build" + ] + }, + "emit-types": { + "dependsOn": [ + "generate" + ] + }, + "check": { + "dependsOn": [ + "generate", + { + "projects": [ + "@route-modules/settings", + "@route-modules/team" + ], + "target": "emit-types" + } + ] + } + } + }, + "peerDependencies": { + "@route-modules/settings": "workspace:*", + "@route-modules/team": "workspace:*" + } +} diff --git a/e2e/react-router/route-modules/packages/billing/src/routes/__root.tsx b/e2e/react-router/route-modules/packages/billing/src/routes/__root.tsx new file mode 100644 index 0000000000..59673b7586 --- /dev/null +++ b/e2e/react-router/route-modules/packages/billing/src/routes/__root.tsx @@ -0,0 +1,23 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ + component: BillingRoom, +}) + +// The module's region: a room tagged with its package and where it is +// mounted (with the URL it resolved to when the mount path has params). +function BillingRoom() { + const pathname = Route.useMatch({ select: (match) => match.pathname }) + return ( +
+

+ @route-modules/billing {Route.fullPath} + {pathname !== Route.fullPath && ( + → {pathname} + )} +

+ +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/billing/src/routes/index.tsx b/e2e/react-router/route-modules/packages/billing/src/routes/index.tsx new file mode 100644 index 0000000000..78087ff2c0 --- /dev/null +++ b/e2e/react-router/route-modules/packages/billing/src/routes/index.tsx @@ -0,0 +1,29 @@ +import { createFileRoute, settings, team } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/billing:/')({ + component: Billing, +}) + +function Billing() { + return ( +
+

Billing

+
+
Plan
+
Team, billed monthly
+
Seats
+
2
+
+ {/* Billing uses the team without mounting it: the organization comes + from the current location, below the same route as the team. */} +
+ + Billing contact + + {/* The settings are installed for organizations and for people: + billing links to the installation of its own organization. */} + Organization profile +
+
+ ) +} diff --git a/e2e/react-router/route-modules/packages/billing/tsconfig.json b/e2e/react-router/route-modules/packages/billing/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-router/route-modules/packages/billing/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-router/route-modules/packages/billing/tsconfig.route-types.json b/e2e/react-router/route-modules/packages/billing/tsconfig.route-types.json new file mode 100644 index 0000000000..95f6cee32f --- /dev/null +++ b/e2e/react-router/route-modules/packages/billing/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src", ".tanstack/route-types-stubs.d.ts"] +} diff --git a/e2e/react-router/route-modules/packages/products/package.json b/e2e/react-router/route-modules/packages/products/package.json new file mode 100644 index 0000000000..41158e73f3 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/package.json @@ -0,0 +1,78 @@ +{ + "name": "@route-modules/products", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": { + "uses": [ + "@route-modules/account", + "@route-modules/storefront" + ] + } + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./api": { + "types": "./.tanstack/types/src/api.d.ts", + "default": "./src/api.ts" + }, + "./package.json": "./package.json", + "./scope": { + "types": "./.tanstack/types/src/routeScope.gen.d.ts", + "default": "./src/routeScope.gen.ts" + } + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0", + "zod": "^4.4.3" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@types/react": "^19.0.8" + }, + "nx": { + "targets": { + "generate": { + "dependsOn": [ + "^build" + ] + }, + "emit-types": { + "dependsOn": [ + "generate" + ] + }, + "check": { + "dependsOn": [ + "generate", + { + "projects": [ + "@route-modules/account", + "@route-modules/storefront" + ], + "target": "emit-types" + } + ] + } + } + }, + "peerDependencies": { + "@route-modules/account": "workspace:*", + "@route-modules/storefront": "workspace:*" + } +} diff --git a/e2e/react-router/route-modules/packages/products/src/api.ts b/e2e/react-router/route-modules/packages/products/src/api.ts new file mode 100644 index 0000000000..49b3c720f6 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/api.ts @@ -0,0 +1,12 @@ +export type Price = number & { readonly __brand: 'Price' } + +export interface Product { + id: string + name: string + price: Price +} + +export interface ProductsApi { + getProduct: (id: string) => Promise + listProducts: () => Promise> +} diff --git a/e2e/react-router/route-modules/packages/products/src/routes/$productId.tsx b/e2e/react-router/route-modules/packages/products/src/routes/$productId.tsx new file mode 100644 index 0000000000..4ee4cbe25b --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/$productId.tsx @@ -0,0 +1,49 @@ +import { createFileRoute } from '../routeScope.gen' +import { productSearchSchema } from '../schemas' + +export const Route = createFileRoute('@route-modules/products:/$productId')({ + validateSearch: productSearchSchema, + loader: ({ params, context }) => + context.productsApi.getProduct(params.productId), + component: ProductPage, +}) + +function ProductPage() { + const product = Route.useLoaderData() + const { tab } = Route.useSearch() + return ( +
+

{product.name}

+
+
Price
+
{product.price.toFixed(2)}
+
Product id
+
+ {product.id} +
+
+ +

+ {tab === 'specs' + ? 'Dimensions, materials and care.' + : 'What customers say about it.'} +

+ All products +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/products/src/routes/__root.tsx b/e2e/react-router/route-modules/packages/products/src/routes/__root.tsx new file mode 100644 index 0000000000..dae776c4c9 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/__root.tsx @@ -0,0 +1,24 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' +import type { ProductsApi } from '../api' + +export const Route = createModuleRoot<{ productsApi: ProductsApi }>()({ + component: ProductsRoom, +}) + +// The module's region: a room tagged with its package and where it is +// mounted (with the URL it resolved to when the mount path has params). +function ProductsRoom() { + const pathname = Route.useMatch({ select: (match) => match.pathname }) + return ( +
+

+ @route-modules/products {Route.fullPath} + {pathname !== Route.fullPath && ( + → {pathname} + )} +

+ +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/products/src/routes/_layout.tsx b/e2e/react-router/route-modules/packages/products/src/routes/_layout.tsx new file mode 100644 index 0000000000..2193644739 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/_layout.tsx @@ -0,0 +1,10 @@ +import { Outlet } from '@tanstack/react-router' +import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/products:/_layout')({ + component: () => ( +
+ +
+ ), +}) diff --git a/e2e/react-router/route-modules/packages/products/src/routes/_layout/deals.tsx b/e2e/react-router/route-modules/packages/products/src/routes/_layout/deals.tsx new file mode 100644 index 0000000000..4b557668c5 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/_layout/deals.tsx @@ -0,0 +1,12 @@ +import { createFileRoute } from '../../routeScope.gen' + +export const Route = createFileRoute('@route-modules/products:/_layout/deals')({ + component: () => ( + <> +

Deals

+

+ Rendered through a pathless layout of the products module. +

+ + ), +}) diff --git a/e2e/react-router/route-modules/packages/products/src/routes/catalog.{-$category}.tsx b/e2e/react-router/route-modules/packages/products/src/routes/catalog.{-$category}.tsx new file mode 100644 index 0000000000..0afa1254c1 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/catalog.{-$category}.tsx @@ -0,0 +1,12 @@ +import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute( + '@route-modules/products:/catalog/{-$category}', +)({ + component: () => ( + <> +

Catalog

+

The category segment of this path is optional.

+ + ), +}) diff --git a/e2e/react-router/route-modules/packages/products/src/routes/compare.tsx b/e2e/react-router/route-modules/packages/products/src/routes/compare.tsx new file mode 100644 index 0000000000..9c787a278d --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/compare.tsx @@ -0,0 +1,17 @@ +import { z } from 'zod' +import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/products:/compare')({ + validateSearch: z.object({ ids: z.array(z.string()) }), + component: Compare, +}) + +function Compare() { + const { ids } = Route.useSearch() + return ( + <> +

Compare

+

Comparing products {ids.join(' and ')}.

+ + ) +} diff --git a/e2e/react-router/route-modules/packages/products/src/routes/files.$.tsx b/e2e/react-router/route-modules/packages/products/src/routes/files.$.tsx new file mode 100644 index 0000000000..aee6d73969 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/files.$.tsx @@ -0,0 +1,10 @@ +import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/products:/files/$')({ + component: () => ( + <> +

Files

+

Every path below files/ lands here.

+ + ), +}) diff --git a/e2e/react-router/route-modules/packages/products/src/routes/index.tsx b/e2e/react-router/route-modules/packages/products/src/routes/index.tsx new file mode 100644 index 0000000000..825c2ed2e7 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/index.tsx @@ -0,0 +1,33 @@ +import { Link, account, createFileRoute, storefront } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/products:/')({ + loader: ({ context }) => context.productsApi.listProducts(), + component: ProductList, +}) + +function ProductList() { + const products = Route.useLoaderData() + return ( + <> +

+ {/* Links into modules that link back here: account uses products, and + storefront mounts products. Both compile against the stand-ins in + .tanstack/route-types-stubs.d.ts during the declaration build. */} + + My last order + {' '} + Go to cart +

+
    + {products.map((product) => ( +
  • + + {product.name} + + {product.price.toFixed(2)} +
  • + ))} +
+ + ) +} diff --git a/e2e/react-router/route-modules/packages/products/src/routes/legacy.tsx b/e2e/react-router/route-modules/packages/products/src/routes/legacy.tsx new file mode 100644 index 0000000000..cb4643dbb0 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/routes/legacy.tsx @@ -0,0 +1,10 @@ +import { createFileRoute, redirect } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/products:/legacy')({ + beforeLoad: () => { + throw redirect({ + to: '/$productId', + params: { productId: '42' }, + search: { tab: 'specs' }, + }) + }, +}) diff --git a/e2e/react-router/route-modules/packages/products/src/schemas.ts b/e2e/react-router/route-modules/packages/products/src/schemas.ts new file mode 100644 index 0000000000..9f7276a4fb --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/src/schemas.ts @@ -0,0 +1,6 @@ +import { z } from 'zod' + +/** Search params of the product page: `tab` is optional when navigating. */ +export const productSearchSchema = z.object({ + tab: z.enum(['specs', 'reviews']).default('specs'), +}) diff --git a/e2e/react-router/route-modules/packages/products/tsconfig.json b/e2e/react-router/route-modules/packages/products/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-router/route-modules/packages/products/tsconfig.route-types.json b/e2e/react-router/route-modules/packages/products/tsconfig.route-types.json new file mode 100644 index 0000000000..95f6cee32f --- /dev/null +++ b/e2e/react-router/route-modules/packages/products/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src", ".tanstack/route-types-stubs.d.ts"] +} diff --git a/e2e/react-router/route-modules/packages/settings/package.json b/e2e/react-router/route-modules/packages/settings/package.json new file mode 100644 index 0000000000..088c1cd72f --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/package.json @@ -0,0 +1,53 @@ +{ + "name": "@route-modules/settings", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": true + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json", + "./scope": { + "types": "./.tanstack/types/src/routeScope.gen.d.ts", + "default": "./src/routeScope.gen.ts" + } + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@types/react": "^19.0.8" + }, + "nx": { + "targets": { + "generate": { + "dependsOn": [ + "^build", + "^emit-types" + ] + }, + "emit-types": { + "dependsOn": [ + "generate" + ] + } + } + } +} diff --git a/e2e/react-router/route-modules/packages/settings/src/routes/__root.tsx b/e2e/react-router/route-modules/packages/settings/src/routes/__root.tsx new file mode 100644 index 0000000000..ec3599af26 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/src/routes/__root.tsx @@ -0,0 +1,44 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' +import type { ComponentType } from 'react' + +/** Whose settings an installation shows, provided by its host route. */ +export interface Owner { + kind: 'organization' | 'person' + id: string + name: string +} + +// The application installs the settings twice: below `/orgs/$orgId` and +// below `/people/$personId`. Each host route provides its owner. +export const Route = createModuleRoot<{ + owner: Owner + onProfileMatch?: (routeId: string | undefined) => void + profileLinks?: ComponentType +}>()({ + component: SettingsRoom, + notFoundComponent: () =>

MODULE_NOT_FOUND

, +}) + +// The module's region: a room tagged with the installation it renders and +// where that installation is mounted. +function SettingsRoom() { + const { owner } = Route.useRouteContext() + const match = Route.useMatch({ + select: ({ routeId, fullPath, pathname }) => ({ + installation: routeId.slice(0, routeId.indexOf(':')), + fullPath, + pathname, + }), + }) + return ( +
+

+ {match.installation} {match.fullPath} + → {match.pathname} +

+

Settings of {owner.name}

+ +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/settings/src/routes/forward.tsx b/e2e/react-router/route-modules/packages/settings/src/routes/forward.tsx new file mode 100644 index 0000000000..c9520d47a6 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/src/routes/forward.tsx @@ -0,0 +1,5 @@ +import * as React from 'react' +import { createFileRoute, Navigate } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/settings:/forward')({ + component: () => , +}) diff --git a/e2e/react-router/route-modules/packages/settings/src/routes/index.tsx b/e2e/react-router/route-modules/packages/settings/src/routes/index.tsx new file mode 100644 index 0000000000..8bdbffdb73 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/src/routes/index.tsx @@ -0,0 +1,16 @@ +import { Link, createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/settings:/')({ + component: SettingsIndex, +}) + +function SettingsIndex() { + return ( +
    +
  • + Profile + Name and contact +
  • +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/settings/src/routes/legacy.tsx b/e2e/react-router/route-modules/packages/settings/src/routes/legacy.tsx new file mode 100644 index 0000000000..93d42fe065 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/src/routes/legacy.tsx @@ -0,0 +1,6 @@ +import { createFileRoute, redirect } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/settings:/legacy')({ + beforeLoad: () => { + throw redirect({ to: '/profile' }) + }, +}) diff --git a/e2e/react-router/route-modules/packages/settings/src/routes/members.tsx b/e2e/react-router/route-modules/packages/settings/src/routes/members.tsx new file mode 100644 index 0000000000..cc255a1964 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/src/routes/members.tsx @@ -0,0 +1,12 @@ +import * as React from 'react' +import { createFileRoute, getRouteApi } from '../routeScope.gen' +const ProfileLink = getRouteApi('@route-modules/settings:/profile').Link +export const Route = createFileRoute('@route-modules/settings:/members')({ + loader: () => ({ label: 'members' as const }), + component: () => ( + <> +

MEMBERS_PAGE

+ Profile + + ), +}) diff --git a/e2e/react-router/route-modules/packages/settings/src/routes/missing.tsx b/e2e/react-router/route-modules/packages/settings/src/routes/missing.tsx new file mode 100644 index 0000000000..61911c6a98 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/src/routes/missing.tsx @@ -0,0 +1,6 @@ +import { createFileRoute, notFound } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/settings:/missing')({ + component: () => { + throw notFound({ routeId: '@route-modules/settings:' }) + }, +}) diff --git a/e2e/react-router/route-modules/packages/settings/src/routes/profile.tsx b/e2e/react-router/route-modules/packages/settings/src/routes/profile.tsx new file mode 100644 index 0000000000..7237906480 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/src/routes/profile.tsx @@ -0,0 +1,110 @@ +import * as React from 'react' +import { Link as ApplicationLink } from '@tanstack/react-router' +import { + createFileRoute, + getRouteApi, + MatchRoute, + useLinkProps, + useRouter, + useNavigate, +} from '../routeScope.gen' + +const api = getRouteApi('@route-modules/settings:/profile') + +export const Route = createFileRoute('@route-modules/settings:/profile')({ + // Each installation loads the profile of the owner its host provides. + loader: ({ context }) => ({ + kind: context.owner.kind, + handle: `@${context.owner.id}`, + }), + component: Profile, +}) + +function Profile() { + const profile = Route.useLoaderData() + const ProfileLinks = Route.useRouteContext().profileLinks + const navigate = api.useNavigate() + const anchor = useLinkProps({ to: '/members' }) + const match = Route.useMatch({ shouldThrow: false }) + const routeNavigate = Route.useNavigate() + const relativeNavigate = useNavigate({ from: '/profile' }) + const scopedRouter = useRouter() + const observe = scopedRouter.options.context?.onProfileMatch + React.useEffect(() => { + observe?.(match?.routeId) + }, [observe, match?.routeId]) + return ( +
+

Profile

+
+
Kind
+
{profile.kind}
+
Handle
+
+ {profile.handle} +
+
+ All settings + + {/* Every module-relative API, each resolved inside this installation. */} +
+

Match

+
+
Route id
+
+ {match?.routeId} +
+
Local id
+
+ {match?.localRouteId} +
+
Params
+
+ + {JSON.stringify(match?.params)} + +
+
Router href
+
+ + {scopedRouter.buildLocation({ to: '/members' }).href} + +
+
MatchRoute
+
+ + PROFILE_MATCH + + + MEMBERS_MATCH + +
+
+ +

Links

+

+ API members + Custom members + Route home + {ProfileLinks ? : null} + {/* The framework's own Link keeps application coordinates. */} + Application home +

+ +

Navigation

+

+ + + + +

+
+
+ ) +} diff --git a/e2e/react-router/route-modules/packages/settings/src/routes/search.tsx b/e2e/react-router/route-modules/packages/settings/src/routes/search.tsx new file mode 100644 index 0000000000..bdd6fb1f94 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/src/routes/search.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/settings:/search')({ + validateSearch: (search: { query: string }) => search, +}) diff --git a/e2e/react-router/route-modules/packages/settings/tsconfig.json b/e2e/react-router/route-modules/packages/settings/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-router/route-modules/packages/settings/tsconfig.route-types.json b/e2e/react-router/route-modules/packages/settings/tsconfig.route-types.json new file mode 100644 index 0000000000..95f6cee32f --- /dev/null +++ b/e2e/react-router/route-modules/packages/settings/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src", ".tanstack/route-types-stubs.d.ts"] +} diff --git a/e2e/react-router/route-modules/packages/storefront/package.json b/e2e/react-router/route-modules/packages/storefront/package.json new file mode 100644 index 0000000000..d745750280 --- /dev/null +++ b/e2e/react-router/route-modules/packages/storefront/package.json @@ -0,0 +1,57 @@ +{ + "name": "@route-modules/storefront", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": { + "includes": [ + { + "module": "@route-modules/products", + "at": "/products" + } + ] + } + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@route-modules/products": "workspace:*", + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@types/react": "^19.0.8" + }, + "nx": { + "targets": { + "generate": { + "dependsOn": [ + "^build", + "^emit-types" + ] + }, + "emit-types": { + "dependsOn": [ + "generate" + ] + } + } + } +} diff --git a/e2e/react-router/route-modules/packages/storefront/src/routes/__root.tsx b/e2e/react-router/route-modules/packages/storefront/src/routes/__root.tsx new file mode 100644 index 0000000000..c9ac060bc1 --- /dev/null +++ b/e2e/react-router/route-modules/packages/storefront/src/routes/__root.tsx @@ -0,0 +1,26 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' +import type { ProductsApi } from '@route-modules/products/api' + +// The products module mounted below requires `productsApi`: the storefront +// requires it from its own host and passes it on. +export const Route = createModuleRoot<{ productsApi: ProductsApi }>()({ + component: StorefrontRoom, +}) + +// The module's region: a room tagged with its package and where it is +// mounted (with the URL it resolved to when the mount path has params). +function StorefrontRoom() { + const pathname = Route.useMatch({ select: (match) => match.pathname }) + return ( +
+

+ @route-modules/storefront {Route.fullPath} + {pathname !== Route.fullPath && ( + → {pathname} + )} +

+ +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/storefront/src/routes/cart.tsx b/e2e/react-router/route-modules/packages/storefront/src/routes/cart.tsx new file mode 100644 index 0000000000..79f6644d2e --- /dev/null +++ b/e2e/react-router/route-modules/packages/storefront/src/routes/cart.tsx @@ -0,0 +1,30 @@ +import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/storefront:/cart')({ + // The products API comes from the context the storefront requires. + loader: ({ context }) => + Promise.all(['1', '2'].map((id) => context.productsApi.getProduct(id))), + component: Cart, +}) + +function Cart() { + const items = Route.useLoaderData() + const total = items.reduce((sum, item) => sum + item.price, 0) + return ( + <> +

Cart

+
    + {items.map((item) => ( +
  • + {item.name} + {item.price.toFixed(2)} +
  • + ))} +
  • + Total + {total.toFixed(2)} +
  • +
+ + ) +} diff --git a/e2e/react-router/route-modules/packages/storefront/src/routes/index.tsx b/e2e/react-router/route-modules/packages/storefront/src/routes/index.tsx new file mode 100644 index 0000000000..9963a42c5a --- /dev/null +++ b/e2e/react-router/route-modules/packages/storefront/src/routes/index.tsx @@ -0,0 +1,30 @@ +import { Link, createFileRoute, products } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/storefront:/')({ + component: StorefrontHome, +}) + +function StorefrontHome() { + return ( + + ) +} diff --git a/e2e/react-router/route-modules/packages/storefront/tsconfig.json b/e2e/react-router/route-modules/packages/storefront/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-router/route-modules/packages/storefront/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-router/route-modules/packages/storefront/tsconfig.route-types.json b/e2e/react-router/route-modules/packages/storefront/tsconfig.route-types.json new file mode 100644 index 0000000000..95f6cee32f --- /dev/null +++ b/e2e/react-router/route-modules/packages/storefront/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src", ".tanstack/route-types-stubs.d.ts"] +} diff --git a/e2e/react-router/route-modules/packages/team/package.json b/e2e/react-router/route-modules/packages/team/package.json new file mode 100644 index 0000000000..bd9a923d54 --- /dev/null +++ b/e2e/react-router/route-modules/packages/team/package.json @@ -0,0 +1,53 @@ +{ + "name": "@route-modules/team", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": true + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json", + "./scope": { + "types": "./.tanstack/types/src/routeScope.gen.d.ts", + "default": "./src/routeScope.gen.ts" + } + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@types/react": "^19.0.8" + }, + "nx": { + "targets": { + "generate": { + "dependsOn": [ + "^build", + "^emit-types" + ] + }, + "emit-types": { + "dependsOn": [ + "generate" + ] + } + } + } +} diff --git a/e2e/react-router/route-modules/packages/team/src/routes/__root.tsx b/e2e/react-router/route-modules/packages/team/src/routes/__root.tsx new file mode 100644 index 0000000000..c3c342479f --- /dev/null +++ b/e2e/react-router/route-modules/packages/team/src/routes/__root.tsx @@ -0,0 +1,27 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +// The organization comes from the host route the application mounts the team +// under, so the team works below any route that provides it. +export const Route = createModuleRoot<{ org: { id: string; name: string } }>()({ + component: TeamRoom, +}) + +// The module's region: a room tagged with its package and where it is +// mounted (with the URL it resolved to when the mount path has params). +function TeamRoom() { + const { org } = Route.useRouteContext() + const pathname = Route.useMatch({ select: (match) => match.pathname }) + return ( +
+

+ @route-modules/team {Route.fullPath} + {pathname !== Route.fullPath && ( + → {pathname} + )} +

+

Team of {org.name}

+ +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/team/src/routes/index.tsx b/e2e/react-router/route-modules/packages/team/src/routes/index.tsx new file mode 100644 index 0000000000..ee221db55d --- /dev/null +++ b/e2e/react-router/route-modules/packages/team/src/routes/index.tsx @@ -0,0 +1,25 @@ +import { Link, createFileRoute } from '../routeScope.gen' + +const members = [ + { id: 'ada', role: 'Engineering' }, + { id: 'grace', role: 'Operations' }, +] + +export const Route = createFileRoute('@route-modules/team:/')({ + component: Members, +}) + +function Members() { + return ( +
    + {members.map((member) => ( +
  • + + {member.id} + + {member.role} +
  • + ))} +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/team/src/routes/members.$memberId.tsx b/e2e/react-router/route-modules/packages/team/src/routes/members.$memberId.tsx new file mode 100644 index 0000000000..6ed53bd48d --- /dev/null +++ b/e2e/react-router/route-modules/packages/team/src/routes/members.$memberId.tsx @@ -0,0 +1,28 @@ +import { Link, createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/team:/members/$memberId')({ + component: Member, +}) + +function Member() { + const { memberId } = Route.useParams() + const { org } = Route.useRouteContext() + return ( +
+

+ {memberId} at {org.name} +

+
+
Organization
+
+ {org.id} +
+
Member
+
+ {memberId} +
+
+ All members +
+ ) +} diff --git a/e2e/react-router/route-modules/packages/team/tsconfig.json b/e2e/react-router/route-modules/packages/team/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-router/route-modules/packages/team/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-router/route-modules/packages/team/tsconfig.route-types.json b/e2e/react-router/route-modules/packages/team/tsconfig.route-types.json new file mode 100644 index 0000000000..95f6cee32f --- /dev/null +++ b/e2e/react-router/route-modules/packages/team/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src", ".tanstack/route-types-stubs.d.ts"] +} diff --git a/e2e/react-router/route-modules/packages/web/index.html b/e2e/react-router/route-modules/packages/web/index.html new file mode 100644 index 0000000000..df728d8f44 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/index.html @@ -0,0 +1,11 @@ + + + + + Acme Workspace + + +
+ + + diff --git a/e2e/react-router/route-modules/packages/web/package.json b/e2e/react-router/route-modules/packages/web/package.json new file mode 100644 index 0000000000..7e87adf0b2 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/package.json @@ -0,0 +1,49 @@ +{ + "name": "@route-modules/web", + "private": true, + "type": "module", + "scripts": { + "generate": "tsr generate", + "check": "tsc --noEmit", + "build": "vite build && tsc -p tsconfig.contracts.json --noEmit", + "dev": "vite", + "check:contracts": "tsc -p tsconfig.contracts.json --noEmit" + }, + "dependencies": { + "@route-modules/account": "workspace:*", + "@route-modules/billing": "workspace:*", + "@route-modules/products": "workspace:*", + "@route-modules/settings": "workspace:*", + "@route-modules/storefront": "workspace:*", + "@route-modules/team": "workspace:*", + "@tanstack/react-router": "workspace:^", + "@tanstack/react-router-devtools": "workspace:^", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-plugin": "workspace:^", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@vitejs/plugin-react": "^6.0.1", + "vite": "^8.0.14", + "vitest": "catalog:" + }, + "nx": { + "targets": { + "generate": { + "dependsOn": [ + "^build", + "^emit-types" + ] + }, + "build": { + "dependsOn": [ + "^build", + "^emit-types" + ] + } + } + } +} diff --git a/e2e/react-router/route-modules/packages/web/src/main.tsx b/e2e/react-router/route-modules/packages/web/src/main.tsx new file mode 100644 index 0000000000..d5f7da7f39 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/main.tsx @@ -0,0 +1,28 @@ +import ReactDOM from 'react-dom/client' +import { RouterProvider } from '@tanstack/react-router' +import { createAppRouter } from './router' +import './styles.css' +import type { Price, Product } from '@route-modules/products/api' + +// Fixture data: every price is derived from the product id. +const product = (id: string): Product => ({ + id, + name: `Product ${id}`, + price: (([...id].reduce((sum, char) => sum + char.charCodeAt(0), 0) % 90) + + 10) as Price, +}) + +const observedModuleMatches: Array = [] +Object.assign(window, { observedModuleMatches }) +const router = createAppRouter( + { + getProduct: (id) => Promise.resolve(product(id)), + listProducts: () => + Promise.resolve([product('1'), product('2'), product('3')]), + }, + (routeId) => observedModuleMatches.push(routeId), +) + +ReactDOM.createRoot(document.getElementById('app')!).render( + , +) diff --git a/e2e/react-router/route-modules/packages/web/src/profile-links.tsx b/e2e/react-router/route-modules/packages/web/src/profile-links.tsx new file mode 100644 index 0000000000..c35747e91f --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/profile-links.tsx @@ -0,0 +1,19 @@ +import * as settings from '@route-modules/settings/scope' +import { orgSettings } from './routeScope.gen' + +// Built once, outside any installation: always the Acme organization's members. +const deferredMembers = settings.linkOptions( + orgSettings.linkOptions({ to: '/members', params: { orgId: 'acme' } }), +) + +export function ProfileLinks() { + const organizationProfile = orgSettings.useMatch({ + from: '@route-modules/settings:/profile', + shouldThrow: false, + }) + // The host owns its installation namespace; the provider renders this slot + // inside the profile match so the local receiver has a real nearest scope. + return organizationProfile ? ( + Acme members + ) : null +} diff --git a/e2e/react-router/route-modules/packages/web/src/router.tsx b/e2e/react-router/route-modules/packages/web/src/router.tsx new file mode 100644 index 0000000000..94fe903a8a --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/router.tsx @@ -0,0 +1,20 @@ +import { createRouter } from '@tanstack/react-router' +import { ProfileLinks } from './profile-links' +import { routeTree } from './routeTree.gen' +import type { ProductsApi } from '@route-modules/products/api' + +export function createAppRouter( + productsApi: ProductsApi, + onProfileMatch?: (routeId: string | undefined) => void, +) { + return createRouter({ + routeTree, + context: { productsApi, onProfileMatch, profileLinks: ProfileLinks }, + }) +} + +declare module '@tanstack/react-router' { + interface Register { + router: ReturnType + } +} diff --git a/e2e/react-router/route-modules/packages/web/src/routes/__root.tsx b/e2e/react-router/route-modules/packages/web/src/routes/__root.tsx new file mode 100644 index 0000000000..fb1918b3fe --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/routes/__root.tsx @@ -0,0 +1,100 @@ +import * as React from 'react' +import { + Link, + Outlet, + createRootRouteWithContext, +} from '@tanstack/react-router' +import { + account, + products, + storefront, + team, + orgSettings, + personSettings, +} from '../routeScope.gen' +import type { ProductsApi } from '@route-modules/products/api' + +// The router devtools, in development only. +const RouterDevtools = import.meta.env.DEV + ? React.lazy(() => + import('@tanstack/react-router-devtools').then((module) => ({ + default: module.TanStackRouterDevtools, + })), + ) + : () => null + +export const Route = createRootRouteWithContext<{ + productsApi: ProductsApi + onProfileMatch?: (routeId: string | undefined) => void + profileLinks?: React.ComponentType +}>()({ + component: AppShell, +}) + +function AppShell() { + const organizationProfile = orgSettings.useMatch({ + from: '@route-modules/settings:/profile', + shouldThrow: false, + }) + return ( + <> +
+ + + Acme Workspace + + +
+ {/* The settings module is installed twice: switch between them, and + watch whether the organization installation's profile matches. */} + +
+ +
+ + + + + ) +} + +/** A small floor plan: outer walls with a door, two inner walls. */ +function PlanMark() { + return ( + + ) +} diff --git a/e2e/react-router/route-modules/packages/web/src/routes/_authenticated.tsx b/e2e/react-router/route-modules/packages/web/src/routes/_authenticated.tsx new file mode 100644 index 0000000000..9cad2d227a --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/routes/_authenticated.tsx @@ -0,0 +1,6 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/_authenticated')({ + beforeLoad: () => ({ user: { id: 'u-1' } }), + component: () => , +}) diff --git a/e2e/react-router/route-modules/packages/web/src/routes/index.tsx b/e2e/react-router/route-modules/packages/web/src/routes/index.tsx new file mode 100644 index 0000000000..90e3aa0f76 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/routes/index.tsx @@ -0,0 +1,122 @@ +import { createFileRoute, useMatch } from '@tanstack/react-router' +import { + account, + billing, + orgSettings, + personSettings, + products, + storefront, + team, +} from '../routeScope.gen' + +export const Route = createFileRoute('/')({ + component: Home, +}) + +// A key plan of the workspace: every module's room where the workspace mounts +// it, nested like the routes. +function Home() { + const productMatch = useMatch({ + from: '@route-modules/products:/$productId', + shouldThrow: false, + }) + return ( + <> +

Acme workspace

+

+ Each region of this workspace is a route module, drawn as a room: its + tag names the package and where the workspace mounts it. +

+
+
+

+ @route-modules/storefront /shop +

+

+ Cart +

+
+

+ @route-modules/products /shop/products +

+

+ + Pick of the day + + {productMatch?.loaderData?.name} +

+
+
+
+

+ @route-modules/account /account +

+

+ Your account +

+
+ {/* The organization route is the workspace's own: both modules below + it get `orgId` from the URL. */} +
+

+ Host route /orgs/$orgId +

+
+
+

+ @route-modules/team /team +

+

+ {/* The team is mounted below `/orgs/$orgId`: links into it pass `orgId`. */} + + Acme team + +

+
+
+

+ @route-modules/billing /billing +

+

+ + Globex billing + +

+
+
+

+ @route-modules/settings#orgSettings /settings +

+

+ + Globex settings + +

+
+
+
+ {/* The settings are installed a second time, per person. */} +
+

+ Host route /people/$personId +

+
+
+

+ @route-modules/settings#personSettings /settings +

+

+ + Ada's profile + +

+
+
+
+
+ + ) +} diff --git a/e2e/react-router/route-modules/packages/web/src/routes/orgs.$orgId.tsx b/e2e/react-router/route-modules/packages/web/src/routes/orgs.$orgId.tsx new file mode 100644 index 0000000000..3c08aa0637 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/routes/orgs.$orgId.tsx @@ -0,0 +1,15 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +// The host route of the modules mounted per organization: they get its path +// params in their URLs and the organization as context, and its settings +// installation the organization as their owner. +export const Route = createFileRoute('/orgs/$orgId')({ + beforeLoad: ({ params }) => { + const name = params.orgId.toUpperCase() + return { + org: { id: params.orgId, name }, + owner: { kind: 'organization' as const, id: params.orgId, name }, + } + }, + component: () => , +}) diff --git a/e2e/react-router/route-modules/packages/web/src/routes/people.$personId.tsx b/e2e/react-router/route-modules/packages/web/src/routes/people.$personId.tsx new file mode 100644 index 0000000000..19ac32e5c7 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/routes/people.$personId.tsx @@ -0,0 +1,13 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +// The host route of the settings installation per person. +export const Route = createFileRoute('/people/$personId')({ + beforeLoad: ({ params }) => ({ + owner: { + kind: 'person' as const, + id: params.personId, + name: params.personId[0]!.toUpperCase() + params.personId.slice(1), + }, + }), + component: () => , +}) diff --git a/e2e/react-router/route-modules/packages/web/src/styles.css b/e2e/react-router/route-modules/packages/web/src/styles.css new file mode 100644 index 0000000000..6b9fa1a97a --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/src/styles.css @@ -0,0 +1,532 @@ +/* + * Acme: the route-module fixtures drawn as a floor plan. Every route module is + * a room: a wall line, a zoning tint and a room tag with its package and mount + * path. Violet marks the active route and nothing else. + */ + +:root { + color-scheme: light; + + --ground: #f4f6f9; + --sheet: #ffffff; + --ink: #1f2328; + --ink-2: #4b535c; + --ink-3: #59616b; + --line: #d3d7db; + --wall: #2a3036; + --route: #5b3fd1; + --route-wash: #e9e5fb; + /* Link underlines: 3:1 or better on the ground and on every zone. */ + --underline: color-mix(in srgb, var(--wall) 55%, transparent); + --zone: #eef0f2; + + --font: + ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, + 'Helvetica Neue', Arial, sans-serif; + /* Plan lettering: a local condensed face where there is one. */ + --font-lettering: + 'Avenir Next Condensed', 'Roboto Condensed', 'Arial Narrow', ui-sans-serif, + system-ui, sans-serif; + --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; + + --s1: 4px; + --s2: 8px; + --s3: 12px; + --s4: 16px; + --s5: 20px; + --s6: 24px; + --s8: 32px; + --s10: 40px; + --s12: 48px; + + /* A drafted wall: two lines with the wall's thickness between them. */ + --wall-line: 6px double var(--wall); + --ease-out: cubic-bezier(0.16, 1, 0.3, 1); +} + +/* Zoning: one tint per module, as on a zoning plan. */ +[data-route-module='@route-modules/storefront'] { + --zone: #e7e9e4; +} +[data-route-module='@route-modules/products'] { + --zone: #e1ebdd; +} +[data-route-module='@route-modules/account'] { + --zone: #dce7f2; +} +[data-route-module='@route-modules/team'] { + --zone: #d9eeeb; +} +[data-route-module='@route-modules/billing'] { + --zone: #f2e1e1; +} +[data-route-module='@route-modules/settings'] { + --zone: #efecd2; +} + +*, +*::before, +*::after { + box-sizing: border-box; +} + +html { + background: var(--ground); + scrollbar-color: var(--line) transparent; +} + +body { + margin: 0; + color: var(--ink); + font: 400 15px/1.55 var(--font); + -webkit-font-smoothing: antialiased; +} + +::selection { + background: var(--route-wash); + color: var(--ink); +} + +:focus-visible { + outline: 2px solid var(--wall); + outline-offset: 2px; + border-radius: 2px; +} + +h1, +h2, +h3 { + margin: 0 0 var(--s3); + font-weight: 650; + letter-spacing: -0.02em; + line-height: 1.2; + text-wrap: balance; +} +h1 { + font-size: 30px; +} +h2 { + font-size: 22px; +} +h3 { + font-size: 18px; +} + +p { + margin: 0 0 var(--s3); + max-width: 68ch; +} + +code { + font: 500 0.92em var(--mono); +} + +a { + color: var(--ink); + text-decoration: underline; + text-decoration-color: var(--underline); + text-decoration-thickness: 1px; + text-underline-offset: 3px; + transition: text-decoration-color 160ms var(--ease-out); +} +a:hover { + text-decoration-color: var(--ink); +} + +button { + font: inherit; +} + +/* Shell */ + +.topbar { + position: sticky; + top: 0; + z-index: 10; + display: flex; + align-items: center; + gap: var(--s8); + min-height: 52px; + padding: 0 var(--s6); + background: var(--sheet); + border-bottom: 1px solid var(--line); +} + +.brand { + display: inline-flex; + align-items: center; + gap: var(--s2); + font-weight: 650; + letter-spacing: -0.01em; + text-decoration: none; + white-space: nowrap; +} +.brand-mark { + flex: none; + width: 18px; + height: 18px; + color: var(--wall); +} +.brand small { + color: var(--ink-3); + font-size: 13px; + font-weight: 500; +} + +.nav { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--s1) var(--s5); + font-size: 14px; +} +.nav a { + position: relative; + margin: 0 calc(-1 * var(--s1)); + padding: var(--s3) var(--s1); + color: var(--ink-2); + text-decoration: none; +} +.nav a:hover { + color: var(--ink); +} +.nav a[data-status='active'] { + color: var(--route); +} +.nav a[data-status='active']::after { + content: ''; + position: absolute; + inset: auto var(--s1) 0; + height: 2px; + background: var(--route); +} +.nav-group { + display: inline-flex; + align-items: center; + gap: var(--s4); + padding-left: var(--s5); + border-left: 1px solid var(--line); +} +.nav-label { + color: var(--ink-3); + font-size: 13px; +} + +/* Secondary bar: switches between the settings installations. */ +.subbar { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: var(--s1) var(--s5); + padding: var(--s2) var(--s6); + background: var(--sheet); + border-bottom: 1px solid var(--line); + font-size: 13px; +} +.subbar a { + color: var(--ink-2); +} +.subbar a[data-status='active'] { + color: var(--route); +} +.subbar-state { + margin-left: auto; + color: var(--ink-3); +} +.subbar-state output { + margin-left: var(--s1); + color: var(--ink); + font: 500 12px var(--mono); +} + +.page { + max-width: 1080px; + margin: 0 auto; + padding: var(--s10) var(--s6) 120px; +} + +.lead { + color: var(--ink-2); + font-size: 17px; +} + +/* Rooms: the signature. A module's region is a room with a wall line, its + zoning tint, and a tag on the wall naming the package and its mount. */ + +.room { + margin-top: var(--s5); + padding: 0 var(--s6) var(--s6); + background: var(--zone) padding-box; + border: var(--wall-line); + animation: room-in 420ms var(--ease-out); +} +.room .room { + margin-top: var(--s8); +} +.room > :last-child { + margin-bottom: 0; +} +/* A room's title has one size whatever its level. */ +.room h1 { + font-size: 22px; +} + +/* The tag sits on the wall: pulled up onto its center line, it wraps on + narrow screens instead of clipping the resolved path. Names and paths keep + their source case: they are identifiers maintainers copy. */ +.room-tag { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 0 var(--s2); + width: fit-content; + max-width: 100%; + margin: -14px 0 var(--s5) calc(var(--s4) - var(--s6)); + padding: 2px var(--s2); + background: var(--sheet); + border: 1px solid var(--wall); + font: 600 12px/16px var(--font-lettering); + font-stretch: condensed; + font-variant-numeric: tabular-nums; + letter-spacing: 0.04em; +} +.room-tag code { + font: 500 11px/16px var(--mono); + color: var(--ink-2); +} +.room-tag .resolved { + color: var(--route); +} + +@keyframes room-in { + from { + background-color: var(--sheet); + } +} + +/* Lists, facts and controls inside rooms */ + +.rows { + margin: 0 0 var(--s4); + padding: 0; + list-style: none; + font-variant-numeric: tabular-nums; + border-top: 1px solid color-mix(in srgb, var(--wall) 22%, transparent); +} +.rows > li { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: var(--s4); + padding: var(--s3) 0; + border-bottom: 1px solid color-mix(in srgb, var(--wall) 22%, transparent); +} +.rows .meta { + color: var(--ink-3); + font-size: 13px; +} + +.facts { + display: grid; + grid-template-columns: max-content 1fr; + align-items: baseline; + gap: var(--s2) var(--s6); + margin: 0 0 var(--s5); + font-variant-numeric: tabular-nums; +} +.facts dt { + color: var(--ink-3); + font-size: 13px; +} +.facts dd { + margin: 0; +} + +/* Fixture probes: the module APIs a page exercises, kept apart from its + content. */ +.probes { + margin-top: var(--s8); + padding-top: var(--s5); + border-top: 1px solid color-mix(in srgb, var(--wall) 22%, transparent); +} +.probes h4 { + margin: 0 0 var(--s2); + color: var(--ink-3); + font-size: 12px; + font-weight: 600; + letter-spacing: 0.06em; + text-transform: uppercase; +} +.probes h4:not(:first-child) { + margin-top: var(--s5); +} +.probes .facts { + margin-bottom: 0; +} +.probes output, +.probes .facts dd > span { + font: 500 13px var(--mono); + overflow-wrap: anywhere; +} + +.actions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--s3) var(--s5); + margin: 0; +} +.actions button { + min-height: 32px; + padding: 0 var(--s3); + color: var(--ink); + background: var(--sheet); + border: 1px solid var(--wall); + border-radius: 6px; + font-size: 14px; + cursor: pointer; +} +.actions button:hover { + background: var(--ground); +} + +.tabs { + display: flex; + gap: var(--s5); + margin: 0 0 var(--s4); + border-bottom: 1px solid color-mix(in srgb, var(--wall) 22%, transparent); + font-size: 14px; +} +.tabs a { + margin-bottom: -1px; + padding: var(--s2) 0; + color: var(--ink-2); + text-decoration: none; + border-bottom: 2px solid transparent; +} +.tabs a:hover { + color: var(--ink); +} +.tabs a[aria-current] { + color: var(--route); + border-bottom-color: var(--route); +} + +.button { + display: inline-flex; + align-items: center; + min-height: 36px; + padding: 0 var(--s4); + color: var(--sheet); + background: var(--wall); + border: 0; + border-radius: 6px; + font-weight: 600; + font-size: 14px; + cursor: pointer; + transition: + background-color 160ms var(--ease-out), + transform 160ms var(--ease-out); +} +.button:hover { + background: var(--ink); +} +.button:active { + transform: translateY(1px); +} + +/* Key plan on the home page: every room where the application mounts it. + A host route that is not a module is a plot boundary around its rooms. */ + +.plan { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + align-items: start; + gap: var(--s8) var(--s6); + margin-top: var(--s10); +} +.plan .room { + margin-top: 0; +} +.plan .room .room { + margin-top: var(--s6); +} +.plan .room > p:not(.room-tag) { + color: var(--ink-2); +} +.plot { + grid-column: 1 / -1; + padding: 0 var(--s6) var(--s6); + border: 1.5px dashed var(--ink-3); +} +.plot-rooms { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + align-items: start; + gap: var(--s8) var(--s6); + padding-top: var(--s3); +} +.plot > .room-tag { + margin-top: -12px; + margin-bottom: var(--s4); + border-style: dashed; + border-color: var(--ink-3); + font-weight: 500; +} + +@media (max-width: 720px) { + .topbar { + position: static; + flex-wrap: wrap; + gap: 0 var(--s4); + padding: var(--s2) var(--s4) 0; + } + /* One scrolling row below the brand. */ + .nav { + order: 1; + flex-basis: 100%; + flex-wrap: nowrap; + gap: var(--s2); + overflow-x: auto; + scrollbar-width: none; + } + .nav a, + .nav-group { + flex: none; + } + .nav-group { + gap: var(--s2); + padding-left: var(--s2); + } + .nav-label { + display: none; + } + .subbar { + padding: var(--s2) var(--s4); + } + .subbar-state { + margin-left: 0; + flex-basis: 100%; + } + .page { + padding: var(--s6) var(--s4) 120px; + } + .room { + padding: 0 var(--s4) var(--s4); + } + .room-tag { + margin-left: 0; + } + .plan { + grid-template-columns: minmax(0, 1fr); + } + .plot { + padding: 0 var(--s4) var(--s4); + } +} + +@media (prefers-reduced-motion: reduce) { + .room { + animation: none; + } +} diff --git a/e2e/react-router/route-modules/packages/web/tests/match-identity.test.tsx b/e2e/react-router/route-modules/packages/web/tests/match-identity.test.tsx new file mode 100644 index 0000000000..7aedbb6ae6 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/tests/match-identity.test.tsx @@ -0,0 +1,139 @@ +import { describe, expect, test } from 'vitest' +import { createMemoryHistory, createRouter } from '@tanstack/react-router' +import { routeTree } from '../src/routeTree.gen' +import { + account, + products, + storefront, + orgSettings, + personSettings, +} from '../src/routeScope.gen' +import { isScopedMatch } from '@route-modules/settings/scope' + +function createApp(pathname: string) { + return createRouter({ + routeTree, + history: createMemoryHistory({ initialEntries: [pathname] }), + // This server harness drives load explicitly. Browser e2e tests exercise + // the navigation subscription owned by a mounted RouterProvider. + isServer: true, + context: { + productsApi: { + getProduct: async (id) => ({ id, name: id, price: 10 as never }), + listProducts: async () => [], + }, + }, + }) +} + +describe('installed module match identity', () => { + test.each([ + ['/orgs/globex/settings/profile', 'orgSettings', '/orgs/$orgId'], + ['/people/ada/settings/profile', 'personSettings', '/people/$personId'], + ])( + 'keeps final and module-local identities for %s', + async (pathname, installation, parent) => { + const router = createApp(pathname) + await router.load() + expect( + router.state.matches.map(({ routeId, localRouteId }) => ({ + routeId, + localRouteId, + })), + ).toEqual([ + { routeId: '__root__', localRouteId: undefined }, + { routeId: parent, localRouteId: undefined }, + { + routeId: `@route-modules/settings#${installation}:`, + localRouteId: '@route-modules/settings:', + }, + { + routeId: `@route-modules/settings#${installation}:/profile`, + localRouteId: '@route-modules/settings:/profile', + }, + ]) + expect(Object.hasOwn(router.state.matches[0]!, 'localRouteId')).toBe( + false, + ) + expect(Object.hasOwn(router.state.matches[1]!, 'localRouteId')).toBe( + false, + ) + }, + ) + + test('loading a new location keeps local identity across installations', async () => { + const router = createApp('/orgs/globex/settings/profile') + await router.load() + router.history.push('/people/ada/settings/profile') + await router.load() + expect(router.state.matches.at(-1)).toMatchObject({ + routeId: '@route-modules/settings#personSettings:/profile', + localRouteId: '@route-modules/settings:/profile', + loaderData: { kind: 'person', handle: '@ada' }, + }) + }) +}) + +test('context-free match guards select the installed subtree and exact namespace', async () => { + const router = createApp('/orgs/globex/settings/profile') + await router.load() + expect( + router.state.matches + .filter(orgSettings.isScopedMatch) + .map((match) => match.routeId), + ).toEqual([ + '@route-modules/settings#orgSettings:', + '@route-modules/settings#orgSettings:/profile', + ]) + expect(router.state.matches.filter(personSettings.isScopedMatch)).toEqual([]) + expect( + router.state.matches + .filter(isScopedMatch) + .map((match) => match.localRouteId), + ).toEqual(['@route-modules/settings:', '@route-modules/settings:/profile']) + + // The server load needs the canonical search value supplied by this route. + router.history.push('/shop/products/1?tab=specs') + await router.load() + // Descendant module matches belong to the storefront's installed subtree. + expect( + router.state.matches + .filter(storefront.isScopedMatch) + .map((match) => match.routeId), + ).toEqual([ + '@route-modules/storefront:', + '@route-modules/products:', + '@route-modules/products:/$productId', + ]) + // The host's namespace for the nested include selects the nested module only. + expect( + router.state.matches + .filter(products.isScopedMatch) + .map((match) => match.routeId), + ).toEqual(['@route-modules/products:', '@route-modules/products:/$productId']) + // Account only declares `uses: products`; that dependency is not installed + // beneath account and must not be classified as an account subtree match. + expect(router.state.matches.filter(account.isScopedMatch)).toEqual([]) +}) + +test('application route objects expose the installed graph', async () => { + const router = createApp('/orgs/globex/settings/profile') + await router.load() + const root = router.routesById['@route-modules/settings#orgSettings:'] + const profile = + router.routesById['@route-modules/settings#orgSettings:/profile'] + // `path` is the normalized segment; options.path is the authored mount path. + expect(root.path).toBe('settings') + expect(root.options.path).toBe('/settings') + expect(root.fullPath).toBe('/orgs/$orgId/settings') + expect(profile.parentRoute).toBe(root) + expect(profile.options.getParentRoute?.()).toBe(root) + expect(profile.parentRoute.id).toBe('@route-modules/settings#orgSettings:') + + const layout = router.routesById['@route-modules/products:/_layout'] + const children = Object.values(layout.children ?? {}) + expect(children.map((child) => child.fullPath)).toEqual([ + '/shop/products/deals', + ]) + expect(children[0]?.parentRoute).toBe(layout) +}) diff --git a/e2e/react-router/route-modules/packages/web/tests/scope-options.test.tsx b/e2e/react-router/route-modules/packages/web/tests/scope-options.test.tsx new file mode 100644 index 0000000000..df968f2f62 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/tests/scope-options.test.tsx @@ -0,0 +1,140 @@ +import * as React from 'react' +import { renderToString } from 'react-dom/server' +import { expect, test } from 'vitest' +import { + RouterContextProvider, + createMemoryHistory, + createRouter, +} from '@tanstack/react-router' +import { routeTree } from '../src/routeTree.gen' +import { orgSettings, personSettings } from '../src/routeScope.gen' +import * as settings from '@route-modules/settings/scope' + +async function createApp() { + const router = createRouter({ + routeTree, + context: { + productsApi: { + getProduct: async (id) => ({ id, name: id, price: 10 as never }), + listProducts: async () => [], + }, + }, + history: createMemoryHistory({ + initialEntries: ['/orgs/7/settings/profile'], + }), + }) + await router.load() + return router +} + +test('scoped consumers reject options from another named installation', async () => { + const router = await createApp() + // JSON is a realistic untyped source; typed conflicts are covered separately. + const foreign = JSON.parse( + JSON.stringify( + personSettings.linkOptions({ + to: '/members', + params: { personId: 'u1' }, + }), + ), + ) + for (const Component of [ + orgSettings.Link, + orgSettings.Navigate, + orgSettings.MatchRoute, + ]) { + expect(() => + renderToString( + + {React.createElement(Component as React.ComponentType, foreign)} + , + ), + ).toThrow(/Cannot use route scope/) + } + expect(() => orgSettings.linkOptions(foreign)).toThrow( + /Cannot use route scope/, + ) + expect(() => orgSettings.redirect(foreign)).toThrow(/Cannot use route scope/) +}) + +test('same-scope options and neutral consumers preserve their destination', async () => { + const router = await createApp() + const home = orgSettings.linkOptions({ + to: '/members', + params: { orgId: '7' }, + }) + expect(router.buildLocation(home).href).toBe('/orgs/7/settings/members') + expect( + renderToString( + + Members + , + ), + ).toContain('href="/orgs/7/settings/members"') +}) + +test('a context-free local receiver preserves its constraint until navigation', async () => { + const router = await createApp() + const local = settings.linkOptions({ to: '/members' }) + const explicit = personSettings.linkOptions({ + to: '/members', + params: { personId: 'u1' }, + }) + const deferred = settings.linkOptions(explicit) + const redirect = settings.redirect(explicit) + function Receiver({ options }: { options: typeof local | typeof deferred }) { + // The generated namespace is the explicit receiving installation. The + // normal hook supplies its router view; no private origin is fabricated. + const scopedRouter = orgSettings.useRouter() + return {scopedRouter.buildLocation(options).href} + } + function renderOptions(options: typeof local | typeof deferred) { + return renderToString( + + + , + ) + } + expect(renderOptions(local)).toContain('/orgs/7/settings/members') + expect(() => renderOptions(deferred)).toThrow(/Cannot use route scope/) + // The redirect's public options keep the same unresolved receiving contract. + expect(() => renderOptions(redirect.options)).toThrow( + /Cannot use route scope/, + ) +}) + +test('an explicit receiving scope resolves a deferred local constraint', async () => { + const router = await createApp() + const options = settings.linkOptions( + orgSettings.linkOptions({ to: '/members', params: { orgId: '7' } }), + ) + function Receiver() { + const href = orgSettings.useRouter().buildLocation(options).href + return {href} + } + expect( + renderToString( + + + , + ), + ).toContain('/orgs/7/settings/members') +}) + +test('stamped mask options cannot silently retarget a sibling installation', async () => { + const router = await createApp() + const mask = JSON.parse( + JSON.stringify( + personSettings.linkOptions({ + to: '/members', + params: { personId: 'u1' }, + }), + ), + ) + const options = orgSettings.linkOptions({ + to: '/members', + params: { orgId: '7' }, + mask, + }) + expect(() => router.buildLocation(options)).toThrow(/Cannot use route scope/) +}) diff --git a/e2e/react-router/route-modules/packages/web/tsconfig.contracts.json b/e2e/react-router/route-modules/packages/web/tsconfig.contracts.json new file mode 100644 index 0000000000..c783b45e43 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/tsconfig.contracts.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "include": ["src", "type-tests"], + "compilerOptions": { + "skipLibCheck": false + } +} diff --git a/e2e/react-router/route-modules/packages/web/tsconfig.json b/e2e/react-router/route-modules/packages/web/tsconfig.json new file mode 100644 index 0000000000..44dff33802 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": ["vite/client"] + }, + "include": ["src"] +} diff --git a/e2e/react-router/route-modules/packages/web/tsr.config.json b/e2e/react-router/route-modules/packages/web/tsr.config.json new file mode 100644 index 0000000000..0b6ae92d38 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/tsr.config.json @@ -0,0 +1,36 @@ +{ + "routesDirectory": "./src/routes", + "generatedRouteTree": "./src/routeTree.gen.ts", + "routeModules": { + "includes": [ + { "module": "@route-modules/storefront", "at": "/shop" }, + { + "module": "@route-modules/account", + "parent": "/_authenticated", + "at": "/account" + }, + { + "module": "@route-modules/team", + "parent": "/orgs/$orgId", + "at": "/team" + }, + { + "module": "@route-modules/billing", + "parent": "/orgs/$orgId", + "at": "/billing" + }, + { + "module": "@route-modules/settings", + "parent": "/orgs/$orgId", + "at": "/settings", + "as": "orgSettings" + }, + { + "module": "@route-modules/settings", + "parent": "/people/$personId", + "at": "/settings", + "as": "personSettings" + } + ] + } +} diff --git a/e2e/react-router/route-modules/packages/web/type-tests/core-contracts.tsx b/e2e/react-router/route-modules/packages/web/type-tests/core-contracts.tsx new file mode 100644 index 0000000000..4f12bdbdd4 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/type-tests/core-contracts.tsx @@ -0,0 +1,211 @@ +import { describe, expectTypeOf, test } from 'vitest' +import type { routeTree } from '../src/routeTree.gen' +import type { createAppRouter } from '../src/router' +import { routeModule as productsRouteModule } from '@route-modules/products/route-module' +import { + useMatch as useProductMatch, + useRouter as useProductRouter, + useRouterState as useProductRouterState, + useLocation as useProductLocation, + useSearch as useProductSearch, + isScopedMatch as isProductMatch, +} from '@route-modules/products/scope' +import type { + Router as ProductsRouter, + OwnRoutesById, +} from '@route-modules/products/route-types' +import type { Product } from '@route-modules/products/api' +import type { + AnyRouteMatch, + AnyRoute, + ForeignRouteMatch, + InstallationRoutesById, + MountedRoutesById, + MakeRouteMatch, + MakeRouteMatchUnion, +} from '@tanstack/react-router' + +declare const ProductRoute: OwnRoutesById['@route-modules/products:/$productId'] +declare const foreignMatch: ForeignRouteMatch +declare const routerMatch: AnyRouteMatch +declare const mountedProduct: ReturnType< + typeof createAppRouter +>['routesById']['@route-modules/products:/$productId'] + +const applicationRoute: AnyRoute = mountedProduct +void applicationRoute + +describe('installed route identity contracts', () => { + test('installation map values agree with their keys', () => { + type Installed = InstallationRoutesById< + { '@route-modules/products:/$productId': typeof ProductRoute }, + '@route-modules/products', + 'shopProducts' + > + type Product = Installed['@route-modules/products#shopProducts:/$productId'] + + expectTypeOf< + Product['id'] + >().toEqualTypeOf<'@route-modules/products#shopProducts:/$productId'>() + expectTypeOf< + Product['types']['id'] + >().toEqualTypeOf<'@route-modules/products#shopProducts:/$productId'>() + expectTypeOf( + ProductRoute.id, + ).toEqualTypeOf<'@route-modules/products:/$productId'>() + type Mounted = + MountedRoutesById['@route-modules/products#shopProducts:/$productId'] + expectTypeOf().toEqualTypeOf() + expectTypeOf().toEqualTypeOf() + expectTypeOf().toEqualTypeOf() + expectTypeOf(ProductRoute.fullPath).toEqualTypeOf<'/$productId'>() + }) + + test('known module matches have an exact required local identity', () => { + type ProductMatch = MakeRouteMatch< + typeof productsRouteModule, + '@route-modules/products:/$productId' + > + expectTypeOf< + ProductMatch['localRouteId'] + >().toEqualTypeOf<'@route-modules/products:/$productId'>() + expectTypeOf().toEqualTypeOf< + string | undefined + >() + }) + + test('application records preserve ordinary path precision and mixed optional identity', () => { + type Tree = typeof routeTree + type Host = MakeRouteMatch + expectTypeOf().toEqualTypeOf<'/orgs/$orgId'>() + type Mixed = MakeRouteMatch< + Tree, + '/orgs/$orgId' | '@route-modules/settings#orgSettings:/profile' + > + expectTypeOf().toEqualTypeOf() + type Product = MakeRouteMatch< + Tree, + '@route-modules/settings#orgSettings:/profile' + > + expectTypeOf< + Product['routeId'] + >().toEqualTypeOf<'@route-modules/settings#orgSettings:/profile'>() + expectTypeOf().toEqualTypeOf() + }) + + test('module hooks describe final installation identity honestly', () => { + const match = useProductMatch({ + from: '@route-modules/products:/$productId', + }) + expectTypeOf(match.fullPath).toEqualTypeOf() + expectTypeOf(match.routeId).toEqualTypeOf< + | '@route-modules/products:/$productId' + | `@route-modules/products#${string}:/$productId` + >() + expectTypeOf( + match.localRouteId, + ).toEqualTypeOf<'@route-modules/products:/$productId'>() + }) + + test('a full scoped match chain includes unknown host data', () => { + type Match = MakeRouteMatchUnion + expectTypeOf().toBeUnknown() + expectTypeOf().toBeUnknown() + expectTypeOf(useProductRouterState().matches[0]!.context).toBeUnknown() + expectTypeOf(useProductLocation().search).toEqualTypeOf< + Record + >() + expectTypeOf(useProductRouter().state.location.search).toEqualTypeOf< + Record + >() + expectTypeOf( + useProductSearch({ from: '@route-modules/products:/$productId' }).tab, + ).toEqualTypeOf<'specs' | 'reviews'>() + expectTypeOf(useProductRouter().state.matches[0]!.loaderData).toBeUnknown() + useProductRouterState({ + select: (state) => { + expectTypeOf(state.matches[0]!.context).toBeUnknown() + return state.matches.length + }, + }) + }) + + test('scope membership narrows complete router matches', () => { + isProductMatch(routerMatch) + isProductMatch(foreignMatch) + for (const match of useProductRouterState().matches) { + if ( + isProductMatch(match) && + match.localRouteId === '@route-modules/products:/$productId' + ) { + expectTypeOf(match.loaderData).toEqualTypeOf() + } + } + + // @ts-expect-error Scope membership cannot supply absent match data. + isProductMatch({ + routeId: '@route-modules/products:/$productId', + localRouteId: '@route-modules/products:/$productId', + }) + }) + + test('loose match selectors retain unknown foreign route data', () => { + useProductMatch({ + strict: false, + select: (match) => { + expectTypeOf(match.loaderData).toBeUnknown() + expectTypeOf(match.context).toBeUnknown() + return match.routeId + }, + }) + }) + + test('raw scoped router maps do not promise module-local aliases', () => { + const router = useProductRouter() + expectTypeOf( + router.routesById['@route-modules/products:/$productId'], + ).toEqualTypeOf() + expectTypeOf(router.routesByPath['/$productId']).toEqualTypeOf< + AnyRoute | undefined + >() + }) +}) + +test('application route records expose mounted paths and raw linked routes honestly', () => { + type Routes = ReturnType['routesById'] + type Root = Routes['@route-modules/settings#orgSettings:'] + type Profile = Routes['@route-modules/settings#orgSettings:/profile'] + // These are values read from the real generated installation at runtime. + // They must be assignable to the public route object's declared fields. + expectTypeOf<'settings'>().toMatchTypeOf() + expectTypeOf<'settings'>().toMatchTypeOf() + expectTypeOf<'/settings'>().toMatchTypeOf< + NonNullable + >() + expectTypeOf<'@route-modules/settings#orgSettings:'>().toMatchTypeOf< + Profile['parentRoute']['id'] + >() + expectTypeOf<'@route-modules/settings#orgSettings:'>().toMatchTypeOf< + Profile['types']['parentRoute']['id'] + >() + type ParentFromOptions = ReturnType< + NonNullable + > + expectTypeOf<'@route-modules/settings#orgSettings:'>().toMatchTypeOf< + ParentFromOptions['id'] + >() + + type Layout = Routes['@route-modules/products:/_layout'] + type Children = NonNullable + type Child = + Children extends ReadonlyArray ? Item : Children[keyof Children] + expectTypeOf<'/shop/products/deals'>().toMatchTypeOf() + + // Precision that the application can prove remains intact. + expectTypeOf< + Profile['id'] + >().toEqualTypeOf<'@route-modules/settings#orgSettings:/profile'>() + expectTypeOf< + Routes['/orgs/$orgId']['fullPath'] + >().toEqualTypeOf<'/orgs/$orgId'>() +}) diff --git a/e2e/react-router/route-modules/packages/web/type-tests/module-apis.tsx b/e2e/react-router/route-modules/packages/web/type-tests/module-apis.tsx new file mode 100644 index 0000000000..d781bf9f22 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/type-tests/module-apis.tsx @@ -0,0 +1,214 @@ +import * as React from 'react' +import { describe, expectTypeOf, test } from 'vitest' +import { Link, useMatch } from '@tanstack/react-router' +import { + Link as ProductsLink, + getRouteApi as productsGetRouteApi, + linkOptions as productsLinkOptions, + redirect as productsRedirect, + useLoaderData as productsUseLoaderData, + useNavigate as productsUseNavigate, + useRouter as productsUseRouter, +} from '@route-modules/products/scope' +import { + Link as AccountLink, + getRouteApi as accountGetRouteApi, + products, +} from '@route-modules/account/scope' +import * as localTeam from '@route-modules/team/scope' +import { team as hostedTeam } from '../src/routeScope.gen' +import type { createAppRouter } from '../src/router' +import type { Price, Product, ProductsApi } from '@route-modules/products/api' +import type { + Router as ProductsRouter, + OwnRoutesById, +} from '@route-modules/products/route-types' +import type { ScopedRouterView } from '@tanstack/react-router' + +declare const ProductRoute: OwnRoutesById['@route-modules/products:/$productId'] +declare const ProductsRootRoute: OwnRoutesById['@route-modules/products:'] + +describe('module route types', () => { + test('ids are qualified, full paths are module-local', () => { + expectTypeOf( + ProductRoute.id, + ).toEqualTypeOf<'@route-modules/products:/$productId'>() + expectTypeOf(ProductRoute.fullPath).toEqualTypeOf<'/$productId'>() + expectTypeOf( + ProductsRootRoute.id, + ).toEqualTypeOf<'@route-modules/products:'>() + }) + + test('route-bound hooks resolve through the module scope', () => { + const product = ProductRoute.useLoaderData() + expectTypeOf(product).not.toBeAny() + expectTypeOf(product).toEqualTypeOf() + expectTypeOf(product.price).toEqualTypeOf() + + expectTypeOf(ProductRoute.useParams()).toEqualTypeOf<{ + productId: string + }>() + expectTypeOf(ProductRoute.useSearch()).toEqualTypeOf<{ + tab: 'specs' | 'reviews' + }>() + expectTypeOf(ProductRoute.useRouteContext()).toEqualTypeOf<{ + productsApi: ProductsApi + }>() + }) + + test('the module root requires its router context', () => { + expectTypeOf(ProductsRootRoute.types.routerContext).toEqualTypeOf<{ + productsApi: ProductsApi + }>() + }) +}) + +describe('scoped path-based APIs', () => { + test('Link takes module-local paths only', () => { + ; + ; + ; + // @ts-expect-error unknown module-local path + ; + // @ts-expect-error final application paths are not module-local paths + ; + // @ts-expect-error missing params + ; + // @ts-expect-error required search input is missing + ; + ; + }) + + test('useNavigate, redirect and linkOptions use the module router', () => { + const navigate = productsUseNavigate() + navigate({ to: '/$productId', params: { productId: '1' } }) + // @ts-expect-error unknown module-local path + navigate({ to: '/nope' }) + + productsRedirect({ to: '/compare', search: { ids: [] } }) + // @ts-expect-error required search input is missing + productsRedirect({ to: '/compare' }) + + productsLinkOptions({ to: '/$productId', params: { productId: '1' } }) + // @ts-expect-error unknown module-local path + productsLinkOptions({ to: '/nope' }) + }) + + test('the scoped router view navigates in module coordinates', () => { + const router = productsUseRouter() + expectTypeOf(router).toEqualTypeOf>() + router.navigate({ to: '/compare', search: { ids: ['1'] } }) + // @ts-expect-error unknown module-local path + router.navigate({ to: '/nope' }) + }) + + test('Route.Link and Route.useNavigate are module-local', () => { + ; + ; + // @ts-expect-error unknown module-local path + ; + const navigate = ProductRoute.useNavigate() + navigate({ to: '/compare', search: { ids: [] } }) + // @ts-expect-error unknown module-local path + navigate({ to: '/nope' }) + }) +}) + +describe('scoped id-based APIs', () => { + test('getRouteApi and hooks take qualified ids', () => { + const product = productsGetRouteApi( + '@route-modules/products:/$productId', + ).useLoaderData() + expectTypeOf(product).toEqualTypeOf() + expectTypeOf( + productsUseLoaderData({ from: '@route-modules/products:/$productId' }), + ).toEqualTypeOf() + // @ts-expect-error unknown qualified id + productsGetRouteApi('@route-modules/products:/nope') + // @ts-expect-error module-local paths are not route ids + productsGetRouteApi('/$productId') + }) +}) + +describe('a module that uses another module', () => { + test('the namespace links into the used module', () => { + ; + // @ts-expect-error account paths are not products paths + ; + ; + // @ts-expect-error products paths are not account paths + ; + }) + + test('both modules own "/" without colliding', () => { + ; + ; + }) + + test('used module routes are addressed through the namespace, not the own scope', () => { + // The module's own scope knows its own routes and the modules it + // includes; the routes of a used module come through its namespace, so + // the module's contract never reaches the contracts it links into. + expectTypeOf( + products + .getRouteApi('@route-modules/products:/$productId') + .useLoaderData(), + ).toEqualTypeOf() + // @ts-expect-error a used module's id is not part of the own scope + accountGetRouteApi('@route-modules/products:/$productId') + expectTypeOf( + accountGetRouteApi( + '@route-modules/account:/orders/$orderId', + ).useLoaderData(), + ).toEqualTypeOf<{ orderId: string; productId: string }>() + }) +}) + +describe('a module mounted under path params', () => { + test('the actual generated host namespace takes host and module params', () => { + ; + ; + // @ts-expect-error the host parameter is missing + ; + // @ts-expect-error a route without local params still needs host params + ; + hostedTeam.linkOptions({ to: '/', params: { orgId: 'acme' } }) + }) + + test('the published module-local API does not require host params', () => { + ; + ; + }) +}) + +describe('the application', () => { + type AppRouter = ReturnType + + test('addresses its own routes by path and module routes by id', () => { + ; + to="/orgs/$orgId" + params={{ orgId: 'acme' }} + /> + ; + // @ts-expect-error module routes are not addressed by final path + to="/shop/products/$productId" + /> + expectTypeOf( + useMatch({ + from: '@route-modules/products:/$productId', + }).loaderData, + ).toEqualTypeOf() + }) +}) diff --git a/e2e/react-router/route-modules/packages/web/type-tests/scope-contracts.tsx b/e2e/react-router/route-modules/packages/web/type-tests/scope-contracts.tsx new file mode 100644 index 0000000000..7ce5a914ef --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/type-tests/scope-contracts.tsx @@ -0,0 +1,96 @@ +import * as React from 'react' +import { expectTypeOf, test } from 'vitest' +import { orgSettings, personSettings } from '../src/routeScope.gen' +import * as settings from '@route-modules/settings/scope' + +test('reusable options preserve their installation through spreads and arrays', () => { + const user = personSettings.linkOptions({ + to: '/members', + params: () => ({ personId: 'u1', orgId: '7' }), + }) + expectTypeOf( + user._module, + ).toEqualTypeOf<'@route-modules/settings#personSettings'>() + const same = + const { _module, ...neutral } = user + const compatiblePathsAndParams = + void compatiblePathsAndParams + void _module + // @ts-expect-error An explicit sibling installation is a conflicting scope. + const different = + // @ts-expect-error Rewrapping must not erase the conflicting scope. + orgSettings.linkOptions({ ...user }) + // @ts-expect-error Arrays preserve each entry's destination scope. + orgSettings.linkOptions([user]) + // @ts-expect-error Redirects enforce the same receiving-scope contract. + orgSettings.redirect(user) + orgSettings.linkOptions({ + to: '/members', + params: { orgId: '7' }, + // @ts-expect-error A mask cannot silently retarget another installation's options. + mask: user, + }) + // @ts-expect-error Hook defaults must retain and check a reusable scope stamp. + orgSettings.useNavigate({ ...user, from: '/profile' }) + // @ts-expect-error The callback checks the same destination stamp. + orgSettings.useNavigate()(user) + void same + void different +}) + +test('module-typed helper targets only known route IDs', () => { + settings.notFound({ routeId: '@route-modules/settings:' }) + settings.notFound() + // @ts-expect-error This route is not declared by the module. + settings.notFound({ routeId: '@route-modules/settings:/absent' }) +}) + +test('blocker locations describe the entire application and raw URL values', () => { + settings.useBlocker({ + shouldBlockFn: ({ current, next }) => { + expectTypeOf(current.routeId).toEqualTypeOf() + expectTypeOf(next.fullPath).toEqualTypeOf() + expectTypeOf(next.params).toEqualTypeOf< + Record + >() + expectTypeOf(next.search).toEqualTypeOf>() + return false + }, + }) +}) + +test('match selectors expose foreign data and the generated guard restores known data', () => { + settings.useMatch({ + strict: false, + select: (match) => { + expectTypeOf(match.context).toBeUnknown() + expectTypeOf(match.loaderData).toBeUnknown() + return match.routeId + }, + }) + settings.useMatches({ + select: (matches) => { + expectTypeOf(matches[0]!.context).toBeUnknown() + for (const match of matches) { + if ( + settings.isScopedMatch(match) && + match.localRouteId === '@route-modules/settings:/members' + ) { + expectTypeOf(match.loaderData).toEqualTypeOf< + { label: 'members' } | undefined + >() + expectTypeOf(match.fullPath).toEqualTypeOf() + } + } + return matches.length + }, + }) +}) + +test('MatchRoute accepts only the scope paths in JSX', () => { + const own = + // @ts-expect-error This path is not a module route. + const foreign = + void own + void foreign +}) diff --git a/e2e/react-router/route-modules/packages/web/type-tests/validation-aliases.tsx b/e2e/react-router/route-modules/packages/web/type-tests/validation-aliases.tsx new file mode 100644 index 0000000000..3f6ef55683 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/type-tests/validation-aliases.tsx @@ -0,0 +1,110 @@ +import { expectTypeOf, test } from 'vitest' +import type { orgSettings } from '../src/routeScope.gen' + +test('every generated validation alias preserves its namespace contract', () => { + type Options = { to: '/profile'; params: { orgId: '7' } } + const options: Options = { to: '/profile', params: { orgId: '7' } } + const link: orgSettings.ValidateLinkOptions = options + const links: orgSettings.ValidateLinkOptionsArray = [ + options, + ] + const navigate: orgSettings.ValidateNavigateOptions = options + const navigations: orgSettings.ValidateNavigateOptionsArray< + readonly [Options] + > = [options] + const redirect: orgSettings.ValidateRedirectOptions = options + const redirects: orgSettings.ValidateRedirectOptionsArray< + readonly [Options] + > = [options] + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + + const from: orgSettings.ValidateFromPath<'/profile'> = '/profile' + const to: orgSettings.ValidateToPath<'/profile'> = '/profile' + const search: orgSettings.ValidateSearch<'/search'> = { + search: { query: 'hello' }, + } + const params: orgSettings.ValidateParams<'/profile'> = { + params: { orgId: '7' }, + } + const id: orgSettings.ValidateId<'@route-modules/settings:/profile'> = + '@route-modules/settings:/profile' + const useSearch: orgSettings.ValidateUseSearchOptions<{ + from: '@route-modules/settings:/profile' + }> = { from: '@route-modules/settings:/profile' } + const useParams: orgSettings.ValidateUseParamsOptions<{ + from: '@route-modules/settings:/profile' + }> = { from: '@route-modules/settings:/profile' } + void [from, to, search, params, id, useSearch, useParams] + + const foreignPath = { + to: '/orgs/$orgId', + params: { orgId: '7' }, + } as const + const foreignPaths = [foreignPath] as const + const foreignOrigin = { from: '/orgs/$orgId' } as const + const wrongSearch = { search: { query: 42 } } + const wrongParams = { params: { userId: 'u1' } } + + // @ts-expect-error The validation alias is bound to this module's paths. + const invalidLink: orgSettings.ValidateLinkOptions = + foreignPath + // @ts-expect-error Tuple entries retain the generated scope. + const invalidLinks: orgSettings.ValidateLinkOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error Navigation wrappers cannot escape the module paths. + const invalidNavigate: orgSettings.ValidateNavigateOptions< + typeof foreignPath + > = foreignPath + // @ts-expect-error Every navigation array entry is checked. + const invalidNavigations: orgSettings.ValidateNavigateOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error Redirect wrappers retain module path validation. + const invalidRedirect: orgSettings.ValidateRedirectOptions< + typeof foreignPath + > = foreignPath + // @ts-expect-error Every redirect array entry is checked. + const invalidRedirects: orgSettings.ValidateRedirectOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error A route origin must be a path in the module. + const invalidFrom: orgSettings.ValidateFromPath<'/orgs/$orgId'> = + '/orgs/$orgId' + // @ts-expect-error A destination must be a path in the module. + const invalidTo: orgSettings.ValidateToPath<'/orgs/$orgId'> = '/orgs/$orgId' + // @ts-expect-error Search validation follows the generated route schema. + const invalidSearch: orgSettings.ValidateSearch<'/search'> = wrongSearch + // @ts-expect-error The named installation requires its own host parameter. + const invalidParams: orgSettings.ValidateParams<'/profile'> = wrongParams + // @ts-expect-error A foreign route ID is not a module route. + const invalidId: orgSettings.ValidateId<'/orgs/$orgId'> = '/orgs/$orgId' + // @ts-expect-error Search selectors must name a route in this module. + const invalidUseSearch: orgSettings.ValidateUseSearchOptions< + typeof foreignOrigin + > = foreignOrigin + // @ts-expect-error Parameter selectors must name a route in this module. + const invalidUseParams: orgSettings.ValidateUseParamsOptions< + typeof foreignOrigin + > = foreignOrigin + void [ + invalidLink, + invalidLinks, + invalidNavigate, + invalidNavigations, + invalidRedirect, + invalidRedirects, + invalidFrom, + invalidTo, + invalidSearch, + invalidParams, + invalidId, + invalidUseSearch, + invalidUseParams, + ] +}) diff --git a/e2e/react-router/route-modules/packages/web/vite.config.ts b/e2e/react-router/route-modules/packages/web/vite.config.ts new file mode 100644 index 0000000000..02d676f946 --- /dev/null +++ b/e2e/react-router/route-modules/packages/web/vite.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' +import { tanstackRouter } from '@tanstack/router-plugin/vite' + +// The router plugin reads `tsr.config.json`, including the route modules this +// application mounts. +export default defineConfig({ + plugins: [ + tanstackRouter({ target: 'react', autoCodeSplitting: true }), + react(), + ], +}) diff --git a/e2e/react-router/route-modules/playwright.config.ts b/e2e/react-router/route-modules/playwright.config.ts new file mode 100644 index 0000000000..7c30ba6f79 --- /dev/null +++ b/e2e/react-router/route-modules/playwright.config.ts @@ -0,0 +1,29 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` +// Publish the route modules, then build and serve the application that mounts +// them. Only the application is bundled; modules are compiled from source. +const command = `node scripts/prepare.mjs && pnpm --filter @route-modules/web build && pnpm --filter @route-modules/web exec vite preview --host 0.0.0.0 --port ${PORT}` + +export default defineConfig({ + testDir: './e2e', + workers: 1, + reporter: [['line']], + use: { + baseURL, + }, + webServer: { + command, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-router/route-modules/playwright.dev.config.ts b/e2e/react-router/route-modules/playwright.dev.config.ts new file mode 100644 index 0000000000..a244db6ea7 --- /dev/null +++ b/e2e/react-router/route-modules/playwright.dev.config.ts @@ -0,0 +1,29 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` +// Development: the application's dev server compiles module route files from +// their packages, code-splits them and hot-updates them. +const command = `node scripts/prepare.mjs && pnpm --filter @route-modules/web exec vite --host 0.0.0.0 --port ${PORT}` + +export default defineConfig({ + testDir: './e2e-dev', + workers: 1, + reporter: [['line']], + use: { + baseURL, + }, + webServer: { + command, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-router/route-modules/scripts/prepare.mjs b/e2e/react-router/route-modules/scripts/prepare.mjs new file mode 100644 index 0000000000..20d431c48c --- /dev/null +++ b/e2e/react-router/route-modules/scripts/prepare.mjs @@ -0,0 +1,49 @@ +// Generates routes and builds declarations in dependency order using the +// fixture packages' ordinary TypeScript build. +// +// The modules list `@tanstack/router-core` as a dev dependency only because +// the fixture links `@tanstack/react-router` from the workspace: TypeScript +// names the types of a linked package's dependencies by their own package +// name. Installed from a registry, the declarations name them through +// `@tanstack/react-router`, the only router package modules need. +import { spawnSync } from 'node:child_process' +import { rmSync } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { Generator, getConfig } from '@tanstack/router-generator' + +const packages = path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + '../packages', +) + +const tsc = path.resolve( + packages, + '../../../../node_modules/.bin', + process.platform === 'win32' ? 'tsc.cmd' : 'tsc', +) + +for (const name of [ + 'products', + 'storefront', + 'account', + 'team', + 'settings', + 'billing', +]) { + const root = path.join(packages, name) + const config = getConfig({ disableLogging: true }, root) + await new Generator({ config, root }).run() + rmSync(path.join(root, '.tanstack/types'), { recursive: true, force: true }) + const result = spawnSync( + tsc, + ['-p', 'tsconfig.route-types.json', '--pretty', 'false'], + { cwd: root, stdio: 'inherit', shell: process.platform === 'win32' }, + ) + if (result.error) { + throw result.error + } + if (result.status !== 0) { + process.exit(result.status ?? 1) + } +} diff --git a/e2e/react-router/route-modules/tests/circular-references.test.ts b/e2e/react-router/route-modules/tests/circular-references.test.ts new file mode 100644 index 0000000000..9bfbf491f3 --- /dev/null +++ b/e2e/react-router/route-modules/tests/circular-references.test.ts @@ -0,0 +1,150 @@ +import { afterEach, beforeEach, describe, expect, test } from 'vitest' +import { Workspace, expectChecksPass, expectEmitsPass } from './workspace' + +/** + * products uses account and account uses products (a `uses` cycle), and + * products uses storefront while storefront includes products (a mixed + * cycle). Generation reads only the package.json files of used modules and + * declaration builds compile against the generated stand-ins in + * `.tanstack/route-types-stubs.d.ts`, so `uses` imposes no order on either. + * Only `includes` does: storefront generates and emits after products. + */ +const packages = ['products', 'account', 'storefront'] + +let ws: Workspace + +beforeEach(() => { + ws = new Workspace(packages) +}) + +afterEach(() => { + ws.dispose() +}) + +/** Content hashes of every emitted declaration file. */ +const declarations = (name: string) => ws.hashes(name, '.tanstack/types') + +describe('route modules that link to each other', () => { + test.each([ + ['products', 'account', 'storefront'], + ['account', 'products', 'storefront'], + ['products', 'storefront', 'account'], + ])('generates %s, %s, %s from a clean checkout', async (...order) => { + for (const name of order) { + await ws.generate(name) + } + for (const name of packages) { + expect(ws.exists(name, '.tanstack/route-types-stubs.d.ts')).toBe(true) + } + const stubs = ws.read('products', '.tanstack/route-types-stubs.d.ts') + expect(stubs).toContain( + "declare module '@route-modules/account/route-types'", + ) + expect(stubs).toContain( + "declare module '@route-modules/storefront/route-types'", + ) + // Including still orders generation: storefront reads products' manifest. + expect( + ws.read('storefront', '.tanstack/route-types-stubs.d.ts'), + ).not.toContain('declare module') + }) + + test('including a module still requires its manifest', async () => { + await expect(ws.generate('storefront')).rejects.toThrow( + /"@route-modules\/products" has no route module manifest/, + ) + }) + + test('a used module contributes nothing to the generated files', async () => { + await ws.generate('products') + const before = ws.snapshot('products', 'src') + await ws.generate('account') + await ws.generate('storefront') + await ws.generate('products') + expect(ws.snapshot('products', 'src')).toEqual(before) + }) + + test.each([ + ['products', 'account', 'storefront'], + ['account', 'products', 'storefront'], + ['products', 'storefront', 'account'], + ])( + 'emits declarations as %s, %s, %s and checks every module', + async (...order) => { + for (const name of ['products', 'account', 'storefront']) { + await ws.generate(name) + } + await expectEmitsPass(ws, ...order) + await expectChecksPass(ws, ...packages) + }, + ) + + test('the stand-ins emit the same declarations as the real contracts', async () => { + for (const name of packages) { + await ws.generate(name) + } + await expectEmitsPass(ws, ...packages) + const withStubs = { + products: declarations('products'), + account: declarations('account'), + } + // Every contract exists now: build the two using modules against the + // real contracts instead of the stand-ins. + for (const name of ['products', 'account'] as const) { + const emitted = await ws.emitTypesAgainstContracts(name) + expect(emitted.diagnostics, `declarations of ${name}`).toEqual([]) + expect(declarations(name)).toEqual(withStubs[name]) + } + }) + + test('an export typed from a used module is the one declaration that depends on it', async () => { + // The rule the stand-ins rely on: a module's exported declarations must + // not derive from a used module's types, whether imported from it or + // obtained through its namespace. This helper breaks the rule on purpose. + ws.write( + 'account', + 'src/ordered-product.ts', + `import { products } from './routeScope.gen' + +const productRoute = products.getRouteApi('@route-modules/products:/$productId') + +export function useOrderedProduct() { + return productRoute.useLoaderData() +} +`, + ) + for (const name of packages) { + await ws.generate(name) + } + await expectEmitsPass(ws, 'products', 'account') + const withStubs = declarations('account') + expect((await ws.emitTypesAgainstContracts('account')).ok).toBe(true) + const real = declarations('account') + const changed = Object.keys(real).filter( + (file) => real[file] !== withStubs[file], + ) + expect(changed).toEqual([ + 'src/ordered-product.d.ts', + 'src/ordered-product.d.ts.map', + ]) + // Against the stand-ins the loader data is unknown; against the real + // contract it is the product. + expect( + ws.read('account', '.tanstack/types/src/ordered-product.d.ts'), + ).toContain('price: import("@route-modules/products/api").Price') + }) + + test('a source check names the used contract it is missing', async () => { + for (const name of packages) { + await ws.generate(name) + } + expect((await ws.emitTypes('products')).ok).toBe(true) + // account has not emitted: products' declaration build did not need it, + // its source check does. + const result = await ws.check('products') + expect(result.ok).toBe(false) + expect(result.diagnostics.join('\n')).toMatch( + /Cannot find module '@route-modules\/account\/route-types'/, + ) + }) +}) diff --git a/e2e/react-router/route-modules/tests/generated-api-bundles.test.ts b/e2e/react-router/route-modules/tests/generated-api-bundles.test.ts new file mode 100644 index 0000000000..8d7c303097 --- /dev/null +++ b/e2e/react-router/route-modules/tests/generated-api-bundles.test.ts @@ -0,0 +1,450 @@ +import fs from 'node:fs/promises' +import os from 'node:os' +import path from 'node:path' +import { realpathSync } from 'node:fs' +import { spawnSync } from 'node:child_process' +import { fileURLToPath } from 'node:url' +import { brotliCompressSync, gzipSync } from 'node:zlib' +import { afterEach, expect, test } from 'vitest' +import { Generator, getConfig } from '@tanstack/router-generator' +import { build } from 'vite' +import solid from 'vite-plugin-solid' + +type Framework = 'react' | 'solid' | 'vue' +const repository = fileURLToPath(new URL('../../../../', import.meta.url)) +const workspaces: Array = [] +const neutralEntry = `globalThis.__routeModuleBundleProbe = 'retained'` + +afterEach(async () => { + for (const workspace of workspaces.splice(0)) { + await fs.rm(workspace, { recursive: true, force: true }) + } +}) + +async function write(file: string, source: string) { + await fs.mkdir(path.dirname(file), { recursive: true }) + await fs.writeFile(file, source) +} + +async function link(root: string, name: string, target: string) { + const file = path.join(root, 'node_modules', name) + await fs.mkdir(path.dirname(file), { recursive: true }) + await fs.symlink(target, file, 'dir') +} + +async function fixtures(framework: Framework) { + const workspace = realpathSync( + await fs.mkdtemp(path.join(os.tmpdir(), 'route-module-bundles-')), + ) + workspaces.push(workspace) + // Third-party dependencies resolve exactly as in the installed workspace; + // framework imports below still go through their published package exports. + await fs.symlink( + path.join(repository, 'node_modules'), + path.join(workspace, 'node_modules'), + 'dir', + ) + const routerPackage = `@tanstack/${framework}-router` + const startPackage = `@tanstack/${framework}-start` + const dependency = path.join(workspace, 'dependency') + const provider = path.join(workspace, 'provider') + const host = path.join(workspace, 'host') + for (const [root, name, isModule] of [ + [dependency, '@bundle/dependency', true], + [provider, '@bundle/provider', true], + [host, '@bundle/host', false], + ] as const) { + await write( + path.join(root, 'package.json'), + JSON.stringify({ + name, + type: 'module', + dependencies: { + [routerPackage]: '*', + ...(root === provider + ? { [startPackage]: '*', '@bundle/dependency': '*' } + : {}), + ...(root === host + ? { '@bundle/provider': '*', '@bundle/dependency': '*' } + : {}), + }, + exports: { + './route-module': './src/routeModule.gen.ts', + './route-types': './src/routeContract.gen.ts', + }, + ...(isModule + ? { + tanstack: { + router: { + module: + root === provider ? { uses: ['@bundle/dependency'] } : true, + }, + }, + } + : {}), + }), + ) + await link( + root, + routerPackage, + path.join(repository, 'packages', `${framework}-router`), + ) + if (root === provider) { + await link( + root, + startPackage, + path.join(repository, 'packages', `${framework}-start`), + ) + } + await write( + path.join(root, 'src/routes/__root.tsx'), + isModule + ? `import { createModuleRoot } from '../routeScope.gen' +${root === provider ? "export type {} from '../requirements'" : ''} +export const Route = createModuleRoot()({})` + : `import { createRootRoute } from '${routerPackage}' +export const Route = createRootRoute()`, + ) + if (isModule) { + await write( + path.join(root, 'src/routes/page.tsx'), + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('${name}:/page')({})`, + ) + } + } + await link(provider, '@bundle/dependency', dependency) + await link(host, '@bundle/provider', provider) + await link(host, '@bundle/dependency', dependency) + await write( + path.join(provider, 'src/requirements.ts'), + `export type { StartModuleRequirements } from '${startPackage}' +declare module '${startPackage}' { + interface StartModuleRequirements { + '@bundle/provider': { requestContext: { requiredByBundleFixture: string } } + } +}`, + ) + for (const root of [dependency, provider, host]) { + const config = getConfig( + { + target: framework, + disableLogging: true, + tmpDir: path.join(workspace, '.tmp'), + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + ...(root === host + ? { + routeModules: { + includes: [ + { module: '@bundle/provider', at: '/provider' }, + { module: '@bundle/dependency', at: '/dependency' }, + ], + }, + } + : {}), + }, + root, + ) + await new Generator({ root, config }).run() + } + return { workspace, provider, host, routerPackage, startPackage } +} + +interface Bundle { + source: string + code: string + moduleIds: Array + raw: number + gzip: number + brotli: number +} + +async function bundle( + framework: Framework, + root: string, + name: string, + entry: string, +): Promise { + const directory = path.join(root, 'bundle-cases', name) + const input = path.join(directory, 'index.html') + await write(path.join(directory, 'entry.ts'), entry) + await write( + input, + '', + ) + const output: Array = [] + const moduleIds = new Set() + for (const minify of [false, true]) { + const result = await build({ + root: directory, + configFile: false, + mode: 'production', + plugins: framework === 'solid' ? [solid({ dev: false })] : [], + resolve: { + conditions: [ + ...(framework === 'solid' ? ['solid'] : []), + 'module', + 'browser', + 'production', + ], + }, + logLevel: 'silent', + define: { 'process.env.NODE_ENV': JSON.stringify('production') }, + build: { + write: false, + minify, + sourcemap: false, + rolldownOptions: { input }, + }, + }) + if (!('output' in result)) { + throw new Error('Expected a single application bundle') + } + for (const chunk of result.output) { + if (chunk.type === 'chunk') { + for (const id of Object.keys(chunk.modules)) { + moduleIds.add(id.replaceAll('\\', '/')) + } + } + } + output.push( + result.output + .filter((file) => file.type === 'chunk') + .map((file) => file.code) + .join('\n'), + ) + } + const code = output[1]! + return { + source: output[0]!, + code, + moduleIds: [...moduleIds], + raw: Buffer.byteLength(code), + gzip: gzipSync(code).byteLength, + brotli: brotliCompressSync(code).byteLength, + } +} + +// The scope APIs with a runtime binder (`bindRouteScope` of the +// framework's `_internal/route-module` entry). The others are the framework's +// own APIs, re-exported by the generated scope. +const scopedApis = [ + 'Link', + 'CreateLink', + 'LinkOptions', + 'Navigate', + 'UseNavigate', + 'Redirect', + 'MatchRoute', + 'UseMatchRoute', + 'UseRouter', + 'GetRouteApi', + 'UseMatch', + 'UseLoaderData', + 'UseLoaderDeps', + 'UseSearch', + 'UseParams', + 'UseRouteContext', + 'UseLinkProps', + 'NotFound', +] + +/** No binder but the one of `retained`, if any, survives in the bundle. */ +function expectIndependentApi(result: Bundle, retained?: string) { + for (const api of scopedApis) { + if (api !== retained) { + expect(result.source).not.toMatch( + new RegExp(`\\bfunction\\s+bindRouteScope${api}\\b`), + ) + } + } +} + +function sizes(bundle: Bundle) { + return { raw: bundle.raw, gzip: bundle.gzip, brotli: bundle.brotli } +} + +test.each(['react', 'solid', 'vue'] as const)( + '%s generated APIs and static namespaces discard unused initializers', + async (framework) => { + const { provider, host, routerPackage, startPackage } = + await fixtures(framework) + const own = JSON.stringify(path.join(provider, 'src/routeScope.gen.ts')) + const namespaces = JSON.stringify(path.join(host, 'src/routeScope.gen.ts')) + const results: Record> = {} + const measure = async (name: string, entry: string) => { + const result = await bundle(framework, provider, name, entry) + results[name] = sizes(result) + return result + } + const neutral = await measure('neutral', neutralEntry) + for (const [name, entry] of [ + ['unused-own-scope', `import ${own}; ${neutralEntry}`], + ['unused-namespaces', `import ${namespaces}; ${neutralEntry}`], + [ + 'type-only-validator', + `import type { ValidateLinkOptions } from ${own}; ${neutralEntry}`, + ], + [ + 'type-only-requirements', + `import ${JSON.stringify(path.join(provider, 'src/requirements.ts'))}; ${neutralEntry}`, + ], + ]) { + const result = await measure(name!, entry!) + expect(result.code).toBe(neutral.code) + } + + // Import the direct API first in both cases to stabilize bundler naming. + // The second reference proves the generated alias adds no runtime wrapper. + const directFactory = await measure( + 'framework-file-factory', + `import { createFileRoute } from '${routerPackage}'; globalThis.__routeModuleBundleProbe = [createFileRoute, createFileRoute]`, + ) + const scopedFactory = await measure( + 'generated-file-factory', + `import { createFileRoute } from '${routerPackage}'; import { createFileRoute as scoped } from ${own}; globalThis.__routeModuleBundleProbe = [createFileRoute, scoped]`, + ) + expectIndependentApi(scopedFactory) + expect(scopedFactory.source).not.toContain('@bundle/provider') + expect(sizes(scopedFactory)).toEqual(sizes(directFactory)) + const moduleRootFactory = await measure( + 'generated-module-root', + `import { createModuleRoot } from ${own}; globalThis.__routeModuleBundleProbe = createModuleRoot`, + ) + expectIndependentApi(moduleRootFactory) + expect(moduleRootFactory.source).not.toMatch( + /\bfunction\s+createFileRoute\b/, + ) + + const ownOptions = await measure( + 'own-link-options', + `import { linkOptions } from ${own}; globalThis.__routeModuleBundleProbe = linkOptions({ to: '/page' })`, + ) + const namespaceOptions = await measure( + 'namespace-link-options', + `import { provider } from ${namespaces}; globalThis.__routeModuleBundleProbe = provider.linkOptions({ to: '/page' })`, + ) + expectIndependentApi(ownOptions, 'LinkOptions') + expectIndependentApi(namespaceOptions, 'LinkOptions') + expect(sizes(namespaceOptions)).toEqual(sizes(ownOptions)) + + for (const [api, suffix] of [ + ['Link', 'Link'], + ['Navigate', 'Navigate'], + ['getRouteApi', 'GetRouteApi'], + ['useRouter', 'UseRouter'], + ['useLinkProps', 'UseLinkProps'], + ['useBlocker', 'UseBlocker'], + ['notFound', 'NotFound'], + ]) { + const result = await measure( + api!, + `import { ${api} } from ${own}; globalThis.__routeModuleBundleProbe = ${api}`, + ) + expectIndependentApi(result, suffix) + if (api === 'Link') { + // One-line binders can be inlined away; the Link binder stays and + // proves that the names the checks above look for are current. + expect(result.source).toMatch(/\bfunction\s+bindRouteScopeLink\b/) + } + if (framework === 'solid' && api === 'Link') { + // Real Solid applications select source exports and compile their JSX. + expect(result.moduleIds).toContain( + path + .join( + repository, + 'packages/solid-router/dist/source/routeModule.jsx', + ) + .replaceAll('\\', '/'), + ) + } + const namespace = await measure( + `namespace-${api}`, + `import { provider } from ${namespaces}; globalThis.__routeModuleBundleProbe = provider.${api}`, + ) + expectIndependentApi(namespace, suffix) + expect(sizes(namespace)).toEqual(sizes(result)) + } + for (const api of ['createServerFn', 'createMiddleware']) { + const direct = await measure( + `framework-${api}`, + `import { ${api} } from '${startPackage}'; globalThis.__routeModuleBundleProbe = [${api}, ${api}]`, + ) + const generated = await measure( + `generated-${api}`, + `import { ${api} } from '${startPackage}'; import { ${api} as scoped } from ${own}; globalThis.__routeModuleBundleProbe = [${api}, scoped]`, + ) + expectIndependentApi(generated) + expect(sizes(generated)).toEqual(sizes(direct)) + } + const fragmentFactory = await measure( + 'createStartModule', + `import { createStartModule } from ${own}; globalThis.__routeModuleBundleProbe = createStartModule`, + ) + expectIndependentApi(fragmentFactory) + expect(fragmentFactory.source).not.toContain('requiredByBundleFixture') + + // Keep real production-byte evidence in the test log for before/after + // comparison; assertion builds include all runtime dependencies, no externals. + console.info(JSON.stringify({ generatedApiBundles: framework, results })) + }, +) + +test.each(['react', 'solid', 'vue'] as const)( + '%s requirements augmentation emits declarations without runtime imports', + async (framework) => { + const { provider } = await fixtures(framework) + await write( + path.join(provider, 'tsconfig.requirements.json'), + JSON.stringify({ + compilerOptions: { + target: 'ES2022', + module: 'ESNext', + moduleResolution: 'Bundler', + strict: true, + skipLibCheck: false, + declaration: true, + rootDir: './src', + outDir: './emitted-requirements', + types: ['node'], + }, + files: ['src/requirements.ts'], + }), + ) + const result = spawnSync( + process.execPath, + [ + path.join(repository, 'node_modules/typescript59/lib/tsc.js'), + '--pretty', + 'false', + '-p', + path.join(provider, 'tsconfig.requirements.json'), + ], + { encoding: 'utf8' }, + ) + if (result.error) { + throw result.error + } + expect({ + status: result.status, + diagnostics: result.stdout + result.stderr, + }).toEqual({ status: 0, diagnostics: '' }) + expect( + ( + await fs.readFile( + path.join(provider, 'emitted-requirements/requirements.js'), + 'utf8', + ) + ).trim(), + ).toBe('export {};') + const declaration = await fs.readFile( + path.join(provider, 'emitted-requirements/requirements.d.ts'), + 'utf8', + ) + expect(declaration).toContain( + `declare module '@tanstack/${framework}-start'`, + ) + expect(declaration).toContain('requiredByBundleFixture') + }, +) diff --git a/e2e/react-router/route-modules/tests/generated-scope-cache.test.ts b/e2e/react-router/route-modules/tests/generated-scope-cache.test.ts new file mode 100644 index 0000000000..91244879b2 --- /dev/null +++ b/e2e/react-router/route-modules/tests/generated-scope-cache.test.ts @@ -0,0 +1,114 @@ +import { execFileSync } from 'node:child_process' +import { symlinkSync } from 'node:fs' +import { pathToFileURL } from 'node:url' +import { expect, test } from 'vitest' +import { build } from 'vite' +import { Workspace } from './workspace' + +test('a generated package named constructor gets a working scoped router', async () => { + const ws = new Workspace(['settings', 'web']) + try { + // A valid unscoped package name must work even when it is also a property + // of Object.prototype. Generate the provider and host exactly as packages do. + ws.edit('settings', 'package.json', (source) => { + const pkg = JSON.parse(source) + pkg.name = 'constructor' + return JSON.stringify(pkg) + }) + ws.remove('settings', 'src') + ws.write( + 'settings', + 'src/routes/__root.tsx', + `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({}) +`, + ) + ws.write( + 'settings', + 'src/routes/profile.tsx', + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('constructor:/profile')({}) +`, + ) + + ws.edit('web', 'package.json', (source) => { + const pkg = JSON.parse(source) + for (const dependency of Object.keys(pkg.dependencies)) { + if (dependency.startsWith('@route-modules/')) { + delete pkg.dependencies[dependency] + } + } + pkg.dependencies.constructor = 'workspace:*' + return JSON.stringify(pkg) + }) + symlinkSync( + ws.pkg('settings'), + ws.file('web', 'node_modules/constructor'), + 'dir', + ) + ws.remove('web', 'src') + ws.write( + 'web', + 'tsr.config.json', + JSON.stringify({ + routeModules: { + includes: [{ module: 'constructor', at: '/settings' }], + }, + }), + ) + ws.write( + 'web', + 'src/routes/__root.tsx', + `import { createRootRoute } from '@tanstack/react-router' +export const Route = createRootRoute() +`, + ) + ws.write( + 'web', + 'src/probe.tsx', + `import * as React from 'react' +import { renderToString } from 'react-dom/server' +import { RouterContextProvider, createMemoryHistory, createRouter } from '@tanstack/react-router' +import { useRouter } from 'constructor/scope' +import { routeTree } from './routeTree.gen' + +export async function render() { + const router = createRouter({ + routeTree, + history: createMemoryHistory({ initialEntries: ['/settings/profile'] }), + isServer: true, + }) + await router.load() + function Observer() { + return {useRouter().buildLocation({ to: '/profile' }).href} + } + return renderToString() +} +`, + ) + await ws.buildGraph(['settings', 'web'], ['settings']) + await build({ + root: ws.pkg('web'), + configFile: false, + logLevel: 'silent', + ssr: { noExternal: ['constructor'] }, + build: { + ssr: ws.file('web', 'src/probe.tsx'), + outDir: ws.file('web', 'dist'), + rolldownOptions: { output: { entryFileNames: 'probe.mjs' } }, + }, + }) + const output = execFileSync( + process.execPath, + [ + '--input-type=module', + '--eval', + `import { render } from ${JSON.stringify(pathToFileURL(ws.file('web', 'dist/probe.mjs')).href)}; console.log(JSON.stringify(await render()));`, + ], + { cwd: ws.pkg('web'), encoding: 'utf8' }, + ) + expect(JSON.parse(output)).toBe('/settings/profile') + } finally { + ws.dispose() + } +}) diff --git a/e2e/react-router/route-modules/tests/host-context-contracts.test.ts b/e2e/react-router/route-modules/tests/host-context-contracts.test.ts new file mode 100644 index 0000000000..bcf02dd04c --- /dev/null +++ b/e2e/react-router/route-modules/tests/host-context-contracts.test.ts @@ -0,0 +1,52 @@ +import { afterEach, expect, test } from 'vitest' +import { Workspace, errorsIn } from './workspace' + +let workspace: Workspace | undefined + +afterEach(() => { + workspace?.dispose() + workspace = undefined +}) + +test('generated mounts reject incompatible context and required host search', async () => { + const ws = (workspace = new Workspace()) + const modules = [ + 'products', + 'storefront', + 'account', + 'team', + 'settings', + 'billing', + ] + await ws.buildGraph([...modules, 'web'], modules) + const originalAuthentication = ws.read('web', 'src/routes/_authenticated.tsx') + ws.edit('web', 'src/routes/_authenticated.tsx', (source) => { + expect(source).toContain("user: { id: 'u-1' }") + return source.replace("user: { id: 'u-1' }", "user: 'invalid-context'") + }) + const incompatible = await ws.check('web') + expect(incompatible.ok).toBe(false) + expect( + errorsIn(incompatible.diagnostics, 'src/routeTree.gen.ts').join('\n'), + ).toMatch(/compatible types/) + + ws.write('web', 'src/routes/_authenticated.tsx', originalAuthentication) + const originalOrganization = ws.read('web', 'src/routes/orgs.$orgId.tsx') + ws.edit('web', 'src/routes/orgs.$orgId.tsx', (source) => { + expect(source).toContain(' beforeLoad:') + return source.replace( + ' beforeLoad:', + ' validateSearch: (search: { region: string }) => search,\n beforeLoad:', + ) + }) + const requiredSearch = await ws.check('web') + expect(requiredSearch.ok).toBe(false) + expect( + errorsIn(requiredSearch.diagnostics, 'src/routeTree.gen.ts').join('\n'), + ).toMatch(/requires search params/) + + ws.write('web', 'src/routes/orgs.$orgId.tsx', originalOrganization) + const valid = await ws.check('web') + expect(valid.diagnostics).toEqual([]) + expect(valid.ok).toBe(true) +}) diff --git a/e2e/react-router/route-modules/tests/host-parameter-contracts.test.ts b/e2e/react-router/route-modules/tests/host-parameter-contracts.test.ts new file mode 100644 index 0000000000..855d7f6789 --- /dev/null +++ b/e2e/react-router/route-modules/tests/host-parameter-contracts.test.ts @@ -0,0 +1,73 @@ +import { afterEach, expect, test } from 'vitest' +import { Workspace, errorsIn } from './workspace' + +let workspace: Workspace | undefined + +afterEach(() => { + workspace?.dispose() + workspace = undefined +}) + +test('generated mounts reject a parsed host key overwritten by module descendants', async () => { + const ws = (workspace = new Workspace()) + ws.write( + 'settings', + 'src/routes/members.$memberId.tsx', + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/settings:/members/$memberId')({ + loader: ({ params }) => ({ member: params.memberId }), +}) +`, + ) + ws.edit('web', 'src/routes/orgs.$orgId.tsx', (source) => { + expect(source).toContain(' beforeLoad:') + return source.replace( + ' beforeLoad:', + ` params: { + parse: ({ orgId }) => ({ orgId, memberId: 'host-member' }), + stringify: ({ orgId }) => ({ orgId }), + }, + beforeLoad:`, + ) + }) + const modules = [ + 'products', + 'storefront', + 'account', + 'team', + 'settings', + 'billing', + ] + await ws.buildGraph([...modules, 'web'], modules) + const collision = await ws.check('web') + expect(collision.ok).toBe(false) + expect( + errorsIn(collision.diagnostics, 'src/routeTree.gen.ts').join('\n'), + ).toMatch(/memberId/) + + // A distinct parsed host key is valid. Type changes need only the normal + // consumer recheck; the route topology and generated mount are unchanged. + ws.edit('web', 'src/routes/orgs.$orgId.tsx', (source) => + source.replace( + "memberId: 'host-member'", + "organizationMemberId: 'host-member'", + ), + ) + for (const file of ['src/routes/__root.tsx', 'src/routes/index.tsx']) { + ws.edit('web', file, (source) => + source.replaceAll( + /(params=\{\{ orgId: '[^']+') \}\}/g, + "$1, organizationMemberId: 'host-member' }}", + ), + ) + } + ws.edit('web', 'src/profile-links.tsx', (source) => + source.replace( + "params: { orgId: 'acme' }", + "params: { orgId: 'acme', organizationMemberId: 'host-member' }", + ), + ) + const valid = await ws.check('web') + expect(valid.diagnostics).toEqual([]) + expect(valid.ok).toBe(true) +}) diff --git a/e2e/react-router/route-modules/tests/route-modules.test.ts b/e2e/react-router/route-modules/tests/route-modules.test.ts new file mode 100644 index 0000000000..84dc5083f4 --- /dev/null +++ b/e2e/react-router/route-modules/tests/route-modules.test.ts @@ -0,0 +1,528 @@ +import path from 'node:path' +import { afterEach, beforeEach, describe, expect, test } from 'vitest' +import { Workspace, errorsIn, expectChecksPass } from './workspace' + +/** + * The fixture is a diamond with links in both directions: + * + * web ──► storefront ──► products (storefront mounts products, + * └────► account ◄────► products products links back to its cart; + * account and products link to each other) + * + * and modules web mounts below `/orgs/$orgId`, one of them twice: + * + * web ──► team + * ├────► settings (also below `/people/$personId`) + * └────► billing ─────► team (billing only links to team + * └───► settings and to the settings of its org) + * + * Every test copies the packages into a temporary workspace and drives the + * route generation through public APIs, followed by ordinary TypeScript + * declaration builds and source checks. JavaScript is never built. + */ +const order = [ + 'products', + 'storefront', + 'account', + 'team', + 'settings', + 'billing', + 'web', +] +const modules = [ + 'products', + 'storefront', + 'account', + 'team', + 'settings', + 'billing', +] + +let ws: Workspace + +beforeEach(() => { + ws = new Workspace() +}) + +afterEach(() => { + ws.dispose() +}) + +const renamedProductRoute = `import { createFileRoute } from '../routeScope.gen' +import { productSearchSchema } from '../schemas' + +export const Route = createFileRoute('@route-modules/products:/$sku')({ + validateSearch: productSearchSchema, + loader: ({ params, context }) => context.productsApi.getProduct(params.sku), + component: ProductPage, +}) + +function ProductPage() { + const product = Route.useLoaderData() + return

{product.name}

+} +` + +const brandsRoute = `import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@route-modules/products:/brands')({ + component: () =>

Brands

, +}) +` + +describe('clean checkout', () => { + test('generates, emits and checks the diamond from nothing', async () => { + for (const name of order) { + expect(ws.exists(name, 'src/routeTree.gen.ts')).toBe(false) + expect(ws.exists(name, '.tanstack')).toBe(false) + } + + await ws.buildGraph(order, modules) + await expectChecksPass(ws, ...order) + }) + + test('a module checks standalone, without any application', async () => { + const standalone = new Workspace(['products', 'account']) + try { + await standalone.buildGraph( + ['products', 'account'], + ['products', 'account'], + ) + const result = await standalone.check('account') + expect(result.diagnostics).toEqual([]) + } finally { + standalone.dispose() + } + }) + + test.each([ + // Module files are type-checked: the default header loses `@ts-nocheck`, + // which the runtime-only client view keeps. + { + name: 'default', + header: undefined, + tree: ['/* eslint-disable */', '// noinspection JSUnusedGlobalSymbols'], + clientTree: [ + '/* eslint-disable */', + '// @ts-nocheck', + '// noinspection JSUnusedGlobalSymbols', + ], + }, + { + name: 'custom', + header: ['// Package license header'], + tree: ['// Package license header'], + clientTree: ['// Package license header', '// @ts-nocheck'], + }, + { name: 'empty', header: [], tree: [], clientTree: ['// @ts-nocheck'] }, + ])( + 'emits portable client-view declarations with a $name header', + async ({ header, tree, clientTree }) => { + // products links into account: its source check reads account's + // contract (its declaration build does not). + await ws.generate('account') + expect((await ws.emitTypes('account')).ok).toBe(true) + for (const name of ['products', 'storefront']) { + if (header !== undefined) { + ws.write( + name, + 'tsr.config.json', + JSON.stringify({ routeTreeFileHeader: header }), + ) + } + await ws.generate(name) + const lines = (file: string) => + ws + .read(name, file) + .split('\n') + .filter((line) => line.startsWith('/')) + expect(lines('src/routeTree.gen.ts').slice(0, tree.length)).toEqual( + tree, + ) + expect( + lines('src/routeTree.gen.client.ts').slice(0, clientTree.length), + ).toEqual(clientTree) + // Both packages use an ordinary src-inclusive declaration build. The + // storefront's client view also references a mounted module's tree. + const emitted = await ws.emitTypes(name) + expect(emitted.diagnostics, `declarations of ${name}`).toEqual([]) + expect(emitted.ok).toBe(true) + expect( + ws.exists(name, '.tanstack/types/src/routeTree.gen.client.d.ts'), + ).toBe(true) + } + await expectChecksPass(ws, 'products', 'storefront') + }, + ) +}) + +describe('published declaration updates', () => { + test('a provider param rename reaches consumers through unchanged intermediate declarations', async () => { + await ws.buildGraph(order, modules) + const storefrontDeclarations = ws.snapshot('storefront', '.tanstack/types') + const storefrontSources = ws.snapshot('storefront', 'src') + const logBefore = ws.log.length + + // Rename the product route param: products updates its own links, + // regenerates and re-emits. + ws.remove('products', 'src/routes/$productId.tsx') + ws.write('products', 'src/routes/$sku.tsx', renamedProductRoute) + ws.edit('products', 'src/routes/index.tsx', (source) => + source + .replace('to="/$productId"', 'to="/$sku"') + .replace('{ productId: product.id }', '{ sku: product.id }'), + ) + ws.edit('products', 'src/routes/legacy.tsx', (source) => + source + .replace("to: '/$productId'", "to: '/$sku'") + .replace("productId: '42'", "sku: '42'"), + ) + await ws.generate('products') + expect((await ws.emitTypes('products')).ok).toBe(true) + + // Consumers only recheck their source. + const account = await ws.check('account') + expect(account.ok).toBe(false) + expect(errorsIn(account.diagnostics, 'src/routes/index.tsx')).not.toEqual( + [], + ) + expect( + errorsIn(account.diagnostics, 'src/routes/orders.$orderId.tsx'), + ).not.toEqual([]) + + // The application reaches products only through storefront's contract, + // whose declarations were neither regenerated nor re-emitted. + const web = await ws.check('web') + expect(web.ok).toBe(false) + expect( + errorsIn(web.diagnostics, 'src/routes/index.tsx').join('\n'), + ).toMatch(/productId|\$productId/) + expect(ws.snapshot('storefront', '.tanstack/types')).toEqual( + storefrontDeclarations, + ) + expect(ws.snapshot('storefront', 'src')).toEqual(storefrontSources) + expect( + ws.log + .slice(logBefore) + .filter((entry) => entry.pkg !== 'products') + .map((entry) => entry.operation), + ).toEqual(['check', 'check']) + + // Updating the consumer links makes the graph valid again. + ws.edit('account', 'src/routes/index.tsx', (source) => + source + .replace('to="/$productId"', 'to="/$sku"') + .replace("{ productId: 'last-viewed' }", "{ sku: 'last-viewed' }"), + ) + ws.edit('account', 'src/routes/orders.$orderId.tsx', (source) => + source + .replace( + "'@route-modules/products:/$productId'", + "'@route-modules/products:/$sku'", + ) + .replace("to: '/$productId'", "to: '/$sku'") + .replace('{ productId: order.productId }', '{ sku: order.productId }'), + ) + ws.edit('storefront', 'src/routes/index.tsx', (source) => + source + .replace('to="/$productId"', 'to="/$sku"') + .replace("{ productId: 'featured' }", "{ sku: 'featured' }"), + ) + ws.edit('web', 'src/routes/index.tsx', (source) => + source + .replace( + "'@route-modules/products:/$productId'", + "'@route-modules/products:/$sku'", + ) + .replace('to="/$productId"', 'to="/$sku"') + .replace("{ productId: 'home-pick' }", "{ sku: 'home-pick' }"), + ) + await expectChecksPass(ws, 'account', 'storefront', 'web') + }) + + test('route generation does not depend on declaration emits', async () => { + // Task runners cache generation by its inputs: emitting must not change + // what the next generation writes. + await ws.generate('products') + const manifest = ws.read('products', '.tanstack/route-module.json') + expect((await ws.emitTypes('products')).ok).toBe(true) + await ws.generate('products') + expect(ws.read('products', '.tanstack/route-module.json')).toBe(manifest) + }) + + test('a schema-only edit refreshes types without changing the topology', async () => { + await ws.buildGraph(order, modules) + const routeTree = ws.read('products', 'src/routeTree.gen.ts') + const { topologyToken } = ws.manifest('products') + + // `tab` becomes a required search param; products updates its own link. + ws.edit('products', 'src/schemas.ts', (source) => + source.replace(".default('specs')", ''), + ) + ws.edit('products', 'src/routes/index.tsx', (source) => + source.replace( + 'params={{ productId: product.id }}', + "params={{ productId: product.id }}\n search={{ tab: 'specs' }}", + ), + ) + await ws.generate('products') + expect(ws.read('products', 'src/routeTree.gen.ts')).toBe(routeTree) + expect(ws.manifest('products').topologyToken).toBe(topologyToken) + expect((await ws.emitTypes('products')).ok).toBe(true) + + // Navigations without `tab` now fail; the account link passes `tab`. + const web = await ws.check('web') + expect(errorsIn(web.diagnostics, 'src/routes/index.tsx')).not.toEqual([]) + const storefront = await ws.check('storefront') + expect( + errorsIn(storefront.diagnostics, 'src/routes/index.tsx'), + ).not.toEqual([]) + const account = await ws.check('account') + expect(errorsIn(account.diagnostics, 'src/routes/index.tsx')).toEqual([]) + expect( + errorsIn(account.diagnostics, 'src/routes/orders.$orderId.tsx').join( + '\n', + ), + ).toMatch(/search/) + }) + + test('a deleted provider route fails the obsolete consumer link', async () => { + await ws.buildGraph(order, modules) + + ws.remove('products', 'src/routes/compare.tsx') + await ws.generate('products') + expect( + ws.manifest('products').routes.map((route) => route.id), + ).not.toContain('@route-modules/products:/compare') + expect((await ws.emitTypes('products')).ok).toBe(true) + + const storefront = await ws.check('storefront') + expect(storefront.ok).toBe(false) + expect( + errorsIn(storefront.diagnostics, 'src/routes/index.tsx').join('\n'), + ).toMatch(/compare/) + }) + + test('a new provider route becomes visible to consumers', async () => { + await ws.buildGraph(order, modules) + ws.edit('web', 'src/routes/index.tsx', (source) => + source.replace( + '', + 'Brands\n ', + ), + ) + expect((await ws.check('web')).ok).toBe(false) + + ws.write('products', 'src/routes/brands.tsx', brandsRoute) + await ws.generate('products') + expect((await ws.emitTypes('products')).ok).toBe(true) + await expectChecksPass(ws, 'web') + }) +}) + +describe('the declaration boundary', () => { + test('consumers load provider declarations, never provider sources', async () => { + await ws.buildGraph(order, modules) + const files = ws.listProgramFiles('account') + expect( + files.some((file) => file.includes('/products/.tanstack/types/')), + ).toBe(true) + expect(files.some((file) => file.includes('/products/src/'))).toBe(false) + }) + + test('consumers check against declarations only, without library skipping', async () => { + await ws.buildGraph(order, modules) + ws.remove('products', 'src') + ws.edit('account', 'tsconfig.json', (source) => + source.replace('"skipLibCheck": true', '"skipLibCheck": false'), + ) + await expectChecksPass(ws, 'account') + + // A missing declaration fails instead of falling back to sources. + ws.remove('products', '.tanstack/types/src/api.d.ts') + const result = await ws.check('account') + expect(result.ok).toBe(false) + expect(result.diagnostics.join('\n')).toMatch(/\.\/api/) + }) + + test('module types stay precise across the boundary', async () => { + await ws.buildGraph(order, modules) + ws.write( + 'account', + 'src/type-assertions.tsx', + `import { Route as AccountIndexRoute } from './routes/index' +import { products } from './routeScope.gen' +import type { Price, Product } from '@route-modules/products/api' + +type Equal = + (() => T extends A ? 1 : 2) extends () => T extends B ? 1 : 2 + ? true + : false +type IsAny = 0 extends 1 & T ? true : false + +// A used module's routes are addressed through its namespace. +const productApi = products.getRouteApi('@route-modules/products:/$productId') + +export function useAssertions() { + const product = productApi.useLoaderData() + const loaderData: Equal = true + const notAny: IsAny = false + const brand: Equal = true + + // Validated search output: \`tab\` has a default, so it is always set. + const search = productApi.useSearch() + const output: Equal = true + + // Context the module root requires from its host. + const context = AccountIndexRoute.useRouteContext() + const user: Equal = true + + return [loaderData, notAny, brand, output, user] +} + +export const links = ( + <> + {/* Navigation input: \`tab\` is optional. */} + + + {/* @ts-expect-error a required search input is missing */} + + + {/* Nested routing survives the boundary. */} + + + + + {/* @ts-expect-error pathless layout segments are not part of paths */} + + {/* @ts-expect-error unknown module-local path */} + + +) +`, + ) + await expectChecksPass(ws, 'account') + }) + + test('declaration maps lead to the module sources from any output directory', async () => { + ws.edit('products', 'tsconfig.route-types.json', (source) => + source.replace('".tanstack/types"', '"route-types"'), + ) + ws.edit('products', 'package.json', (source) => + source.replaceAll('./.tanstack/types/', './route-types/'), + ) + await ws.buildGraph(order, modules) + await expectChecksPass(ws, 'account') + + const map = 'route-types/src/routes/$productId.d.ts.map' + const { sources } = JSON.parse(ws.read('products', map)) + expect(sources).toHaveLength(1) + expect( + path.resolve(path.dirname(ws.file('products', map)), sources[0]), + ).toBe(ws.file('products', 'src/routes/$productId.tsx')) + }) +}) + +describe('composition', () => { + test('a missing provider fails the application generation', async () => { + await ws.buildGraph(modules, modules) + ws.edit('web', 'tsr.config.json', (source) => + source.replace( + '{ "module": "@route-modules/storefront", "at": "/shop" },', + '', + ), + ) + await expect(ws.generate('web')).rejects.toThrow( + /uses routes of "@route-modules\/products", which is not installed/, + ) + }) + + test('a host route without the required context fails the check', async () => { + await ws.buildGraph(modules, modules) + // Mount account at the root, which provides no `user`. + ws.edit('web', 'tsr.config.json', (source) => + source.replace('"parent": "/_authenticated",', ''), + ) + ws.remove('web', 'src/routes/_authenticated.tsx') + await ws.generate('web') + const result = await ws.check('web') + expect(result.ok).toBe(false) + expect( + errorsIn(result.diagnostics, 'src/routeTree.gen.ts').join('\n'), + ).toMatch(/requires router context 'user'/) + }) + + test('mounting a module twice is rejected', async () => { + await ws.buildGraph(modules, modules) + ws.edit('web', 'tsr.config.json', (source) => + source.replace( + '"includes": [', + '"includes": [\n { "module": "@route-modules/products", "at": "/p" },', + ), + ) + await expect(ws.generate('web')).rejects.toThrow(/installed twice/) + }) + + test('a mount path with path params is rejected', async () => { + await ws.buildGraph(modules, modules) + ws.edit('web', 'tsr.config.json', (source) => + source.replace('"at": "/shop"', '"at": "/$tenant"'), + ) + await expect(ws.generate('web')).rejects.toThrow(/static path/) + }) + + test('two applications compose the same modules independently', async () => { + ws.addPackage('admin', 'web') + ws.edit('admin', 'package.json', (source) => + source.replace('@route-modules/web', '@route-modules/admin'), + ) + ws.edit('admin', 'tsr.config.json', (source) => + source.replace('"at": "/shop"', '"at": "/store"'), + ) + await ws.buildGraph([...order, 'admin'], modules) + await expectChecksPass(ws, 'web', 'admin') + + const productsDeclarations = Object.keys( + ws.snapshot('products', '.tanstack/types'), + ) + .map((file) => ws.read('products', `.tanstack/types/${file}`)) + .join('\n') + expect(productsDeclarations).not.toMatch(/@route-modules\/(web|admin)/) + expect(productsDeclarations).not.toMatch(/interface Register\b/) + }) +}) + +describe('mounting under path params', () => { + test('the application passes the path params above a module it mounts', async () => { + await ws.buildGraph(order, modules) + ws.edit('web', 'src/routes/index.tsx', (source) => + source.replace(" params={{ orgId: 'acme' }}", ''), + ) + + const web = await ws.check('web') + // `/` has no params of its own: the host params make them required. + expect( + errorsIn(web.diagnostics, 'src/routes/index.tsx').join('\n'), + ).toMatch(/'params' is missing.*@route-modules\/team/) + }) + + test('a module that links into a module under path params is mounted below them', async () => { + await ws.buildGraph(order, modules) + ws.edit('web', 'tsr.config.json', (source) => + source.replace( + `"module": "@route-modules/billing", + "parent": "/orgs/$orgId",`, + '"module": "@route-modules/billing",', + ), + ) + + await expect(ws.generate('web')).rejects.toThrow( + '"@route-modules/billing" links into "@route-modules/team", which is mounted below "/orgs/$orgId", but "@route-modules/billing" is mounted at "/billing"', + ) + }) +}) diff --git a/e2e/react-router/route-modules/tests/workspace.ts b/e2e/react-router/route-modules/tests/workspace.ts new file mode 100644 index 0000000000..0d2c2ce3f5 --- /dev/null +++ b/e2e/react-router/route-modules/tests/workspace.ts @@ -0,0 +1,345 @@ +import path from 'node:path' +import os from 'node:os' +import crypto from 'node:crypto' +import type { Stats } from 'node:fs' +import { expect } from 'vitest' +import { spawnSync } from 'node:child_process' +import { + existsSync, + mkdirSync, + readFileSync, + readdirSync, + realpathSync, + rmSync, + statSync, + symlinkSync, + writeFileSync, +} from 'node:fs' +import { cpSync } from 'node:fs' +import { fileURLToPath } from 'node:url' +import { + Generator, + getConfig, + readRouteModuleManifest, +} from '@tanstack/router-generator' +import type { RouteModuleManifest } from '@tanstack/router-generator' + +const here = path.dirname(fileURLToPath(import.meta.url)) +const fixtureRoot = path.resolve(here, '../packages') +const repoRoot = path.resolve(here, '../../../..') +/** The repository's TypeScript compiler (`tsc` of `@typescript/native`). */ +export const tsc = path.join(repoRoot, 'node_modules', '.bin', 'tsc') + +const workspaceScope = '@route-modules/' +const generatedFile = /\.gen(?:\.[^.]+)?\.tsx?$/ + +export type Operation = 'generate' | 'emit-types' | 'check' + +export interface LoggedOperation { + operation: Operation + pkg: string + ok: boolean +} + +function listDependencies(nodeModules: string): Array { + if (!existsSync(nodeModules)) { + return [] + } + const entries: Array = [] + for (const entry of readdirSync(nodeModules)) { + if (entry.startsWith('.')) { + continue + } + if (entry.startsWith('@')) { + for (const scoped of readdirSync(path.join(nodeModules, entry))) { + entries.push(`${entry}/${scoped}`) + } + } else { + entries.push(entry) + } + } + return entries +} + +/** + * A copy of the fixture packages in a temporary directory. Workspace route + * modules are linked to their copies; every other dependency is linked to the + * package the repository installed, so the copy resolves like the original. + * Nothing generated or built is copied: every test starts from a clean + * checkout. + */ +export class Workspace { + readonly root: string + readonly log: Array = [] + + constructor( + packages: Array = [ + 'products', + 'storefront', + 'account', + 'team', + 'settings', + 'billing', + 'web', + ], + ) { + this.root = realpathSync( + require_mkdtemp(path.join(os.tmpdir(), 'tsr-route-modules-')), + ) + for (const name of packages) { + this.addPackage(name, name) + } + } + + /** Copies fixture package `source` as `name` into the workspace. */ + addPackage(name: string, source: string) { + const from = path.join(fixtureRoot, source) + const to = this.pkg(name) + cpSync(from, to, { + recursive: true, + filter: (file) => + !file.includes(`${path.sep}node_modules`) && + !file.includes(`${path.sep}.tanstack`) && + !file.includes(`${path.sep}dist`) && + !generatedFile.test(file), + }) + for (const dependency of listDependencies( + path.join(from, 'node_modules'), + )) { + const link = path.join(to, 'node_modules', dependency) + mkdirSync(path.dirname(link), { recursive: true }) + const target = dependency.startsWith(workspaceScope) + ? this.pkg(dependency.slice(workspaceScope.length)) + : realpathSync(path.join(from, 'node_modules', dependency)) + symlinkSync(target, link, 'dir') + } + } + + pkg(name: string) { + return path.join(this.root, name) + } + + file(name: string, file: string) { + return path.join(this.pkg(name), file) + } + + read(name: string, file: string) { + return readFileSync(this.file(name, file), 'utf8') + } + + write(name: string, file: string, content: string) { + mkdirSync(path.dirname(this.file(name, file)), { recursive: true }) + writeFileSync(this.file(name, file), content) + } + + edit(name: string, file: string, edit: (content: string) => string) { + const before = this.read(name, file) + const after = edit(before) + if (after === before) { + throw new Error(`The edit of ${name}/${file} changed nothing`) + } + this.write(name, file, after) + } + + remove(name: string, file: string) { + rmSync(this.file(name, file), { recursive: true, force: true }) + } + + exists(name: string, file: string) { + return existsSync(this.file(name, file)) + } + + /** Pass A: route generation of one package. */ + async generate(name: string) { + const packageRoot = this.pkg(name) + const config = getConfig( + { disableLogging: true, tmpDir: path.join(this.root, '.tmp') }, + packageRoot, + ) + try { + await new Generator({ config, root: packageRoot }).run() + this.log.push({ operation: 'generate', pkg: name, ok: true }) + } catch (error) { + this.log.push({ operation: 'generate', pkg: name, ok: false }) + throw error + } + } + + /** + * The fixture package's ordinary clean TypeScript declaration build, with + * its `tsconfig.route-types.json`. + */ + async emitTypes(name: string, projectFile = 'tsconfig.route-types.json') { + const project = JSON.parse(this.read(name, projectFile)) + this.remove( + name, + project.compilerOptions.declarationDir ?? project.compilerOptions.outDir, + ) + const result = this.compile(name, ['-p', projectFile]) + this.log.push({ operation: 'emit-types', pkg: name, ok: result.ok }) + return result + } + + /** + * The declaration build against the real contracts of the used modules, + * without the generated stand-ins: every used module must have emitted. + */ + async emitTypesAgainstContracts(name: string) { + this.write( + name, + 'tsconfig.route-types.contracts.json', + JSON.stringify({ + extends: './tsconfig.route-types.json', + compilerOptions: { outDir: '.tanstack/types' }, + include: ['src'], + }), + ) + return this.emitTypes(name, 'tsconfig.route-types.contracts.json') + } + + /** Source check of one package against current module declarations. */ + async check(name: string) { + const result = this.compile(name, ['-p', 'tsconfig.json', '--noEmit']) + this.log.push({ operation: 'check', pkg: name, ok: result.ok }) + return result + } + + /** Generates, emits and checks every package in dependency order. */ + async buildGraph(order: Array, modules: Array) { + for (const name of order) { + await this.generate(name) + if (modules.includes(name)) { + const emitted = await this.emitTypes(name) + if (!emitted.ok) { + throw new Error(emitted.diagnostics.join('\n')) + } + } + } + } + + manifest(name: string): RouteModuleManifest { + return readRouteModuleManifest(this.pkg(name))! + } + + private compile(name: string, args: Array) { + const result = spawnSync(tsc, [...args, '--pretty', 'false'], { + cwd: this.pkg(name), + encoding: 'utf8', + }) + return { + ok: result.status === 0, + diagnostics: result.error + ? [result.error.message] + : `${result.stdout ?? ''}${result.stderr ?? ''}` + .split(/\r?\n/) + .filter((line) => line.trim() !== ''), + } + } + + /** Content hash and modification time of every file below `dir`. */ + /** Content hash and mtime of every file below `dir`: unchanged files keep both. */ + snapshot(name: string, dir: string): Record { + return this.walk(name, dir, (file, stat) => `${hash(file)}@${stat.mtimeMs}`) + } + + /** Content hash of every file below `dir`, independent of mtimes. */ + hashes(name: string, dir: string): Record { + return this.walk(name, dir, (file) => hash(file)) + } + + private walk( + name: string, + dir: string, + stamp: (file: string, stat: Stats) => string, + ): Record { + const base = this.file(name, dir) + const result: Record = {} + const visit = (current: string) => { + for (const entry of readdirSync(current)) { + const full = path.join(current, entry) + const stat = statSync(full) + if (stat.isDirectory()) { + visit(full) + } else { + result[path.relative(base, full)] = stamp(full, stat) + } + } + } + if (existsSync(base)) { + visit(base) + } + return result + } + + /** The files a package's type check loads (`tsc --listFilesOnly`). */ + listProgramFiles(name: string): Array { + const result = spawnSync(tsc, ['-p', 'tsconfig.json', '--listFilesOnly'], { + cwd: this.pkg(name), + encoding: 'utf8', + }) + return result.stdout.split(/\r?\n/).filter(Boolean) + } + + dispose() { + rmSync(this.root, { recursive: true, force: true }) + } +} + +function require_mkdtemp(prefix: string) { + // `fs.mkdtempSync` without importing the whole promises API. + const dir = `${prefix}${crypto.randomBytes(4).toString('hex')}` + mkdirSync(dir, { recursive: true }) + return dir +} + +/** + * The diagnostics of a failed check that point into `file`, each with its + * indented continuation lines (where elaborated messages appear). + */ +export function errorsIn(diagnostics: Array, file: string) { + const errors: Array = [] + let current: string | undefined + for (const line of diagnostics) { + if (/^\s/.test(line)) { + if (current !== undefined) { + current += `\n${line}` + } + continue + } + if (current !== undefined) { + errors.push(current) + } + current = + line.startsWith(file) || line.includes(`/${file}(`) ? line : undefined + } + if (current !== undefined) { + errors.push(current) + } + return errors +} + +function hash(file: string) { + return crypto + .createHash('sha256') + .update(readFileSync(file)) + .digest('hex') + .slice(0, 12) +} + +/** Every named package checks without diagnostics. */ +export async function expectChecksPass(ws: Workspace, ...names: Array) { + for (const name of names) { + const result = await ws.check(name) + expect(result.diagnostics, `check of ${name}`).toEqual([]) + expect(result.ok).toBe(true) + } +} + +/** Every named package emits its declarations without diagnostics. */ +export async function expectEmitsPass(ws: Workspace, ...names: Array) { + for (const name of names) { + const result = await ws.emitTypes(name) + expect(result.diagnostics, `declarations of ${name}`).toEqual([]) + expect(result.ok).toBe(true) + } +} diff --git a/e2e/react-router/route-modules/tsconfig.json b/e2e/react-router/route-modules/tsconfig.json new file mode 100644 index 0000000000..341902faed --- /dev/null +++ b/e2e/react-router/route-modules/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "strict": true, + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "skipLibCheck": true, + "noEmit": true, + "types": ["node"] + }, + "include": [ + "tests", + "e2e", + "e2e-dev", + "scripts", + "vitest.config.ts", + "playwright.config.ts", + "playwright.dev.config.ts" + ] +} diff --git a/e2e/react-router/route-modules/vitest.config.ts b/e2e/react-router/route-modules/vitest.config.ts new file mode 100644 index 0000000000..b8e3ec784a --- /dev/null +++ b/e2e/react-router/route-modules/vitest.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + include: ['tests/**/*.test.ts', 'packages/web/tests/**/*.test.tsx'], + // Each test runs the generator and the TypeScript compiler on a workspace. + testTimeout: 120_000, + hookTimeout: 120_000, + fileParallelism: false, + }, +}) diff --git a/e2e/react-start/route-modules/.gitignore b/e2e/react-start/route-modules/.gitignore new file mode 100644 index 0000000000..92efdd2694 --- /dev/null +++ b/e2e/react-start/route-modules/.gitignore @@ -0,0 +1,9 @@ +# Generated by the route generator and TypeScript; the tests generate +# them from a clean copy of the packages. +**/routeTree.gen.ts +**/routeScope.gen.ts +**/routeContract.gen.ts +**/routeModule.gen.ts +**/startModules.gen.ts +**/routeScope.gen.*.ts +**/routeTree.gen.*.ts diff --git a/e2e/react-start/route-modules/e2e-dev/devtools.spec.ts b/e2e/react-start/route-modules/e2e-dev/devtools.spec.ts new file mode 100644 index 0000000000..59ebbb9ecd --- /dev/null +++ b/e2e/react-start/route-modules/e2e-dev/devtools.spec.ts @@ -0,0 +1,50 @@ +import { expect, test } from '@playwright/test' + +test('the router devtools group the routes of mounted modules', async ({ + page, +}) => { + await page.goto('/shop/lamp') + await page.getByTestId('hydrated').waitFor() + await page + .getByRole('button', { name: 'Open TanStack Router Devtools' }) + .click() + + await expect( + page.getByRole('group', { + name: 'Route module @start-route-modules/catalog', + }), + ).toBeVisible() + await expect( + page.getByRole('group', { + name: 'Route module @start-route-modules/notes', + }), + ).toBeVisible() + + await page + .getByRole('button', { + name: 'Open module details for @start-route-modules/catalog', + }) + .first() + .click() + const details = page.getByRole('region', { name: 'Module details' }) + await expect(details).toContainText('Mount path:/shop') + await expect(details).toContainText('Parent module:Application') +}) + +test('the router devtools show each installation of a module installed twice', async ({ + page, +}) => { + await page.goto('/people/ada/settings') + await page.getByTestId('hydrated').waitFor() + await page + .getByRole('button', { name: 'Open TanStack Router Devtools' }) + .click() + + for (const installation of ['orgSettings', 'personSettings']) { + await expect( + page.getByRole('group', { + name: `Route module @start-route-modules/settings#${installation}`, + }), + ).toBeVisible() + } +}) diff --git a/e2e/react-start/route-modules/e2e-dev/hmr.spec.ts b/e2e/react-start/route-modules/e2e-dev/hmr.spec.ts new file mode 100644 index 0000000000..0d4df29277 --- /dev/null +++ b/e2e/react-start/route-modules/e2e-dev/hmr.spec.ts @@ -0,0 +1,169 @@ +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { expect } from '@playwright/test' +import { createHmrFileEditor, test } from '@tanstack/router-e2e-utils' +import { Generator, getConfig } from '@tanstack/router-generator' +import type { Page } from '@playwright/test' + +const catalog = path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + '../packages/catalog', +) + +const editor = createHmrFileEditor({ + rootDir: catalog, + files: { + product: 'src/routes/$productId.tsx', + api: 'src/api.ts', + index: 'src/routes/index.tsx', + }, +}) +const settingsEditor = createHmrFileEditor({ + rootDir: path.resolve(catalog, '../settings'), + files: { + profile: 'src/routes/profile.tsx', + }, +}) + +test.afterEach(async () => { + await editor.restoreFiles() + await settingsEditor.restoreFiles() +}) + +// The server-rendered page shows the product before the browser has loaded +// the route module. Edit only after hydration: an edit before it is served to +// the hydrating browser, which then mismatches the server's HTML instead of +// receiving a hot update. +async function gotoHydrated(page: Page, url: string) { + await page.goto(url) + await page.getByTestId('hydrated').waitFor() +} + +test('editing a module route file hot-updates it in the application', async ({ + page, +}) => { + await gotoHydrated(page, '/shop/lamp') + await expect(page.getByRole('heading', { name: 'Desk lamp' })).toBeVisible() + await page.evaluate(() => { + ;(window as any).__beforeHmr = true + }) + + await editor.replaceText( + 'product', + '

{product.name}

', + '

Updated {product.name}

', + ) + await expect( + page.getByRole('heading', { name: 'Updated Desk lamp' }), + ).toBeVisible() + // A hot update, not a reload: page state survives. + expect(await page.evaluate(() => (window as any).__beforeHmr)).toBe(true) + + // Restore while the page is open. Server rendering reads the file again, + // but the browser gets the client's compiled module until Vite processes + // the change; the hot update shows it has, so the next page load hydrates. + await editor.restoreFiles() + await expect( + page.getByRole('heading', { name: 'Desk lamp', exact: true }), + ).toBeVisible() +}) + +test('a module server function runs its edited implementation', async ({ + page, +}) => { + await gotoHydrated(page, '/shop/lamp') + await expect(page.getByRole('heading', { name: 'Desk lamp' })).toBeVisible() + + await editor.replaceText('api', "name: 'Desk lamp'", "name: 'Reading lamp'") + await expect(async () => { + await page.getByRole('button', { name: 'Refresh' }).click() + await expect( + page.getByRole('heading', { name: 'Reading lamp' }), + ).toBeVisible({ timeout: 1000 }) + }).toPass() + await expect(page.getByTestId('price')).toHaveText('49.00 EUR') +}) + +test('editing a route of a module installed twice hot-updates every installation', async ({ + page, +}) => { + await gotoHydrated(page, '/people/ada/settings/profile') + await expect(page.getByRole('heading', { name: 'Profile' })).toBeVisible() + await page.evaluate(() => { + ;(window as any).__beforeHmr = true + }) + + await settingsEditor.replaceText( + 'profile', + '

Profile

', + '

Updated profile

', + ) + await expect( + page.getByRole('heading', { name: 'Updated profile' }), + ).toBeVisible() + + // The installation of the organizations runs the updated route too. + await page.evaluate(() => + (window as any).__TSR_ROUTER__.navigate({ + to: '/orgs/acme/settings/profile', + }), + ) + await expect(page.getByTestId('profile-kind')).toHaveText('organization') + await expect( + page.getByRole('heading', { name: 'Updated profile' }), + ).toBeVisible() + // Hot updates, not reloads: page state survives. + expect(await page.evaluate(() => (window as any).__beforeHmr)).toBe(true) +}) + +test('provider classification changes refresh the client tree and preserve server endpoints', async ({ + page, + request, +}) => { + await editor.capturePromise + const providerGenerator = new Generator({ + root: catalog, + config: getConfig({ disableLogging: true }, catalog), + }) + const hasCatalogPage = () => + page.evaluate(() => { + const router = (window as any).__TSR_ROUTER__ + return router + ? Object.hasOwn(router.routesById, '@start-route-modules/catalog:/') + : undefined + }) + const expectCatalogPage = (present: boolean) => + expect(async () => { + // Topology publication may reload the document; retry through navigation + // and require an initialized router before checking its route inventory. + expect(await hasCatalogPage()).toBe(present) + }).toPass() + await gotoHydrated(page, '/') + await expectCatalogPage(true) + try { + await editor.rewriteFile( + 'index', + () => `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@start-route-modules/catalog:/')({ + server: { handlers: { GET: () => new Response('catalog endpoint') } }, +}) +`, + ) + await providerGenerator.run() + await expectCatalogPage(false) + await expect(async () => { + const response = await request.get('/shop') + expect(response.status()).toBe(200) + expect(await response.text()).toBe('catalog endpoint') + }).toPass() + + await editor.restoreFiles() + await providerGenerator.run() + await expectCatalogPage(true) + await gotoHydrated(page, '/shop') + await expect(page.getByTestId('price-chair')).toHaveText('129.00 EUR') + } finally { + await editor.restoreFiles() + await providerGenerator.run() + } +}) diff --git a/e2e/react-start/route-modules/e2e/app.spec.ts b/e2e/react-start/route-modules/e2e/app.spec.ts new file mode 100644 index 0000000000..4309a6d1ea --- /dev/null +++ b/e2e/react-start/route-modules/e2e/app.spec.ts @@ -0,0 +1,160 @@ +import { expect, test } from '@playwright/test' + +test('the server renders module routes with the context the application provides', async ({ + request, +}) => { + const html = await (await request.get('/shop/lamp')).text() + expect(html).toContain('Desk lamp') + // `shopper` comes from the application's request middleware, the currency + // from the catalog's own pricing middleware. + expect(html).toContain('49.00 EUR') + expect(html).toContain('Shopper: ada') +}) + +test('module data hydrates through the module serialization adapter', async ({ + page, +}) => { + await page.goto('/shop/lamp') + await expect(page.getByTestId('price')).toHaveText('49.00 EUR') + const renderedAt = await page.getByTestId('rendered-at').textContent() + + // The route's loader runs again on the client and calls the module's + // server function; its result goes through the serialization adapter. + await page.getByRole('button', { name: 'Refresh' }).click() + await expect(page.getByTestId('rendered-at')).not.toHaveText(renderedAt!) + await expect(page.getByTestId('price')).toHaveText('49.00 EUR') + await expect(page.getByTestId('shopper')).toHaveText('Shopper: ada') +}) + +test('client navigation loads module routes through their server functions', async ({ + page, +}) => { + await page.goto('/') + await expect(page.getByRole('heading', { name: 'Home' })).toBeVisible() + await page.getByRole('link', { name: 'Catalog' }).click() + await expect(page).toHaveURL('/shop') + await expect(page.getByTestId('price-chair')).toHaveText('129.00 EUR') + + await page.getByRole('link', { name: 'Office chair' }).click() + await expect(page).toHaveURL('/shop/chair') + await expect( + page.getByRole('heading', { name: 'Office chair' }), + ).toBeVisible() + + await page.getByRole('link', { name: 'All products' }).click() + await expect(page).toHaveURL('/shop') +}) + +test('a router-only module renders in the Start application', async ({ + page, +}) => { + await page.goto('/') + await page.getByRole('link', { name: 'Notes' }).click() + await expect(page).toHaveURL('/notes') + await expect(page.getByTestId('notes')).toContainText('Compose route modules') +}) + +test('module routes are code-split from the application bundle', async ({ + page, +}) => { + // Chunk names differ between toolchains: find the product page's code by + // its text in the scripts the browser loads. + const scripts: Array> = [] + page.on('response', (response) => { + if (response.request().resourceType() === 'script') { + scripts.push(response.text()) + } + }) + const loadsProductPage = async () => + (await Promise.all(scripts)).some((script) => + script.includes('Rendered at'), + ) + await page.goto('/') + await expect(page.getByRole('heading', { name: 'Home' })).toBeVisible() + expect(await loadsProductPage()).toBe(false) + + await page.getByRole('link', { name: 'Lamp' }).click() + await expect(page.getByRole('heading', { name: 'Desk lamp' })).toBeVisible() + await expect.poll(loadsProductPage).toBe(true) +}) + +test('the server renders a module mounted under path params', async ({ + request, +}) => { + const html = await (await request.get('/orgs/acme/team')).text() + expect(html).toContain('Team of ACME') + // The module's server function loads the members of the organization in the URL. + expect(html).toContain('grace (acme)') +}) + +test('links into and inside a module mounted under path params', async ({ + page, +}) => { + await page.goto('/') + await page.getByTestId('hydrated').waitFor() + // The application passes the path params above the module. + await page.getByRole('link', { name: 'Acme team' }).click() + await expect(page).toHaveURL('/orgs/acme/team') + await expect( + page.getByRole('heading', { name: 'Team of ACME' }), + ).toBeVisible() + + // Module-local links keep the path params of the current location. + await page.getByRole('link', { name: 'grace (acme)' }).click() + await expect(page).toHaveURL('/orgs/acme/team/members/grace') + await expect( + page.getByRole('heading', { name: 'grace at ACME' }), + ).toBeVisible() + await page.getByRole('link', { name: 'All members' }).click() + await expect(page).toHaveURL('/orgs/acme/team') +}) + +test('the server renders each installation of a module installed twice', async ({ + request, +}) => { + const person = await ( + await request.get('/people/ada/settings/profile') + ).text() + expect(person).toContain('Settings of Ada') + expect(person).toContain('@ada') + const organization = await ( + await request.get('/orgs/acme/settings/profile') + ).text() + expect(organization).toContain('Settings of ACME') + expect(organization).toContain('@acme') +}) + +test('links of a module installed twice stay in their installation', async ({ + page, +}) => { + await page.goto('/') + await page.getByTestId('hydrated').waitFor() + await page.getByRole('link', { name: 'Globex settings' }).click() + await expect(page).toHaveURL('/orgs/globex/settings') + await expect( + page.getByRole('heading', { name: 'Settings of GLOBEX' }), + ).toBeVisible() + // The profile loads through the module's server function. + await page.getByRole('link', { name: 'Profile' }).click() + await expect(page).toHaveURL('/orgs/globex/settings/profile') + await expect(page.getByTestId('profile-kind')).toHaveText('organization') + + await page.goto('/') + await page.getByTestId('hydrated').waitFor() + await page.getByRole('link', { name: "Ada's profile" }).click() + await expect(page).toHaveURL('/people/ada/settings/profile') + await expect(page.getByTestId('profile-kind')).toHaveText('person') + await page.getByRole('link', { name: 'All settings' }).click() + await expect(page).toHaveURL('/people/ada/settings') +}) + +test('a module that uses a module installed twice links to the installation above it', async ({ + page, +}) => { + await page.goto('/orgs/acme/team') + await page.getByTestId('hydrated').waitFor() + const profile = page.getByRole('link', { name: 'Organization profile' }) + await expect(profile).toHaveAttribute('href', '/orgs/acme/settings/profile') + await profile.click() + await expect(page.getByTestId('profile-kind')).toHaveText('organization') +}) diff --git a/e2e/react-start/route-modules/package.json b/e2e/react-start/route-modules/package.json new file mode 100644 index 0000000000..ce088f7363 --- /dev/null +++ b/e2e/react-start/route-modules/package.json @@ -0,0 +1,54 @@ +{ + "name": "tanstack-react-start-e2e-route-modules", + "private": true, + "type": "module", + "scripts": { + "test:e2e": "vitest run && pnpm test:e2e:dev", + "test:e2e:dev": "pnpm test:e2e:dev:vite && pnpm test:e2e:dev:rsbuild", + "test:e2e:dev:vite": "E2E_TOOLCHAIN=vite playwright test --config playwright.dev.config.ts --project=chromium", + "test:e2e:dev:rsbuild": "E2E_TOOLCHAIN=rsbuild playwright test --config playwright.dev.config.ts --project=chromium" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@start-route-modules/web": "workspace:*", + "@tanstack/router-e2e-utils": "workspace:^", + "@tanstack/router-generator": "workspace:^", + "@types/node": "catalog:", + "vitest": "catalog:" + }, + "nx": { + "targets": { + "test:e2e": { + "parallelism": false + }, + "build:vite:ssr": { + "options": { + "command": "node scripts/prepare.mjs && pnpm --filter @start-route-modules/web build:vite" + }, + "outputs": [ + "{projectRoot}/packages/web/dist-vite-ssr" + ] + }, + "build:rsbuild:ssr": { + "options": { + "command": "node scripts/prepare.mjs && pnpm --filter @start-route-modules/web build:rsbuild" + }, + "outputs": [ + "{projectRoot}/packages/web/dist-rsbuild-ssr" + ] + } + }, + "metadata": { + "playwrightModes": [ + { + "toolchain": "vite", + "mode": "ssr" + }, + { + "toolchain": "rsbuild", + "mode": "ssr" + } + ] + } + } +} diff --git a/e2e/react-start/route-modules/packages/catalog/package.json b/e2e/react-start/route-modules/packages/catalog/package.json new file mode 100644 index 0000000000..7f0729e3ce --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/package.json @@ -0,0 +1,36 @@ +{ + "name": "@start-route-modules/catalog", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": true + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "@tanstack/react-start": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@tanstack/start-client-core": "workspace:^", + "@types/react": "^19.0.8" + } +} diff --git a/e2e/react-start/route-modules/packages/catalog/src/api.ts b/e2e/react-start/route-modules/packages/catalog/src/api.ts new file mode 100644 index 0000000000..263b078d00 --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/src/api.ts @@ -0,0 +1,41 @@ +import { notFound } from '@tanstack/react-router' +import { createServerFn, createMiddleware } from './routeScope.gen' +import { Money } from './money' + +// Module-local: only the catalog's server functions run it. +const pricing = createMiddleware({ type: 'function' }).server( + ({ context, next }) => + next({ context: { currency: context.shopper === 'ada' ? 'EUR' : 'USD' } }), +) + +const products = [ + { id: 'lamp', name: 'Desk lamp', cents: 4900 }, + { id: 'chair', name: 'Office chair', cents: 12900 }, +] + +export const listProducts = createServerFn() + .middleware([pricing]) + .handler(({ context }) => + products.map((product) => ({ + id: product.id, + name: product.name, + price: new Money(product.cents, context.currency), + })), + ) + +export const getProduct = createServerFn() + .middleware([pricing]) + .validator((id: string) => id) + .handler(({ data, context }) => { + const product = products.find((candidate) => candidate.id === data) + if (!product) { + throw notFound() + } + return { + id: product.id, + name: product.name, + price: new Money(product.cents, context.currency), + shopper: context.shopper, + renderedAt: Date.now(), + } + }) diff --git a/e2e/react-start/route-modules/packages/catalog/src/money.ts b/e2e/react-start/route-modules/packages/catalog/src/money.ts new file mode 100644 index 0000000000..fbd146447c --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/src/money.ts @@ -0,0 +1,20 @@ +import { createSerializationAdapter } from '@tanstack/react-router' + +/** An amount of money. Server functions and loaders return it as is. */ +export class Money { + constructor( + readonly cents: number, + readonly currency: string, + ) {} + + format() { + return `${(this.cents / 100).toFixed(2)} ${this.currency}` + } +} + +export const moneyAdapter = createSerializationAdapter({ + key: 'catalog-money', + test: (value): value is Money => value instanceof Money, + toSerializable: (money) => ({ cents: money.cents, currency: money.currency }), + fromSerializable: (value) => new Money(value.cents, value.currency), +}) diff --git a/e2e/react-start/route-modules/packages/catalog/src/requirements.ts b/e2e/react-start/route-modules/packages/catalog/src/requirements.ts new file mode 100644 index 0000000000..1c91f7bdf0 --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/src/requirements.ts @@ -0,0 +1,7 @@ +export type { StartModuleRequirements } from '@tanstack/react-start' + +declare module '@tanstack/react-start' { + interface StartModuleRequirements { + '@start-route-modules/catalog': { requestContext: { shopper: string } } + } +} diff --git a/e2e/react-start/route-modules/packages/catalog/src/routes/$productId.tsx b/e2e/react-start/route-modules/packages/catalog/src/routes/$productId.tsx new file mode 100644 index 0000000000..34ff20347c --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/src/routes/$productId.tsx @@ -0,0 +1,62 @@ +import { useRef } from 'react' +import { createFileRoute, useRouter } from '../routeScope.gen' +import { getProduct } from '../api' + +export const Route = createFileRoute( + '@start-route-modules/catalog:/$productId', +)({ + loader: ({ params }) => getProduct({ data: params.productId }), + component: ProductPage, +}) + +function ProductPage() { + const product = Route.useLoaderData() + const router = useRouter() + const refreshing = Route.useMatch({ + select: (match) => match.isFetching !== false, + }) + // A render after the first one came from a refresh. + const firstRenderedAt = useRef(product.renderedAt).current + return ( +
+

{product.name}

+

+ {product.price.format()} +

+
+

Shopper: {product.shopper}

+

+ Rendered at{' '} + {/* Highlighted once each time a refresh brings a new render. */} + {' '} + UTC +

+
+
+ + All products +
+
+ ) +} diff --git a/e2e/react-start/route-modules/packages/catalog/src/routes/__root.tsx b/e2e/react-start/route-modules/packages/catalog/src/routes/__root.tsx new file mode 100644 index 0000000000..e245ab4549 --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/src/routes/__root.tsx @@ -0,0 +1,21 @@ +export type {} from '../requirements' +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ + component: CatalogRoom, +}) + +// The module's region: a room tagged with its package and where it is +// mounted. +function CatalogRoom() { + return ( +
+

+ @start-route-modules/catalog {Route.fullPath} +

+

Catalog

+ +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/catalog/src/routes/index.tsx b/e2e/react-start/route-modules/packages/catalog/src/routes/index.tsx new file mode 100644 index 0000000000..4b399ce36c --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/src/routes/index.tsx @@ -0,0 +1,25 @@ +import { createFileRoute } from '../routeScope.gen' +import { listProducts } from '../api' + +export const Route = createFileRoute('@start-route-modules/catalog:/')({ + loader: () => listProducts(), + component: CatalogPage, +}) + +function CatalogPage() { + const products = Route.useLoaderData() + return ( +
    + {products.map((product) => ( +
  • + + {product.name} + + + {product.price.format()} + +
  • + ))} +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/catalog/src/start.ts b/e2e/react-start/route-modules/packages/catalog/src/start.ts new file mode 100644 index 0000000000..010339ba76 --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/src/start.ts @@ -0,0 +1,8 @@ +export type {} from './requirements' +import { createStartModule } from './routeScope.gen' +import { moneyAdapter } from './money' + +export const start = createStartModule(() => ({ + // Contributed: `Money` values cross the network in every application route. + serializationAdapters: [moneyAdapter], +})) diff --git a/e2e/react-start/route-modules/packages/catalog/tsconfig.json b/e2e/react-start/route-modules/packages/catalog/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-start/route-modules/packages/catalog/tsconfig.route-types.json b/e2e/react-start/route-modules/packages/catalog/tsconfig.route-types.json new file mode 100644 index 0000000000..0c9aec3caf --- /dev/null +++ b/e2e/react-start/route-modules/packages/catalog/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src"] +} diff --git a/e2e/react-start/route-modules/packages/notes/package.json b/e2e/react-start/route-modules/packages/notes/package.json new file mode 100644 index 0000000000..87d6fe06d5 --- /dev/null +++ b/e2e/react-start/route-modules/packages/notes/package.json @@ -0,0 +1,34 @@ +{ + "name": "@start-route-modules/notes", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": true + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@types/react": "^19.0.8" + } +} diff --git a/e2e/react-start/route-modules/packages/notes/src/routes/__root.tsx b/e2e/react-start/route-modules/packages/notes/src/routes/__root.tsx new file mode 100644 index 0000000000..b2bf618003 --- /dev/null +++ b/e2e/react-start/route-modules/packages/notes/src/routes/__root.tsx @@ -0,0 +1,18 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ component: NotesRoom }) + +// The module's region: a room tagged with its package and where it is +// mounted. +function NotesRoom() { + return ( +
+

+ @start-route-modules/notes {Route.fullPath} +

+

Notes

+ +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/notes/src/routes/index.tsx b/e2e/react-start/route-modules/packages/notes/src/routes/index.tsx new file mode 100644 index 0000000000..085fd35834 --- /dev/null +++ b/e2e/react-start/route-modules/packages/notes/src/routes/index.tsx @@ -0,0 +1,18 @@ +import { createFileRoute } from '../routeScope.gen' + +// A router-only module: the application that mounts it serializes this result. +export const Route = createFileRoute('@start-route-modules/notes:/')({ + loader: () => ({ notes: ['Compose route modules', 'Ship it'] }), + component: NotesPage, +}) + +function NotesPage() { + const { notes } = Route.useLoaderData() + return ( +
    + {notes.map((note) => ( +
  • {note}
  • + ))} +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/notes/tsconfig.json b/e2e/react-start/route-modules/packages/notes/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-start/route-modules/packages/notes/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-start/route-modules/packages/notes/tsconfig.route-types.json b/e2e/react-start/route-modules/packages/notes/tsconfig.route-types.json new file mode 100644 index 0000000000..0c9aec3caf --- /dev/null +++ b/e2e/react-start/route-modules/packages/notes/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src"] +} diff --git a/e2e/react-start/route-modules/packages/settings/package.json b/e2e/react-start/route-modules/packages/settings/package.json new file mode 100644 index 0000000000..58223e6483 --- /dev/null +++ b/e2e/react-start/route-modules/packages/settings/package.json @@ -0,0 +1,36 @@ +{ + "name": "@start-route-modules/settings", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": true + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/react-router": "workspace:^", + "@tanstack/react-start": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@tanstack/start-client-core": "workspace:^", + "@types/react": "^19.0.8" + } +} diff --git a/e2e/react-start/route-modules/packages/settings/src/api.ts b/e2e/react-start/route-modules/packages/settings/src/api.ts new file mode 100644 index 0000000000..2699f06ded --- /dev/null +++ b/e2e/react-start/route-modules/packages/settings/src/api.ts @@ -0,0 +1,6 @@ +import { createServerFn } from './routeScope.gen' + +/** The profile of an owner, loaded on the server. */ +export const getProfile = createServerFn() + .validator((owner: { kind: string; id: string }) => owner) + .handler(({ data }) => ({ kind: data.kind, handle: `@${data.id}` })) diff --git a/e2e/react-start/route-modules/packages/settings/src/routes/__root.tsx b/e2e/react-start/route-modules/packages/settings/src/routes/__root.tsx new file mode 100644 index 0000000000..db49802df7 --- /dev/null +++ b/e2e/react-start/route-modules/packages/settings/src/routes/__root.tsx @@ -0,0 +1,38 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +/** Whose settings an installation shows, provided by its host route. */ +export interface Owner { + kind: 'organization' | 'person' + id: string + name: string +} + +// The store installs the settings twice: below `/orgs/$orgId` and below +// `/people/$personId`. Each host route provides its owner. +export const Route = createModuleRoot<{ owner: Owner }>()({ + component: SettingsRoom, +}) + +// The module's region: a room tagged with the installation it renders and +// where that installation is mounted. +function SettingsRoom() { + const { owner } = Route.useRouteContext() + const match = Route.useMatch({ + select: ({ routeId, fullPath, pathname }) => ({ + installation: routeId.slice(0, routeId.indexOf(':')), + fullPath, + pathname, + }), + }) + return ( +
+

+ {match.installation} {match.fullPath} + → {match.pathname} +

+

{`Settings of ${owner.name}`}

+ +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/settings/src/routes/index.tsx b/e2e/react-start/route-modules/packages/settings/src/routes/index.tsx new file mode 100644 index 0000000000..86e80418f9 --- /dev/null +++ b/e2e/react-start/route-modules/packages/settings/src/routes/index.tsx @@ -0,0 +1,15 @@ +import { Link, createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('@start-route-modules/settings:/')({ + component: SettingsIndex, +}) + +function SettingsIndex() { + return ( +
    +
  • + Profile +
  • +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/settings/src/routes/profile.tsx b/e2e/react-start/route-modules/packages/settings/src/routes/profile.tsx new file mode 100644 index 0000000000..88f10273ba --- /dev/null +++ b/e2e/react-start/route-modules/packages/settings/src/routes/profile.tsx @@ -0,0 +1,27 @@ +import { createFileRoute } from '../routeScope.gen' +import { getProfile } from '../api' + +export const Route = createFileRoute('@start-route-modules/settings:/profile')({ + // Each installation loads the profile of the owner its host provides. + loader: ({ context }) => + getProfile({ data: { kind: context.owner.kind, id: context.owner.id } }), + component: Profile, +}) + +function Profile() { + const profile = Route.useLoaderData() + return ( +
+

Profile

+
+
Kind
+
{profile.kind}
+
Handle
+
+ {profile.handle} +
+
+ All settings +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/settings/tsconfig.json b/e2e/react-start/route-modules/packages/settings/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-start/route-modules/packages/settings/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-start/route-modules/packages/settings/tsconfig.route-types.json b/e2e/react-start/route-modules/packages/settings/tsconfig.route-types.json new file mode 100644 index 0000000000..0c9aec3caf --- /dev/null +++ b/e2e/react-start/route-modules/packages/settings/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src"] +} diff --git a/e2e/react-start/route-modules/packages/team/package.json b/e2e/react-start/route-modules/packages/team/package.json new file mode 100644 index 0000000000..cb8b8d1f05 --- /dev/null +++ b/e2e/react-start/route-modules/packages/team/package.json @@ -0,0 +1,41 @@ +{ + "name": "@start-route-modules/team", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": { + "uses": [ + "@start-route-modules/settings" + ] + } + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "node -e \"require('node:fs').rmSync('.tanstack/types',{recursive:true,force:true})\" && tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@start-route-modules/settings": "workspace:*", + "@tanstack/react-router": "workspace:^", + "@tanstack/react-start": "workspace:^", + "react": "^19.0.0" + }, + "devDependencies": { + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@tanstack/start-client-core": "workspace:^", + "@types/react": "^19.0.8" + } +} diff --git a/e2e/react-start/route-modules/packages/team/src/api.ts b/e2e/react-start/route-modules/packages/team/src/api.ts new file mode 100644 index 0000000000..a0df5ce0c6 --- /dev/null +++ b/e2e/react-start/route-modules/packages/team/src/api.ts @@ -0,0 +1,8 @@ +import { createServerFn } from './routeScope.gen' + +/** The members of an organization, loaded on the server. */ +export const listMembers = createServerFn() + .validator((orgId: string) => orgId) + .handler(({ data }) => + ['ada', 'grace'].map((name) => ({ id: name, label: `${name} (${data})` })), + ) diff --git a/e2e/react-start/route-modules/packages/team/src/routes/__root.tsx b/e2e/react-start/route-modules/packages/team/src/routes/__root.tsx new file mode 100644 index 0000000000..f6976ed6d0 --- /dev/null +++ b/e2e/react-start/route-modules/packages/team/src/routes/__root.tsx @@ -0,0 +1,25 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +// The organization comes from the host route the application mounts the team +// under, so the team works below any route that provides it. +export const Route = createModuleRoot<{ org: { id: string; name: string } }>()({ + component: TeamLayout, +}) + +// The module's region: a room tagged with its package and where it is +// mounted, with the URL its mount path resolved to. +function TeamLayout() { + const { org } = Route.useRouteContext() + const pathname = Route.useMatch({ select: (match) => match.pathname }) + return ( +
+

+ @start-route-modules/team {Route.fullPath} + → {pathname} +

+

{`Team of ${org.name}`}

+ +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/team/src/routes/index.tsx b/e2e/react-start/route-modules/packages/team/src/routes/index.tsx new file mode 100644 index 0000000000..d7c8dec462 --- /dev/null +++ b/e2e/react-start/route-modules/packages/team/src/routes/index.tsx @@ -0,0 +1,27 @@ +import { Link, createFileRoute, settings } from '../routeScope.gen' +import { listMembers } from '../api' + +export const Route = createFileRoute('@start-route-modules/team:/')({ + loader: ({ context }) => listMembers({ data: context.org.id }), + component: Members, +}) + +function Members() { + const members = Route.useLoaderData() + return ( + <> +
    + {members.map((member) => ( +
  • + + {member.label} + +
  • + ))} +
+ {/* The settings are installed for organizations and for people: the + team links to the installation of its own organization. */} + Organization profile + + ) +} diff --git a/e2e/react-start/route-modules/packages/team/src/routes/members.$memberId.tsx b/e2e/react-start/route-modules/packages/team/src/routes/members.$memberId.tsx new file mode 100644 index 0000000000..a51df6a1d9 --- /dev/null +++ b/e2e/react-start/route-modules/packages/team/src/routes/members.$memberId.tsx @@ -0,0 +1,28 @@ +import { Link, createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute( + '@start-route-modules/team:/members/$memberId', +)({ + component: Member, +}) + +function Member() { + const { memberId } = Route.useParams() + const { org } = Route.useRouteContext() + return ( +
+

{`${memberId} at ${org.name}`}

+
+
Organization
+
+ {org.id} +
+
Member
+
+ {memberId} +
+
+ All members +
+ ) +} diff --git a/e2e/react-start/route-modules/packages/team/tsconfig.json b/e2e/react-start/route-modules/packages/team/tsconfig.json new file mode 100644 index 0000000000..1de72ddc24 --- /dev/null +++ b/e2e/react-start/route-modules/packages/team/tsconfig.json @@ -0,0 +1,15 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/react-start/route-modules/packages/team/tsconfig.route-types.json b/e2e/react-start/route-modules/packages/team/tsconfig.route-types.json new file mode 100644 index 0000000000..95f6cee32f --- /dev/null +++ b/e2e/react-start/route-modules/packages/team/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src", ".tanstack/route-types-stubs.d.ts"] +} diff --git a/e2e/react-start/route-modules/packages/web/package.json b/e2e/react-start/route-modules/packages/web/package.json new file mode 100644 index 0000000000..f1f50b148b --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/package.json @@ -0,0 +1,34 @@ +{ + "name": "@start-route-modules/web", + "private": true, + "type": "module", + "scripts": { + "dev:vite": "vite dev", + "dev:rsbuild": "rsbuild dev", + "build:vite": "vite build && tsc --noEmit", + "build:rsbuild": "rsbuild build && tsc --noEmit", + "start": "node server.js" + }, + "dependencies": { + "@start-route-modules/catalog": "workspace:*", + "@start-route-modules/notes": "workspace:*", + "@start-route-modules/settings": "workspace:*", + "@start-route-modules/team": "workspace:*", + "@tanstack/react-router": "workspace:^", + "@tanstack/react-router-devtools": "workspace:^", + "@tanstack/react-start": "workspace:^", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@rsbuild/core": "^2.1.0", + "@rsbuild/plugin-react": "^2.0.0", + "@types/node": "^22.10.2", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@typescript/native": "npm:typescript@^7.0.2", + "@vitejs/plugin-react": "^6.0.1", + "srvx": "^1.0.0", + "vite": "^8.0.14" + } +} diff --git a/e2e/react-start/route-modules/packages/web/route-modules.ts b/e2e/react-start/route-modules/packages/web/route-modules.ts new file mode 100644 index 0000000000..40dc69e6f6 --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/route-modules.ts @@ -0,0 +1,28 @@ +/** + * The route modules the store installs, shared by the Vite and the Rsbuild + * configuration. `tests/workspace.ts` mirrors it for the generation tests. + */ +export const routeModules = { + includes: [ + { module: '@start-route-modules/catalog', at: '/shop' }, + { module: '@start-route-modules/notes', at: '/notes' }, + { + module: '@start-route-modules/team', + parent: '/orgs/$orgId', + at: '/team', + }, + // Installed twice: per organization and per person. + { + module: '@start-route-modules/settings', + parent: '/orgs/$orgId', + at: '/settings', + as: 'orgSettings', + }, + { + module: '@start-route-modules/settings', + parent: '/people/$personId', + at: '/settings', + as: 'personSettings', + }, + ], +} diff --git a/e2e/react-start/route-modules/packages/web/rsbuild.config.ts b/e2e/react-start/route-modules/packages/web/rsbuild.config.ts new file mode 100644 index 0000000000..ecdf2d5151 --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/rsbuild.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from '@rsbuild/core' +import { pluginReact } from '@rsbuild/plugin-react' +import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' +import { routeModules } from './route-modules.ts' + +// The e2e build of each toolchain and mode writes to its own directory. +const outDir = process.env.E2E_DIST_DIR ?? 'dist' + +export default defineConfig({ + plugins: [pluginReact(), tanstackStart({ router: { routeModules } })], + output: { + distPath: { + root: outDir, + }, + }, +}) diff --git a/e2e/react-start/route-modules/packages/web/server.js b/e2e/react-start/route-modules/packages/web/server.js new file mode 100644 index 0000000000..3f18062992 --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/server.js @@ -0,0 +1,19 @@ +// Serves a production build of either toolchain: Vite writes the server +// entry to `server/server.js`, Rsbuild to `server/index.js`. +import { spawn } from 'node:child_process' +import { existsSync } from 'node:fs' +import path from 'node:path' + +const distDir = process.env.E2E_DIST_DIR || 'dist' +const serverEntry = + ['server.js', 'index.js'] + .map((file) => path.resolve(distDir, 'server', file)) + .find((file) => existsSync(file)) ?? + path.resolve(distDir, 'server', 'server.js') + +const child = spawn( + 'srvx', + ['--prod', '-s', path.resolve(distDir, 'client'), serverEntry], + { stdio: 'inherit', shell: process.platform === 'win32' }, +) +child.on('exit', (code) => process.exit(code ?? 0)) diff --git a/e2e/react-start/route-modules/packages/web/src/router.tsx b/e2e/react-start/route-modules/packages/web/src/router.tsx new file mode 100644 index 0000000000..b54237fd92 --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/src/router.tsx @@ -0,0 +1,6 @@ +import { createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' + +export function getRouter() { + return createRouter({ routeTree, scrollRestoration: true }) +} diff --git a/e2e/react-start/route-modules/packages/web/src/routes/__root.tsx b/e2e/react-start/route-modules/packages/web/src/routes/__root.tsx new file mode 100644 index 0000000000..b6a3041deb --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/src/routes/__root.tsx @@ -0,0 +1,90 @@ +/// +import * as React from 'react' +import type { ReactNode } from 'react' +import { + ClientOnly, + HeadContent, + Link, + Scripts, + createRootRoute, +} from '@tanstack/react-router' +import { catalog, notes, team } from '../routeScope.gen' +import '../styles.css' + +// The router devtools, in development only. +const RouterDevtools = import.meta.env.DEV + ? React.lazy(() => + import('@tanstack/react-router-devtools').then((module) => ({ + default: module.TanStackRouterDevtools, + })), + ) + : () => null + +export const Route = createRootRoute({ + head: () => ({ + meta: [ + { charSet: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + { title: 'Acme Store' }, + ], + }), + shellComponent: RootDocument, +}) + +function RootDocument({ children }: { children: ReactNode }) { + return ( + + + + + +
+ + + Acme Store + + + server-rendered

}> +

+ hydrated +

+
+
+
{children}
+ + + + + + + ) +} + +/** A small floor plan: outer walls with a door, two inner walls. */ +function PlanMark() { + return ( + + ) +} diff --git a/e2e/react-start/route-modules/packages/web/src/routes/index.tsx b/e2e/react-start/route-modules/packages/web/src/routes/index.tsx new file mode 100644 index 0000000000..471165e1be --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/src/routes/index.tsx @@ -0,0 +1,90 @@ +import { createFileRoute } from '@tanstack/react-router' +import { orgSettings, personSettings } from '../routeScope.gen' + +export const Route = createFileRoute('/')({ + component: Home, +}) + +// A key plan of the store: every module's room where the store mounts it, +// nested like the routes. +function Home() { + return ( + <> +

Home

+

+ The Acme storefront, rendered on the server. Each region is a route + module, drawn as a room: its tag names the package and where the store + mounts it. +

+
+
+

+ @start-route-modules/catalog /shop +

+

+ Prices for the signed-in shopper, refreshed through a server + function. +

+
+
+

+ @start-route-modules/notes /notes +

+

A router-only module; the store serializes its data.

+
+ {/* The organization route is the store's own: the team below it gets + `orgId` from the URL. */} +
+

+ Host route /orgs/$orgId +

+
+
+

+ @start-route-modules/team /team +

+

+ Members of the organization in the URL, loaded on the server. +

+
+
+

+ @start-route-modules/settings#orgSettings /settings +

+

+ + Globex settings + +

+
+
+
+ {/* The settings are installed a second time, per person. */} +
+

+ Host route /people/$personId +

+
+
+

+ @start-route-modules/settings#personSettings{' '} + /settings +

+

+ + Ada's profile + +

+
+
+
+
+ + ) +} diff --git a/e2e/react-start/route-modules/packages/web/src/routes/orgs.$orgId.tsx b/e2e/react-start/route-modules/packages/web/src/routes/orgs.$orgId.tsx new file mode 100644 index 0000000000..3c08aa0637 --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/src/routes/orgs.$orgId.tsx @@ -0,0 +1,15 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +// The host route of the modules mounted per organization: they get its path +// params in their URLs and the organization as context, and its settings +// installation the organization as their owner. +export const Route = createFileRoute('/orgs/$orgId')({ + beforeLoad: ({ params }) => { + const name = params.orgId.toUpperCase() + return { + org: { id: params.orgId, name }, + owner: { kind: 'organization' as const, id: params.orgId, name }, + } + }, + component: () => , +}) diff --git a/e2e/react-start/route-modules/packages/web/src/routes/people.$personId.tsx b/e2e/react-start/route-modules/packages/web/src/routes/people.$personId.tsx new file mode 100644 index 0000000000..19ac32e5c7 --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/src/routes/people.$personId.tsx @@ -0,0 +1,13 @@ +import { Outlet, createFileRoute } from '@tanstack/react-router' + +// The host route of the settings installation per person. +export const Route = createFileRoute('/people/$personId')({ + beforeLoad: ({ params }) => ({ + owner: { + kind: 'person' as const, + id: params.personId, + name: params.personId[0]!.toUpperCase() + params.personId.slice(1), + }, + }), + component: () => , +}) diff --git a/e2e/react-start/route-modules/packages/web/src/start.ts b/e2e/react-start/route-modules/packages/web/src/start.ts new file mode 100644 index 0000000000..5d11d4c173 --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/src/start.ts @@ -0,0 +1,12 @@ +import { createMiddleware, createStart } from '@tanstack/react-start' +import { startModules } from './startModules.gen' + +// Provides the request context the catalog requires. +const shopper = createMiddleware().server(({ next }) => + next({ context: { shopper: 'ada' } }), +) + +export const startInstance = createStart(() => ({ + extends: startModules, + requestMiddleware: [shopper], +})) diff --git a/e2e/react-start/route-modules/packages/web/src/styles.css b/e2e/react-start/route-modules/packages/web/src/styles.css new file mode 100644 index 0000000000..e90577b1bd --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/src/styles.css @@ -0,0 +1,486 @@ +/* + * Acme Store: the route-module fixtures drawn as a floor plan. Every route + * module is a room: a wall line, a zoning tint and a room tag with its package + * and mount path. Violet marks the active route and nothing else. + */ + +:root { + color-scheme: light; + + --ground: #f4f6f9; + --sheet: #ffffff; + --ink: #1f2328; + --ink-2: #4b535c; + --ink-3: #59616b; + --line: #d3d7db; + --wall: #2a3036; + --route: #5b3fd1; + --route-wash: #e9e5fb; + /* Link underlines: 3:1 or better on the ground and on every zone. */ + --underline: color-mix(in srgb, var(--wall) 55%, transparent); + --zone: #eef0f2; + + --font: + ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, + 'Helvetica Neue', Arial, sans-serif; + /* Plan lettering: a local condensed face where there is one. */ + --font-lettering: + 'Avenir Next Condensed', 'Roboto Condensed', 'Arial Narrow', ui-sans-serif, + system-ui, sans-serif; + --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; + + --s1: 4px; + --s2: 8px; + --s3: 12px; + --s4: 16px; + --s5: 20px; + --s6: 24px; + --s8: 32px; + --s10: 40px; + --s12: 48px; + + /* A drafted wall: two lines with the wall's thickness between them. */ + --wall-line: 6px double var(--wall); + --ease-out: cubic-bezier(0.16, 1, 0.3, 1); +} + +/* Zoning: one tint per module, as on a zoning plan. */ +[data-route-module='@start-route-modules/catalog'] { + --zone: #e1ebdd; +} +[data-route-module='@start-route-modules/notes'] { + --zone: #e7e9e4; +} +[data-route-module='@start-route-modules/team'] { + --zone: #d9eeeb; +} +[data-route-module='@start-route-modules/settings'] { + --zone: #efecd2; +} + +*, +*::before, +*::after { + box-sizing: border-box; +} + +html { + background: var(--ground); + scrollbar-color: var(--line) transparent; +} + +body { + margin: 0; + color: var(--ink); + font: 400 15px/1.55 var(--font); + -webkit-font-smoothing: antialiased; +} + +::selection { + background: var(--route-wash); + color: var(--ink); +} + +:focus-visible { + outline: 2px solid var(--wall); + outline-offset: 2px; + border-radius: 2px; +} + +h1, +h2, +h3 { + margin: 0 0 var(--s3); + font-weight: 650; + letter-spacing: -0.02em; + line-height: 1.2; + text-wrap: balance; +} +h1 { + font-size: 30px; +} +h2 { + font-size: 22px; +} +h3 { + font-size: 18px; +} + +p { + margin: 0 0 var(--s3); + max-width: 68ch; +} + +code { + font: 500 0.92em var(--mono); +} + +a { + color: var(--ink); + text-decoration: underline; + text-decoration-color: var(--underline); + text-decoration-thickness: 1px; + text-underline-offset: 3px; + transition: text-decoration-color 160ms var(--ease-out); +} +a:hover { + text-decoration-color: var(--ink); +} + +button { + font: inherit; +} + +/* Shell */ + +.topbar { + position: sticky; + top: 0; + z-index: 10; + display: flex; + align-items: center; + gap: var(--s8); + min-height: 52px; + padding: 0 var(--s6); + background: var(--sheet); + border-bottom: 1px solid var(--line); +} + +.brand { + display: inline-flex; + align-items: center; + gap: var(--s2); + font-weight: 650; + letter-spacing: -0.01em; + text-decoration: none; + white-space: nowrap; +} +.brand-mark { + flex: none; + width: 18px; + height: 18px; + color: var(--wall); +} +.brand small { + color: var(--ink-3); + font-size: 13px; + font-weight: 500; +} + +.nav { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--s1) var(--s5); + font-size: 14px; +} +.nav a { + position: relative; + margin: 0 calc(-1 * var(--s1)); + padding: var(--s3) var(--s1); + color: var(--ink-2); + text-decoration: none; +} +.nav a:hover { + color: var(--ink); +} +.nav a[data-status='active'] { + color: var(--route); +} +.nav a[data-status='active']::after { + content: ''; + position: absolute; + inset: auto var(--s1) 0; + height: 2px; + background: var(--route); +} +.nav-group { + display: inline-flex; + align-items: center; + gap: var(--s4); + padding-left: var(--s5); + border-left: 1px solid var(--line); +} + +/* Whether the page has hydrated: a hollow plan dot until then. */ +.status { + display: inline-flex; + align-items: center; + gap: var(--s2); + margin: 0 0 0 auto; + color: var(--ink-3); + font-size: 13px; + white-space: nowrap; +} +.status::before { + content: ''; + width: 8px; + height: 8px; + border: 2px solid var(--ink-3); + border-radius: 50%; +} +.status.hydrated { + color: var(--ink); +} +.status.hydrated::before { + background: var(--wall); + border-color: var(--wall); +} + +.page { + max-width: 1080px; + margin: 0 auto; + padding: var(--s10) var(--s6) 120px; +} + +.lead { + color: var(--ink-2); + font-size: 17px; +} + +/* Rooms: the signature. A module's region is a room with a wall line, its + zoning tint, and a tag on the wall naming the package and its mount. */ + +.room { + margin-top: var(--s5); + padding: 0 var(--s6) var(--s6); + background: var(--zone) padding-box; + border: var(--wall-line); + animation: room-in 420ms var(--ease-out); +} +.room .room { + margin-top: var(--s8); +} +.room > :last-child { + margin-bottom: 0; +} +/* A room's title has one size whatever its level. */ +.room h1 { + font-size: 22px; +} + +/* The tag sits on the wall: pulled up onto its center line, it wraps on + narrow screens instead of clipping the resolved path. Names and paths keep + their source case: they are identifiers maintainers copy. */ +.room-tag { + display: flex; + flex-wrap: wrap; + align-items: baseline; + gap: 0 var(--s2); + width: fit-content; + max-width: 100%; + margin: -14px 0 var(--s5) calc(var(--s4) - var(--s6)); + padding: 2px var(--s2); + background: var(--sheet); + border: 1px solid var(--wall); + font: 600 12px/16px var(--font-lettering); + font-stretch: condensed; + font-variant-numeric: tabular-nums; + letter-spacing: 0.04em; +} +.room-tag code { + font: 500 11px/16px var(--mono); + color: var(--ink-2); +} +.room-tag .resolved { + color: var(--route); +} + +@keyframes room-in { + from { + background-color: var(--sheet); + } +} + +/* Lists, facts and controls inside rooms */ + +.rows { + margin: 0 0 var(--s4); + padding: 0; + list-style: none; + font-variant-numeric: tabular-nums; + border-top: 1px solid color-mix(in srgb, var(--wall) 22%, transparent); +} +.rows > li { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: var(--s4); + padding: var(--s3) 0; + border-bottom: 1px solid color-mix(in srgb, var(--wall) 22%, transparent); +} + +.rows .meta { + color: var(--ink-3); + font-size: 13px; +} + +.facts { + display: grid; + grid-template-columns: max-content 1fr; + align-items: baseline; + gap: var(--s2) var(--s6); + margin: 0 0 var(--s5); + font-variant-numeric: tabular-nums; +} +.facts dt { + color: var(--ink-3); + font-size: 13px; +} +.facts dd { + margin: 0; +} + +.actions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--s3) var(--s5); +} + +.button { + display: inline-flex; + align-items: center; + min-height: 36px; + padding: 0 var(--s4); + color: var(--sheet); + background: var(--wall); + border: 0; + border-radius: 6px; + font-weight: 600; + font-size: 14px; + cursor: pointer; + transition: + background-color 160ms var(--ease-out), + transform 160ms var(--ease-out); +} +.button:hover { + background: var(--ink); +} +.button:active { + transform: translateY(1px); +} +.button[aria-busy='true'] { + background: var(--ink-3); + cursor: progress; +} + +.price { + margin: 0 0 var(--s4); + font-size: 22px; + font-weight: 600; + font-variant-numeric: tabular-nums; + letter-spacing: -0.01em; +} + +.server-state { + margin: 0 0 var(--s5); + padding: var(--s3) 0; + border-block: 1px solid color-mix(in srgb, var(--wall) 22%, transparent); + color: var(--ink-2); + font-size: 14px; +} +.server-state p { + margin: 0; +} + +.data { + font: 500 13px var(--mono); + font-variant-numeric: tabular-nums; +} +/* A value the server just sent again: one pass of a highlighter. */ +.fresh { + animation: fresh 1600ms var(--ease-out); +} +@keyframes fresh { + from { + background-color: #f7e7a1; + } +} + +/* Key plan on the home page: every room where the application mounts it. + A host route that is not a module is a plot boundary around its rooms. */ + +.plan { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + align-items: start; + gap: var(--s8) var(--s6); + margin-top: var(--s10); +} +.plan .room { + margin-top: 0; +} +.plan .room .room { + margin-top: var(--s6); +} +.plan .room > p:not(.room-tag) { + color: var(--ink-2); +} +.plot { + grid-column: 1 / -1; + padding: 0 var(--s6) var(--s6); + border: 1.5px dashed var(--ink-3); +} +.plot-rooms { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + align-items: start; + gap: var(--s8) var(--s6); + padding-top: var(--s3); +} +.plot > .room-tag { + margin-top: -12px; + margin-bottom: var(--s4); + border-style: dashed; + border-color: var(--ink-3); + font-weight: 500; +} + +@media (max-width: 720px) { + .topbar { + position: static; + flex-wrap: wrap; + gap: 0 var(--s4); + padding: var(--s2) var(--s4) 0; + } + /* One scrolling row below the brand. */ + .nav { + order: 1; + flex-basis: 100%; + flex-wrap: nowrap; + gap: var(--s2); + overflow-x: auto; + scrollbar-width: none; + } + .nav a, + .nav-group { + flex: none; + } + .nav-group { + gap: var(--s2); + padding-left: var(--s2); + } + .page { + padding: var(--s6) var(--s4) 120px; + } + .room { + padding: 0 var(--s4) var(--s4); + } + .room-tag { + margin-left: 0; + } + .plan { + grid-template-columns: minmax(0, 1fr); + } + .plot { + padding: 0 var(--s4) var(--s4); + } +} + +@media (prefers-reduced-motion: reduce) { + .room, + .fresh { + animation: none; + } +} diff --git a/e2e/react-start/route-modules/packages/web/tsconfig.json b/e2e/react-start/route-modules/packages/web/tsconfig.json new file mode 100644 index 0000000000..afc3c82faa --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ES2022", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "allowImportingTsExtensions": true, + "types": ["vite/client"] + }, + "include": ["src", "vite.config.ts", "rsbuild.config.ts", "route-modules.ts"] +} diff --git a/e2e/react-start/route-modules/packages/web/vite.config.ts b/e2e/react-start/route-modules/packages/web/vite.config.ts new file mode 100644 index 0000000000..e1b72534ea --- /dev/null +++ b/e2e/react-start/route-modules/packages/web/vite.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from 'vite' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import viteReact from '@vitejs/plugin-react' +import { routeModules } from './route-modules.ts' + +// The e2e build of each toolchain and mode writes to its own directory. +const outDir = process.env.E2E_DIST_DIR ?? 'dist' + +export default defineConfig({ + build: { + outDir, + }, + plugins: [tanstackStart({ router: { routeModules } }), viteReact()], +}) diff --git a/e2e/react-start/route-modules/playwright.config.ts b/e2e/react-start/route-modules/playwright.config.ts new file mode 100644 index 0000000000..dea91cd1a1 --- /dev/null +++ b/e2e/react-start/route-modules/playwright.config.ts @@ -0,0 +1,31 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` +// Nx builds the application with the toolchain of each mode into +// `E2E_DIST_DIR` (`build::ssr` publishes the route modules first); +// this serves that build. Module files are compiled from source by the +// application. +const command = `cd packages/web && NODE_ENV=production PORT=${PORT} pnpm start` + +export default defineConfig({ + testDir: './e2e', + workers: 1, + reporter: [['line']], + use: { + baseURL, + }, + webServer: { + command, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-start/route-modules/playwright.dev.config.ts b/e2e/react-start/route-modules/playwright.dev.config.ts new file mode 100644 index 0000000000..2c920320a9 --- /dev/null +++ b/e2e/react-start/route-modules/playwright.dev.config.ts @@ -0,0 +1,30 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const toolchain = process.env.E2E_TOOLCHAIN ?? 'vite' +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +const baseURL = `http://localhost:${PORT}` +// Development: the Start dev server of the toolchain renders module routes, +// runs their server functions and hot-updates their files. +const command = `node scripts/prepare.mjs && pnpm --filter @start-route-modules/web dev:${toolchain} --host 0.0.0.0 --port ${PORT}` + +export default defineConfig({ + testDir: './e2e-dev', + workers: 1, + reporter: [['line']], + use: { + baseURL, + }, + webServer: { + command, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [ + { + name: 'chromium', + use: { ...devices['Desktop Chrome'] }, + }, + ], +}) diff --git a/e2e/react-start/route-modules/scripts/prepare.mjs b/e2e/react-start/route-modules/scripts/prepare.mjs new file mode 100644 index 0000000000..4e4c927b79 --- /dev/null +++ b/e2e/react-start/route-modules/scripts/prepare.mjs @@ -0,0 +1,43 @@ +// Generates routes and builds declarations with the packages' TypeScript +// projects. The application's route tree is generated by the Start plugin. +// +// The modules list `@tanstack/router-core` (and the catalog +// `@tanstack/start-client-core`) as dev dependencies only because the fixture +// links the framework packages from the workspace: TypeScript names the types +// of a linked package's dependencies by their own package name. Installed from +// a registry, the declarations name them through `@tanstack/react-router` and +// `@tanstack/react-start`, the only packages modules need. +import { spawnSync } from 'node:child_process' +import { rmSync } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { Generator, getConfig } from '@tanstack/router-generator' + +const packages = path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + '../packages', +) + +const tsc = path.resolve( + packages, + '../../../../node_modules/.bin', + process.platform === 'win32' ? 'tsc.cmd' : 'tsc', +) + +for (const name of ['catalog', 'notes', 'settings', 'team']) { + const root = path.join(packages, name) + const config = getConfig({ disableLogging: true }, root) + await new Generator({ config, root }).run() + rmSync(path.join(root, '.tanstack/types'), { recursive: true, force: true }) + const result = spawnSync( + tsc, + ['-p', 'tsconfig.route-types.json', '--pretty', 'false'], + { cwd: root, stdio: 'inherit', shell: process.platform === 'win32' }, + ) + if (result.error) { + throw result.error + } + if (result.status !== 0) { + process.exit(result.status ?? 1) + } +} diff --git a/e2e/react-start/route-modules/tests/start-modules.test.ts b/e2e/react-start/route-modules/tests/start-modules.test.ts new file mode 100644 index 0000000000..b5aec7e6ee --- /dev/null +++ b/e2e/react-start/route-modules/tests/start-modules.test.ts @@ -0,0 +1,377 @@ +import path from 'node:path' +import { + existsSync, + mkdirSync, + readFileSync, + realpathSync, + rmSync, + symlinkSync, + writeFileSync, +} from 'node:fs' +import { Generator, getConfig } from '@tanstack/router-generator' +import { afterEach, beforeEach, describe, expect, it } from 'vitest' +import { Workspace, errorsIn } from './workspace' + +let workspace: Workspace + +beforeEach(() => { + workspace = new Workspace() +}) + +afterEach(() => { + workspace.dispose() +}) + +async function publishModules() { + for (const name of ['catalog', 'notes', 'settings', 'team']) { + const result = await workspace.publish(name) + expect(result.diagnostics, name).toEqual([]) + } +} + +describe('Start route modules', () => { + it.each([ + { + specifier: 'http', + importedType: 'IncomingMessage', + requiredContext: '{ request: IncomingMessage }', + validConsumer: + 'export const method: string | undefined = context.request.method', + invalidConsumer: 'export const invalid: number = context.request.method', + }, + { + specifier: '#request-context', + importedType: 'RequestContext', + requiredContext: 'RequestContext', + validConsumer: 'export const traceId: string = context.traceId', + invalidConsumer: 'export const invalid: number = context.traceId', + }, + ])( + 'consumes published requirements that import $specifier', + async ({ + specifier, + importedType, + requiredContext, + validConsumer, + invalidConsumer, + }) => { + const catalog = workspace.pkg('catalog') + const app = workspace.pkg('web') + rmSync(path.join(catalog, 'src'), { recursive: true, force: true }) + mkdirSync(path.join(catalog, 'src/routes'), { recursive: true }) + if (specifier === 'http') { + const nodeTypes = path.join(catalog, 'node_modules/@types/node') + mkdirSync(path.dirname(nodeTypes), { recursive: true }) + if (!existsSync(nodeTypes)) { + symlinkSync( + realpathSync( + path.resolve( + import.meta.dirname, + '../../../../node_modules/@types/node', + ), + ), + nodeTypes, + 'dir', + ) + } + workspace.edit('catalog', 'package.json', (source) => { + const pkg = JSON.parse(source) + pkg.devDependencies['@types/node'] = '*' + return JSON.stringify(pkg) + }) + workspace.edit('catalog', 'tsconfig.json', (source) => { + const config = JSON.parse(source) + config.compilerOptions.types = ['node'] + return JSON.stringify(config) + }) + } else { + mkdirSync(path.join(catalog, 'types'), { recursive: true }) + writeFileSync( + path.join(catalog, 'types/request-context.d.ts'), + 'export interface RequestContext { traceId: string }\n', + ) + workspace.edit('catalog', 'package.json', (source) => { + const pkg = JSON.parse(source) + pkg.imports = { '#request-context': './types/request-context.d.ts' } + return JSON.stringify(pkg) + }) + } + writeFileSync( + path.join(catalog, 'src/requirements.ts'), + `export type { StartModuleRequirements } from '@tanstack/react-start' +import type { ${importedType} } from '${specifier}' +declare module '@tanstack/react-start' { + interface StartModuleRequirements { + '@start-route-modules/catalog': { requestContext: ${requiredContext} } + } +} +`, + ) + writeFileSync( + path.join(catalog, 'src/routes/__root.tsx'), + `export type {} from '../requirements' +import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({}) +`, + ) + const published = await workspace.publish('catalog') + expect(published.diagnostics).toEqual([]) + expect( + readFileSync( + path.join(catalog, '.tanstack/types/src/requirements.d.ts'), + 'utf8', + ), + ).toContain(`from '${specifier}'`) + + rmSync(path.join(app, 'src'), { recursive: true, force: true }) + mkdirSync(path.join(app, 'src/routes'), { recursive: true }) + writeFileSync( + path.join(app, 'src/routes/__root.tsx'), + `import { createRootRoute } from '@tanstack/react-router' +export const Route = createRootRoute() +`, + ) + writeFileSync( + path.join(app, 'src/request-context.ts'), + `import type { StartModuleRequirements } from '@tanstack/react-start' +type RequiredContext = StartModuleRequirements['@start-route-modules/catalog']['requestContext'] +declare module '@tanstack/react-start' { + interface Register { server: { requestContext: RequiredContext } } +} +declare const context: RequiredContext +${validConsumer} +// @ts-expect-error Published requirement imports preserve their field types. +${invalidConsumer} +`, + ) + workspace.edit('web', 'tsconfig.json', (source) => { + const config = JSON.parse(source) + config.compilerOptions.skipLibCheck = false + config.compilerOptions.types = ['node'] + config.include = ['src'] + return JSON.stringify(config) + }) + await new Generator({ + root: app, + config: getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace.root, '.tmp'), + routeModules: { includes: ['@start-route-modules/catalog'] }, + }, + app, + ), + }).run() + rmSync(path.join(catalog, 'src'), { recursive: true, force: true }) + expect(workspace.checkApp().diagnostics).toEqual([]) + }, + ) + + it('checks published requirements-only modules against the default Start instance', async () => { + const catalog = workspace.pkg('catalog') + const app = workspace.pkg('web') + rmSync(path.join(catalog, 'src'), { recursive: true, force: true }) + mkdirSync(path.join(catalog, 'src/routes'), { recursive: true }) + writeFileSync( + path.join(catalog, 'src/requirements.ts'), + `export type { StartModuleRequirements } from '@tanstack/react-start' +declare module '@tanstack/react-start' { + interface StartModuleRequirements { + '@start-route-modules/catalog': { requestContext: { shopper: string } } + } +} +`, + ) + writeFileSync( + path.join(catalog, 'src/routes/__root.tsx'), + `export type {} from '../requirements' +import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({}) +`, + ) + writeFileSync( + path.join(catalog, 'src/routes/index.tsx'), + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@start-route-modules/catalog:/')({}) +`, + ) + const published = await workspace.publish('catalog') + expect(published.diagnostics).toEqual([]) + + rmSync(path.join(app, 'src'), { recursive: true, force: true }) + mkdirSync(path.join(app, 'src/routes'), { recursive: true }) + writeFileSync( + path.join(app, 'src/routes/__root.tsx'), + `import { createRootRoute } from '@tanstack/react-router' +export const Route = createRootRoute() +`, + ) + workspace.edit('web', 'tsconfig.json', (source) => { + const config = JSON.parse(source) + config.compilerOptions.skipLibCheck = false + config.compilerOptions.types = ['node'] + config.include = ['src'] + return JSON.stringify(config) + }) + await new Generator({ + root: app, + config: getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace.root, '.tmp'), + routeModules: { + includes: [ + { + module: '@start-route-modules/catalog', + as: 'requirementsOnly', + at: '/catalog', + }, + ], + }, + }, + app, + ), + }).run() + + // Consumer checking must load the augmentation from the published contract. + rmSync(path.join(catalog, 'src'), { recursive: true, force: true }) + const missing = workspace.checkApp() + expect(missing.ok).toBe(false) + expect( + errorsIn(missing.diagnostics, 'startModules.gen.ts').join('\n'), + ).toContain( + "Route module '@start-route-modules/catalog' requires request context 'shopper' that is not provided from application middleware", + ) + + // handler.fetch can satisfy requirements without a custom Start instance. + writeFileSync( + path.join(app, 'src/request-context.ts'), + `import '@tanstack/react-start' +declare module '@tanstack/react-start' { + interface Register { + server: { requestContext: { shopper: string } } + } +} +`, + ) + expect(workspace.checkApp().diagnostics).toEqual([]) + }) + + it('the application type-checks against the published modules', async () => { + await publishModules() + await workspace.generateApp() + + expect((await workspace.checkApp()).diagnostics).toEqual([]) + }) + + it('the application must provide the request context a module requires', async () => { + await publishModules() + workspace.edit('web', 'src/start.ts', (source) => + source.replace(' requestMiddleware: [shopper],\n', ''), + ) + await workspace.generateApp() + + const result = await workspace.checkApp() + expect(result.ok).toBe(false) + expect( + errorsIn(result.diagnostics, 'startModules.gen.ts').join('\n'), + ).toContain( + "Route module '@start-route-modules/catalog' requires request context 'shopper' that is not provided from application middleware", + ) + }) + + it('the application must install the fragments of its modules', async () => { + await publishModules() + workspace.edit('web', 'src/start.ts', (source) => + source.replace(' extends: startModules,\n', ''), + ) + await workspace.generateApp() + + const result = await workspace.checkApp() + expect(result.ok).toBe(false) + expect( + errorsIn(result.diagnostics, 'startModules.gen.ts').join('\n'), + ).toContain( + "Route module '@start-route-modules/catalog' is not installed: add 'extends: startModules' to createStart()", + ) + }) + + it("a module's server functions and loaders are validated against its fragment", async () => { + workspace.edit('catalog', 'src/start.ts', (source) => + source.replace(' serializationAdapters: [moneyAdapter],\n', ''), + ) + + const result = await workspace.publish('catalog') + expect(result.ok).toBe(false) + // `Money` has a method, so it is only serializable with the adapter. + const diagnostics = result.diagnostics.join('\n') + expect(diagnostics).toMatch(/src\/api\.ts\(\d+,\d+\): error TS2345/) + expect(diagnostics).toContain('Function may not be serializable') + }) + + it("the application serializes a router-only module's results", async () => { + workspace.edit('notes', 'src/routes/index.tsx', (source) => + source.replace( + "loader: () => ({ notes: ['Compose route modules', 'Ship it'] }),", + "loader: () => ({ notes: ['Compose route modules'], open: () => {} }),", + ), + ) + await publishModules() + await workspace.generateApp() + + const result = await workspace.checkApp() + expect(result.ok).toBe(false) + expect( + errorsIn(result.diagnostics, 'routeTree.gen.ts').join('\n'), + ).toContain( + "Route module '@start-route-modules/notes' returns loader or beforeLoad results from '@start-route-modules/notes:/' that the application cannot serialize", + ) + }) + + // The generated scope of a Start module imports private bindings of the + // same names; the namespace export must not collide with them. + it.each(['bindRouteScopeLink', 'createStartServerFn'])( + 'a module may name a used module %s', + async (alias) => { + workspace.edit('team', 'package.json', (source) => { + const manifest = JSON.parse(source) + manifest.tanstack.router.module.uses = [ + { module: '@start-route-modules/settings', as: alias }, + ] + return JSON.stringify(manifest, null, 2) + }) + workspace.edit('team', 'src/routes/index.tsx', (source) => + source.replace( + 'import { Link, createFileRoute, settings } from', + `import { Link, createFileRoute, ${alias} as settings } from`, + ), + ) + writeFileSync( + path.join(workspace.pkg('team'), 'src/consumer.ts'), + `import { ${alias}, linkOptions, createServerFn } from './routeScope.gen' +export const ownLink = linkOptions({ to: '/' }) +export const dependencyLink = ${alias}.linkOptions({ to: '/profile' }) +export const serverFn = createServerFn().handler(() => 'ok') +`, + ) + for (const name of ['settings', 'team']) { + const result = await workspace.publish(name) + expect(result.diagnostics, name).toEqual([]) + } + // The dependency namespace retains its provider's local paths. The + // source check reads the real contract; the declaration build above + // compiled against a stand-in. + writeFileSync( + path.join(workspace.pkg('team'), 'src/outside.ts'), + `import { ${alias} } from './routeScope.gen' +export const outside = ${alias}.linkOptions({ to: '/outside' }) +`, + ) + const check = await workspace.check('team') + expect(check.ok).toBe(false) + expect(errorsIn(check.diagnostics, 'src/outside.ts').join('\n')).toMatch( + /outside/, + ) + }, + ) +}) diff --git a/e2e/react-start/route-modules/tests/workspace.ts b/e2e/react-start/route-modules/tests/workspace.ts new file mode 100644 index 0000000000..dec95f869b --- /dev/null +++ b/e2e/react-start/route-modules/tests/workspace.ts @@ -0,0 +1,234 @@ +import path from 'node:path' +import os from 'node:os' +import crypto from 'node:crypto' +import { spawnSync } from 'node:child_process' +import { + cpSync, + existsSync, + mkdirSync, + readFileSync, + readdirSync, + realpathSync, + rmSync, + symlinkSync, + writeFileSync, +} from 'node:fs' +import { fileURLToPath } from 'node:url' +import { Generator, getConfig } from '@tanstack/router-generator' + +const here = path.dirname(fileURLToPath(import.meta.url)) +const fixtureRoot = path.resolve(here, '../packages') +const repoRoot = path.resolve(here, '../../../..') +/** The repository's TypeScript compiler (`tsc` of `@typescript/native`). */ +const tsc = path.join(repoRoot, 'node_modules', '.bin', 'tsc') + +const workspaceScope = '@start-route-modules/' +const generatedFile = /\.gen(?:\.[^.]+)?\.tsx?$/ + +/** The application's route modules (`vite.config.ts`). */ +const routeModules = { + includes: [ + { module: '@start-route-modules/catalog', at: '/shop' }, + { module: '@start-route-modules/notes', at: '/notes' }, + { + module: '@start-route-modules/team', + parent: '/orgs/$orgId', + at: '/team', + }, + { + module: '@start-route-modules/settings', + parent: '/orgs/$orgId', + at: '/settings', + as: 'orgSettings', + }, + { + module: '@start-route-modules/settings', + parent: '/people/$personId', + at: '/settings', + as: 'personSettings', + }, + ], +} + +/** The route tree footer the TanStack Start plugin generates. */ +const startFooter = [ + `import type { getRouter } from './router.tsx' +import type { startInstance } from './start.ts' +declare module '@tanstack/react-start' { + interface Register { + ssr: true + router: Awaited> + config: Awaited> + } +}`, +] + +function listDependencies(nodeModules: string): Array { + if (!existsSync(nodeModules)) { + return [] + } + const entries: Array = [] + for (const entry of readdirSync(nodeModules)) { + if (entry.startsWith('.')) { + continue + } + if (entry.startsWith('@')) { + for (const scoped of readdirSync(path.join(nodeModules, entry))) { + entries.push(`${entry}/${scoped}`) + } + } else { + entries.push(entry) + } + } + return entries +} + +/** + * A copy of the fixture packages in a temporary directory. Workspace route + * modules are linked to their copies; every other dependency is linked to the + * package the repository installed. Nothing generated is copied. + */ +export class Workspace { + readonly root: string + + constructor() { + const dir = path.join( + os.tmpdir(), + `tsr-start-route-modules-${crypto.randomBytes(4).toString('hex')}`, + ) + mkdirSync(dir, { recursive: true }) + this.root = realpathSync(dir) + for (const name of ['catalog', 'notes', 'settings', 'team', 'web']) { + this.addPackage(name) + } + } + + private addPackage(name: string) { + const from = path.join(fixtureRoot, name) + const to = this.pkg(name) + cpSync(from, to, { + recursive: true, + filter: (file) => + !file.includes(`${path.sep}node_modules`) && + !file.includes(`${path.sep}.tanstack`) && + !file.includes(`${path.sep}dist`) && + !generatedFile.test(file), + }) + for (const dependency of listDependencies( + path.join(from, 'node_modules'), + )) { + const link = path.join(to, 'node_modules', dependency) + mkdirSync(path.dirname(link), { recursive: true }) + const target = dependency.startsWith(workspaceScope) + ? this.pkg(dependency.slice(workspaceScope.length)) + : realpathSync(path.join(from, 'node_modules', dependency)) + symlinkSync(target, link, 'dir') + } + } + + pkg(name: string) { + return path.join(this.root, name) + } + + edit(name: string, file: string, edit: (content: string) => string) { + const full = path.join(this.pkg(name), file) + const before = readFileSync(full, 'utf8') + const after = edit(before) + if (after === before) { + throw new Error(`The edit of ${name}/${file} changed nothing`) + } + writeFileSync(full, after) + } + + /** Generates and publishes a route module. */ + async publish(name: string) { + const root = this.pkg(name) + await new Generator({ + config: getConfig( + { disableLogging: true, tmpDir: path.join(this.root, '.tmp') }, + root, + ), + root, + }).run() + const project = JSON.parse( + readFileSync(path.join(root, 'tsconfig.route-types.json'), 'utf8'), + ) + rmSync( + path.resolve( + root, + project.compilerOptions.declarationDir ?? + project.compilerOptions.outDir, + ), + { recursive: true, force: true }, + ) + return this.compile(name, ['-p', 'tsconfig.route-types.json']) + } + + /** Generates the application's route tree like the Start plugin does. */ + async generateApp() { + const root = this.pkg('web') + const config = getConfig( + { + disableLogging: true, + tmpDir: path.join(this.root, '.tmp'), + target: 'react', + routeModules, + routeTreeFileFooter: startFooter, + }, + root, + ) + await new Generator({ config, root }).run() + } + + /** Type-checks the application against the published modules. */ + checkApp() { + return this.check('web') + } + + /** Type-checks a package's sources against the published contracts it uses. */ + check(name: string) { + return this.compile(name, ['-p', 'tsconfig.json', '--noEmit']) + } + + private compile(name: string, args: Array) { + const result = spawnSync(tsc, [...args, '--pretty', 'false'], { + cwd: this.pkg(name), + encoding: 'utf8', + }) + return { + ok: result.status === 0, + diagnostics: result.error + ? [result.error.message] + : `${result.stdout ?? ''}${result.stderr ?? ''}` + .split(/\r?\n/) + .filter((line) => line.trim() !== ''), + } + } + + dispose() { + rmSync(this.root, { recursive: true, force: true }) + } +} + +/** The diagnostics of a failed check that point into `file`. */ +export function errorsIn(diagnostics: Array, file: string) { + const errors: Array = [] + let current: string | undefined + for (const line of diagnostics) { + if (/^\s/.test(line)) { + if (current !== undefined) { + current += `\n${line}` + } + continue + } + if (current !== undefined) { + errors.push(current) + } + current = + line.startsWith(file) || line.includes(`/${file}(`) ? line : undefined + } + if (current !== undefined) { + errors.push(current) + } + return errors +} diff --git a/e2e/react-start/route-modules/tsconfig.json b/e2e/react-start/route-modules/tsconfig.json new file mode 100644 index 0000000000..341902faed --- /dev/null +++ b/e2e/react-start/route-modules/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "strict": true, + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "skipLibCheck": true, + "noEmit": true, + "types": ["node"] + }, + "include": [ + "tests", + "e2e", + "e2e-dev", + "scripts", + "vitest.config.ts", + "playwright.config.ts", + "playwright.dev.config.ts" + ] +} diff --git a/e2e/react-start/route-modules/vitest.config.ts b/e2e/react-start/route-modules/vitest.config.ts new file mode 100644 index 0000000000..a2233ebb31 --- /dev/null +++ b/e2e/react-start/route-modules/vitest.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from 'vitest/config' + +export default defineConfig({ + test: { + include: ['tests/**/*.test.ts'], + // Each test runs the generator and the TypeScript compiler on a workspace. + testTimeout: 120_000, + hookTimeout: 120_000, + fileParallelism: false, + }, +}) diff --git a/e2e/solid-router/route-modules/.gitignore b/e2e/solid-router/route-modules/.gitignore new file mode 100644 index 0000000000..18dd57830b --- /dev/null +++ b/e2e/solid-router/route-modules/.gitignore @@ -0,0 +1,2 @@ +# Generated during the e2e preparation/build, never checked in. +**/route*.gen*.ts diff --git a/e2e/solid-router/route-modules/e2e/scope-parity.spec.ts b/e2e/solid-router/route-modules/e2e/scope-parity.spec.ts new file mode 100644 index 0000000000..7df9034013 --- /dev/null +++ b/e2e/solid-router/route-modules/e2e/scope-parity.spec.ts @@ -0,0 +1,177 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' + +for (const base of ['/orgs/7/settings', '/users/u1/settings']) { + test(`RouteApi and custom links resolve ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await expect( + page.getByRole('link', { name: 'API members' }), + ).toHaveAttribute('href', `${base}/members`) + await expect( + page.getByRole('link', { name: 'Custom members' }), + ).toHaveAttribute('href', `${base}/members`) + expect( + await page + .getByRole('link', { name: 'API members' }) + .getAttribute('_module'), + ).toBeNull() + expect( + await page + .getByRole('link', { name: 'Custom members' }) + .getAttribute('_module'), + ).toBeNull() + const hostId = base.split('/')[2]! + const hostParams = base.startsWith('/orgs/') + ? { orgId: hostId } + : base.startsWith('/people/') + ? { personId: hostId } + : { userId: hostId } + await expect(page.getByTestId('runtime-params')).toHaveText( + JSON.stringify(hostParams), + ) + await expect(page.getByText('PROFILE_MATCH', { exact: true })).toBeVisible() + await expect(page.getByText('MEMBERS_MATCH', { exact: true })).toHaveCount( + 0, + ) + await page.getByRole('link', { name: 'API members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test(`useLinkProps navigates within the document under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + await expect( + page.getByRole('link', { name: 'Custom members' }), + ).toBeVisible() + const documentRequests: Array = [] + page.on('request', (request) => { + if ( + request.isNavigationRequest() && + request.frame() === page.mainFrame() + ) { + documentRequests.push(request.url()) + } + }) + await page.getByRole('link', { name: 'Custom members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + expect(documentRequests).toEqual([]) + }) + + test(`RouteApi navigation resolves ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await page.getByRole('button', { name: 'Navigate members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test(`Navigate captures installation under ${base}`, async ({ page }) => { + await page.goto(`${base}/forward`) + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test(`component notFound reaches module boundary under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/missing`) + await expect(page.getByText('MODULE_NOT_FOUND')).toBeVisible() + }) + for (const button of ['Route up', 'Explicit from home']) { + test(`${button} uses the route origin under ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await page.getByRole('button', { name: button, exact: true }).click() + await expect(page).toHaveURL(base) + await expect( + page.getByRole('link', { name: 'Profile', exact: true }), + ).toHaveAttribute('href', `${base}/profile`) + }) + } + + test(`scoped router view builds and navigates under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + await expect(page.getByTestId('scoped-href')).toHaveText(`${base}/members`) + await page.getByRole('button', { name: 'Router members' }).click() + await expect(page).toHaveURL(`${base}/members`) + const profile = page.getByRole('link', { name: 'Profile', exact: true }) + await expect(profile).toHaveAttribute('href', `${base}/profile`) + await profile.click() + await expect(page).toHaveURL(`${base}/profile`) + }) + + test(`Route.Link keeps the installation under ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + const home = page.getByRole('link', { name: 'Route home', exact: true }) + await expect(home).toHaveAttribute('href', base) + await home.click() + await expect(page).toHaveURL(base) + await expect( + page.getByRole('link', { name: 'Profile', exact: true }), + ).toHaveAttribute('href', `${base}/profile`) + }) + + test(`scoped lifecycle redirects retain the installation under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/legacy`) + await expect(page).toHaveURL(`${base}/profile`) + await expect(page.getByText('PROFILE_MATCH', { exact: true })).toBeVisible() + }) + + test(`framework imports keep application coordinates inside ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + const host = page.getByRole('link', { name: 'Organization host' }) + await expect(host).toHaveAttribute('href', '/orgs/7') + await host.click() + await expect(page).toHaveURL('/orgs/7') + }) +} + +test('module observers and router views follow real installation changes', async ({ + page, +}) => { + await page.goto('/orgs/7/settings/profile') + await expect(page.getByTestId('organization-profile')).toHaveText( + '@route-modules/solid-settings#orgSettings:/profile', + ) + await expect(page.getByTestId('scoped-href')).toHaveText( + '/orgs/7/settings/members', + ) + await page.getByRole('link', { name: 'API members' }).click() + await expect(page).toHaveURL('/orgs/7/settings/members') + await page.getByRole('link', { name: 'Switch to person' }).click() + await expect(page).toHaveURL('/users/u1/settings/profile') + await expect(page.getByTestId('organization-profile')).toHaveText('none') + await expect(page.getByTestId('scoped-href')).toHaveText( + '/users/u1/settings/members', + ) + await page.getByRole('link', { name: 'Switch to organization' }).click() + await expect(page).toHaveURL('/orgs/7/settings/profile') + await expect(page.getByRole('link', { name: 'API members' })).toHaveAttribute( + 'href', + '/orgs/7/settings/members', + ) + const readObserved = () => + page.evaluate( + () => + ( + window as Window & { + observedModuleMatches: Array + } + ).observedModuleMatches, + ) + await expect + .poll(readObserved) + .toContain('@route-modules/solid-settings#userSettings:/profile') + const observed = await readObserved() + expect(observed).toContain( + '@route-modules/solid-settings#orgSettings:/profile', + ) + expect(observed).not.toContain(undefined) +}) diff --git a/e2e/solid-router/route-modules/index.html b/e2e/solid-router/route-modules/index.html new file mode 100644 index 0000000000..fe38ed3cd4 --- /dev/null +++ b/e2e/solid-router/route-modules/index.html @@ -0,0 +1,52 @@ + + + + + Route module contracts + + + +
+ + + diff --git a/e2e/solid-router/route-modules/package.json b/e2e/solid-router/route-modules/package.json new file mode 100644 index 0000000000..e04e7428a9 --- /dev/null +++ b/e2e/solid-router/route-modules/package.json @@ -0,0 +1,29 @@ +{ + "name": "tanstack-router-e2e-solid-route-modules", + "private": true, + "type": "module", + "scripts": { + "generate": "node scripts/prepare.mjs", + "build": "node scripts/prepare.mjs && vite build && tsc --noEmit && tsc -p packages/settings/tsconfig.json --noEmit", + "preview": "vite preview", + "dev:e2e": "node scripts/prepare.mjs && vite", + "test:e2e": "playwright test --project=chromium" + }, + "dependencies": { + "@route-modules/solid-settings": "workspace:*", + "@tanstack/solid-router": "workspace:^", + "solid-js": "^1.9.10" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@tanstack/router-e2e-utils": "workspace:^", + "@tanstack/router-generator": "workspace:^", + "@tanstack/router-plugin": "workspace:^", + "@types/node": "catalog:", + "vite": "^8.0.14", + "vitest": "catalog:", + "vite-plugin-solid": "^2.11.11" + } +} diff --git a/e2e/solid-router/route-modules/packages/settings/package.json b/e2e/solid-router/route-modules/packages/settings/package.json new file mode 100644 index 0000000000..7fbb8ecee5 --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/package.json @@ -0,0 +1,37 @@ +{ + "name": "@route-modules/solid-settings", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": true + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./scope": { + "types": "./.tanstack/types/src/routeScope.gen.d.ts", + "default": "./src/routeScope.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/solid-router": "workspace:^", + "solid-js": "^1.9.10" + }, + "devDependencies": { + "@tanstack/router-core": "workspace:^", + "@tanstack/router-cli": "workspace:^" + } +} diff --git a/e2e/solid-router/route-modules/packages/settings/src/routes/__root.tsx b/e2e/solid-router/route-modules/packages/settings/src/routes/__root.tsx new file mode 100644 index 0000000000..dd5fc7db8b --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/src/routes/__root.tsx @@ -0,0 +1,8 @@ +import { Outlet } from '@tanstack/solid-router' +import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot<{ + onProfileMatch?: (routeId: string | undefined) => void +}>()({ + component: () => , + notFoundComponent: () =>

MODULE_NOT_FOUND

, +}) diff --git a/e2e/solid-router/route-modules/packages/settings/src/routes/forward.tsx b/e2e/solid-router/route-modules/packages/settings/src/routes/forward.tsx new file mode 100644 index 0000000000..dfeb7629ae --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/src/routes/forward.tsx @@ -0,0 +1,4 @@ +import { createFileRoute, Navigate } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/solid-settings:/forward')({ + component: () => , +}) diff --git a/e2e/solid-router/route-modules/packages/settings/src/routes/index.tsx b/e2e/solid-router/route-modules/packages/settings/src/routes/index.tsx new file mode 100644 index 0000000000..49521d0f90 --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/src/routes/index.tsx @@ -0,0 +1,4 @@ +import { createFileRoute, Link } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/solid-settings:/')({ + component: () => Profile, +}) diff --git a/e2e/solid-router/route-modules/packages/settings/src/routes/legacy.tsx b/e2e/solid-router/route-modules/packages/settings/src/routes/legacy.tsx new file mode 100644 index 0000000000..03de793835 --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/src/routes/legacy.tsx @@ -0,0 +1,6 @@ +import { createFileRoute, redirect } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/solid-settings:/legacy')({ + beforeLoad: () => { + throw redirect({ to: '/profile' }) + }, +}) diff --git a/e2e/solid-router/route-modules/packages/settings/src/routes/members.tsx b/e2e/solid-router/route-modules/packages/settings/src/routes/members.tsx new file mode 100644 index 0000000000..7675c942c8 --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/src/routes/members.tsx @@ -0,0 +1,11 @@ +import { createFileRoute, getRouteApi } from '../routeScope.gen' +const ProfileLink = getRouteApi('@route-modules/solid-settings:/profile').Link +export const Route = createFileRoute('@route-modules/solid-settings:/members')({ + loader: () => ({ label: 'members' as const }), + component: () => ( + <> +

MEMBERS_PAGE

+ Profile + + ), +}) diff --git a/e2e/solid-router/route-modules/packages/settings/src/routes/missing.tsx b/e2e/solid-router/route-modules/packages/settings/src/routes/missing.tsx new file mode 100644 index 0000000000..cc90818852 --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/src/routes/missing.tsx @@ -0,0 +1,6 @@ +import { createFileRoute, notFound } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/solid-settings:/missing')({ + component: () => { + throw notFound({ routeId: '@route-modules/solid-settings:' }) + }, +}) diff --git a/e2e/solid-router/route-modules/packages/settings/src/routes/profile.tsx b/e2e/solid-router/route-modules/packages/settings/src/routes/profile.tsx new file mode 100644 index 0000000000..958874d32b --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/src/routes/profile.tsx @@ -0,0 +1,79 @@ +import { createRenderEffect } from 'solid-js' +import { Link as ApplicationLink } from '@tanstack/solid-router' +import { + createFileRoute, + getRouteApi, + MatchRoute, + useLinkProps, + useNavigate, + useRouter, +} from '../routeScope.gen' +const api = getRouteApi('@route-modules/solid-settings:/profile') +export const Route = createFileRoute('@route-modules/solid-settings:/profile')({ + component: () => { + const navigate = api.useNavigate() + const routeNavigate = Route.useNavigate() + const relativeNavigate = useNavigate({ from: '/profile' }) + const anchor = useLinkProps({ to: '/members' }) + const match = Route.useMatch({ shouldThrow: false }) + const scopedRouter = useRouter() + const observe = scopedRouter.options.context?.onProfileMatch + createRenderEffect(() => observe?.(match()?.routeId)) + return ( + <> +

Profile

+

Match

+
+
Route id
+
+ {match()?.routeId} +
+
Params
+
+ + {JSON.stringify(match()?.params)} + +
+
Router href
+
+ + {scopedRouter.buildLocation({ to: '/members' }).href} + +
+
MatchRoute
+
+ + PROFILE_MATCH + + + MEMBERS_MATCH + +
+
+

Links

+

+ API members + Custom members + Route home + {/* The framework's own Link keeps application coordinates. */} + + Organization host + +

+

Navigation

+

+ + + + +

+ + ) + }, +}) diff --git a/e2e/solid-router/route-modules/packages/settings/src/routes/search.tsx b/e2e/solid-router/route-modules/packages/settings/src/routes/search.tsx new file mode 100644 index 0000000000..4b7cf73052 --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/src/routes/search.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/solid-settings:/search')({ + validateSearch: (search: { query: string }) => search, +}) diff --git a/e2e/solid-router/route-modules/packages/settings/tsconfig.json b/e2e/solid-router/route-modules/packages/settings/tsconfig.json new file mode 100644 index 0000000000..c77693ae51 --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "preserve", + "jsxImportSource": "solid-js", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/solid-router/route-modules/packages/settings/tsconfig.route-types.json b/e2e/solid-router/route-modules/packages/settings/tsconfig.route-types.json new file mode 100644 index 0000000000..0c9aec3caf --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src"] +} diff --git a/e2e/solid-router/route-modules/packages/settings/tsr.config.json b/e2e/solid-router/route-modules/packages/settings/tsr.config.json new file mode 100644 index 0000000000..078264aa1f --- /dev/null +++ b/e2e/solid-router/route-modules/packages/settings/tsr.config.json @@ -0,0 +1,3 @@ +{ + "target": "solid" +} diff --git a/e2e/solid-router/route-modules/playwright.config.ts b/e2e/solid-router/route-modules/playwright.config.ts new file mode 100644 index 0000000000..56f2d789b1 --- /dev/null +++ b/e2e/solid-router/route-modules/playwright.config.ts @@ -0,0 +1,17 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +export default defineConfig({ + testDir: './e2e', + workers: 1, + reporter: [['line']], + use: { baseURL: `http://localhost:${PORT}` }, + webServer: { + command: `pnpm build && pnpm preview --host 0.0.0.0 --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }], +}) diff --git a/e2e/solid-router/route-modules/scripts/prepare.mjs b/e2e/solid-router/route-modules/scripts/prepare.mjs new file mode 100644 index 0000000000..c7bad5c894 --- /dev/null +++ b/e2e/solid-router/route-modules/scripts/prepare.mjs @@ -0,0 +1,28 @@ +import { spawnSync } from 'node:child_process' +import { rmSync } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { Generator, getConfig } from '@tanstack/router-generator' + +const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') +const provider = path.join(root, 'packages/settings') +await new Generator({ + config: getConfig({ disableLogging: true }, provider), + root: provider, +}).run() +rmSync(path.join(provider, '.tanstack/types'), { recursive: true, force: true }) +const result = spawnSync( + 'pnpm', + ['exec', 'tsc', '-p', 'tsconfig.route-types.json', '--pretty', 'false'], + { cwd: provider, stdio: 'inherit', shell: process.platform === 'win32' }, +) +if (result.error) { + throw result.error +} +if (result.status !== 0) { + process.exit(result.status ?? 1) +} +await new Generator({ + config: getConfig({ disableLogging: true }, root), + root, +}).run() diff --git a/e2e/solid-router/route-modules/src/main.tsx b/e2e/solid-router/route-modules/src/main.tsx new file mode 100644 index 0000000000..9f01709fdb --- /dev/null +++ b/e2e/solid-router/route-modules/src/main.tsx @@ -0,0 +1,19 @@ +import { render } from 'solid-js/web' +import { RouterProvider, createRouter } from '@tanstack/solid-router' +import { routeTree } from './routeTree.gen' + +const observedModuleMatches: Array = [] +Object.assign(window, { observedModuleMatches }) +const router = createRouter({ + routeTree, + context: { onProfileMatch: (routeId) => observedModuleMatches.push(routeId) }, +}) +declare module '@tanstack/solid-router' { + interface Register { + router: typeof router + } +} +render( + () => , + document.getElementById('app')!, +) diff --git a/e2e/solid-router/route-modules/src/routes/__root.tsx b/e2e/solid-router/route-modules/src/routes/__root.tsx new file mode 100644 index 0000000000..fbc4f195e7 --- /dev/null +++ b/e2e/solid-router/route-modules/src/routes/__root.tsx @@ -0,0 +1,29 @@ +import { createRootRouteWithContext, Outlet } from '@tanstack/solid-router' +import { orgSettings, userSettings } from '../routeScope.gen' +export const Route = createRootRouteWithContext<{ + onProfileMatch?: (routeId: string | undefined) => void +}>()({ + component: () => { + const organizationProfile = orgSettings.useMatch({ + from: '@route-modules/solid-settings:/profile', + shouldThrow: false, + }) + return ( + <> + + + + ) + }, + notFoundComponent: () =>

APP_NOT_FOUND

, +}) diff --git a/e2e/solid-router/route-modules/src/routes/orgs.$orgId.tsx b/e2e/solid-router/route-modules/src/routes/orgs.$orgId.tsx new file mode 100644 index 0000000000..8a19e7b731 --- /dev/null +++ b/e2e/solid-router/route-modules/src/routes/orgs.$orgId.tsx @@ -0,0 +1,2 @@ +import { createFileRoute } from '@tanstack/solid-router' +export const Route = createFileRoute('/orgs/$orgId')({}) diff --git a/e2e/solid-router/route-modules/src/routes/users.$userId.tsx b/e2e/solid-router/route-modules/src/routes/users.$userId.tsx new file mode 100644 index 0000000000..d7bcb5d927 --- /dev/null +++ b/e2e/solid-router/route-modules/src/routes/users.$userId.tsx @@ -0,0 +1,2 @@ +import { createFileRoute } from '@tanstack/solid-router' +export const Route = createFileRoute('/users/$userId')({}) diff --git a/e2e/solid-router/route-modules/tsconfig.json b/e2e/solid-router/route-modules/tsconfig.json new file mode 100644 index 0000000000..8d28f99d15 --- /dev/null +++ b/e2e/solid-router/route-modules/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "preserve", + "jsxImportSource": "solid-js", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": false, + "noEmit": true, + "types": ["vite/client"] + }, + "include": ["src", "type-tests"] +} diff --git a/e2e/solid-router/route-modules/tsr.config.json b/e2e/solid-router/route-modules/tsr.config.json new file mode 100644 index 0000000000..99b9443380 --- /dev/null +++ b/e2e/solid-router/route-modules/tsr.config.json @@ -0,0 +1,19 @@ +{ + "target": "solid", + "routeModules": { + "includes": [ + { + "module": "@route-modules/solid-settings", + "parent": "/orgs/$orgId", + "at": "/settings", + "as": "orgSettings" + }, + { + "module": "@route-modules/solid-settings", + "parent": "/users/$userId", + "at": "/settings", + "as": "userSettings" + } + ] + } +} diff --git a/e2e/solid-router/route-modules/type-tests/scope-contracts.tsx b/e2e/solid-router/route-modules/type-tests/scope-contracts.tsx new file mode 100644 index 0000000000..bae1999534 --- /dev/null +++ b/e2e/solid-router/route-modules/type-tests/scope-contracts.tsx @@ -0,0 +1,95 @@ +import { expectTypeOf, test } from 'vitest' +import { orgSettings, userSettings } from '../src/routeScope.gen' +import * as settings from '@route-modules/solid-settings/scope' + +test('reusable options preserve their installation through spreads and arrays', () => { + const user = userSettings.linkOptions({ + to: '/members', + params: () => ({ userId: 'u1', orgId: '7' }), + }) + expectTypeOf( + user._module, + ).toEqualTypeOf<'@route-modules/solid-settings#userSettings'>() + const same = + const { _module, ...neutral } = user + const compatiblePathsAndParams = + void compatiblePathsAndParams + void _module + // @ts-expect-error An explicit sibling installation is a conflicting scope. + const different = + // @ts-expect-error Rewrapping must not erase the conflicting scope. + orgSettings.linkOptions({ ...user }) + // @ts-expect-error Arrays preserve each entry's destination scope. + orgSettings.linkOptions([user]) + // @ts-expect-error Redirects enforce the same receiving-scope contract. + orgSettings.redirect(user) + orgSettings.linkOptions({ + to: '/members', + params: { orgId: '7' }, + // @ts-expect-error A mask cannot silently retarget another installation's options. + mask: user, + }) + // @ts-expect-error Hook defaults must retain and check a reusable scope stamp. + orgSettings.useNavigate({ ...user, from: '/profile' }) + // @ts-expect-error The callback checks the same destination stamp. + orgSettings.useNavigate()(user) + void same + void different +}) + +test('module-typed helper targets only known route IDs', () => { + settings.notFound({ routeId: '@route-modules/solid-settings:' }) + settings.notFound() + // @ts-expect-error This route is not declared by the module. + settings.notFound({ routeId: '@route-modules/solid-settings:/absent' }) +}) + +test('blocker locations describe the entire application and raw URL values', () => { + settings.useBlocker({ + shouldBlockFn: ({ current, next }) => { + expectTypeOf(current.routeId).toEqualTypeOf() + expectTypeOf(next.fullPath).toEqualTypeOf() + expectTypeOf(next.params).toEqualTypeOf< + Record + >() + expectTypeOf(next.search).toEqualTypeOf>() + return false + }, + }) +}) + +test('match selectors expose foreign data and the generated guard restores known data', () => { + settings.useMatch({ + strict: false, + select: (match) => { + expectTypeOf(match.context).toBeUnknown() + expectTypeOf(match.loaderData).toBeUnknown() + return match.routeId + }, + }) + settings.useMatches({ + select: (matches) => { + expectTypeOf(matches[0]!.context).toBeUnknown() + for (const match of matches) { + if ( + settings.isScopedMatch(match) && + match.localRouteId === '@route-modules/solid-settings:/members' + ) { + expectTypeOf(match.loaderData).toEqualTypeOf< + { label: 'members' } | undefined + >() + expectTypeOf(match.fullPath).toEqualTypeOf() + } + } + return matches.length + }, + }) +}) + +test('MatchRoute accepts only the scope paths in JSX', () => { + const own = + // @ts-expect-error This path is not a module route. + const foreign = + void own + void foreign +}) diff --git a/e2e/solid-router/route-modules/type-tests/validation-aliases.tsx b/e2e/solid-router/route-modules/type-tests/validation-aliases.tsx new file mode 100644 index 0000000000..e60643b11a --- /dev/null +++ b/e2e/solid-router/route-modules/type-tests/validation-aliases.tsx @@ -0,0 +1,111 @@ +import { expectTypeOf, test } from 'vitest' +import type { orgSettings } from '../src/routeScope.gen' + +test('every generated validation alias preserves its namespace contract', () => { + type Options = { to: '/profile'; params: { orgId: '7' } } + const options: Options = { to: '/profile', params: { orgId: '7' } } + const link: orgSettings.ValidateLinkOptions = options + const links: orgSettings.ValidateLinkOptionsArray = [ + options, + ] + const navigate: orgSettings.ValidateNavigateOptions = options + const navigations: orgSettings.ValidateNavigateOptionsArray< + readonly [Options] + > = [options] + const redirect: orgSettings.ValidateRedirectOptions = options + const redirects: orgSettings.ValidateRedirectOptionsArray< + readonly [Options] + > = [options] + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + + const from: orgSettings.ValidateFromPath<'/profile'> = '/profile' + const to: orgSettings.ValidateToPath<'/profile'> = '/profile' + const search: orgSettings.ValidateSearch<'/search'> = { + search: { query: 'hello' }, + } + const params: orgSettings.ValidateParams<'/profile'> = { + params: { orgId: '7' }, + } + const id: orgSettings.ValidateId<'@route-modules/solid-settings:/profile'> = + '@route-modules/solid-settings:/profile' + const useSearch: orgSettings.ValidateUseSearchOptions<{ + from: '@route-modules/solid-settings:/profile' + }> = { from: '@route-modules/solid-settings:/profile' } + const useParams: orgSettings.ValidateUseParamsOptions<{ + from: '@route-modules/solid-settings:/profile' + }> = { from: '@route-modules/solid-settings:/profile' } + void [from, to, search, params, id, useSearch, useParams] + + const foreignPath = { + to: '/orgs/$orgId', + params: { orgId: '7' }, + } as const + const foreignPaths = [foreignPath] as const + const foreignOrigin = { from: '/orgs/$orgId' } as const + const wrongSearch = { search: { query: 42 } } + const wrongParams = { params: { userId: 'u1' } } + + // @ts-expect-error The validation alias is bound to this module's paths. + const invalidLink: orgSettings.ValidateLinkOptions = + foreignPath + // @ts-expect-error Tuple entries retain the generated scope. + const invalidLinks: orgSettings.ValidateLinkOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error Navigation wrappers cannot escape the module paths. + const invalidNavigate: orgSettings.ValidateNavigateOptions< + typeof foreignPath + > = foreignPath + // @ts-expect-error Every navigation array entry is checked. + const invalidNavigations: orgSettings.ValidateNavigateOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error Redirect wrappers retain module path validation. + const invalidRedirect: orgSettings.ValidateRedirectOptions< + typeof foreignPath + > = foreignPath + // @ts-expect-error Every redirect array entry is checked. + const invalidRedirects: orgSettings.ValidateRedirectOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error A route origin must be a path in the module. + const invalidFrom: orgSettings.ValidateFromPath<'/orgs/$orgId'> = + '/orgs/$orgId' + // @ts-expect-error A destination must be a path in the module. + const invalidTo: orgSettings.ValidateToPath<'/orgs/$orgId'> = '/orgs/$orgId' + // @ts-expect-error Search validation follows the generated route schema. + const invalidSearch: orgSettings.ValidateSearch<'/search'> = wrongSearch + // @ts-expect-error The named installation requires its own host parameter. + const invalidParams: orgSettings.ValidateParams<'/profile'> = wrongParams + // @ts-expect-error A foreign route ID is not a module route. + const invalidId: orgSettings.ValidateId<'@route-modules/solid-settings:/profile'> = + '/orgs/$orgId' + // @ts-expect-error Search selectors must name a route in this module. + const invalidUseSearch: orgSettings.ValidateUseSearchOptions< + typeof foreignOrigin + > = foreignOrigin + // @ts-expect-error Parameter selectors must name a route in this module. + const invalidUseParams: orgSettings.ValidateUseParamsOptions< + typeof foreignOrigin + > = foreignOrigin + void [ + invalidLink, + invalidLinks, + invalidNavigate, + invalidNavigations, + invalidRedirect, + invalidRedirects, + invalidFrom, + invalidTo, + invalidSearch, + invalidParams, + invalidId, + invalidUseSearch, + invalidUseParams, + ] +}) diff --git a/e2e/solid-router/route-modules/vite.config.ts b/e2e/solid-router/route-modules/vite.config.ts new file mode 100644 index 0000000000..f966227153 --- /dev/null +++ b/e2e/solid-router/route-modules/vite.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite' +import solid from 'vite-plugin-solid' +import { tanstackRouter } from '@tanstack/router-plugin/vite' + +export default defineConfig({ + plugins: [ + tanstackRouter({ target: 'solid', autoCodeSplitting: true }), + solid(), + ], +}) diff --git a/e2e/vue-router/route-modules/.gitignore b/e2e/vue-router/route-modules/.gitignore new file mode 100644 index 0000000000..18dd57830b --- /dev/null +++ b/e2e/vue-router/route-modules/.gitignore @@ -0,0 +1,2 @@ +# Generated during the e2e preparation/build, never checked in. +**/route*.gen*.ts diff --git a/e2e/vue-router/route-modules/e2e/scope-parity.spec.ts b/e2e/vue-router/route-modules/e2e/scope-parity.spec.ts new file mode 100644 index 0000000000..8fa1e060bb --- /dev/null +++ b/e2e/vue-router/route-modules/e2e/scope-parity.spec.ts @@ -0,0 +1,175 @@ +import { expect } from '@playwright/test' +import { test } from '@tanstack/router-e2e-utils' + +for (const base of ['/orgs/7/settings', '/users/u1/settings']) { + test(`RouteApi and custom links resolve ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await expect( + page.getByRole('link', { name: 'API members' }), + ).toHaveAttribute('href', `${base}/members`) + await expect( + page.getByRole('link', { name: 'Custom members' }), + ).toHaveAttribute('href', `${base}/members`) + expect( + await page + .getByRole('link', { name: 'API members' }) + .getAttribute('_module'), + ).toBeNull() + expect( + await page + .getByRole('link', { name: 'Custom members' }) + .getAttribute('_module'), + ).toBeNull() + const hostId = base.split('/')[2]! + const hostParams = base.startsWith('/orgs/') + ? { orgId: hostId } + : base.startsWith('/people/') + ? { personId: hostId } + : { userId: hostId } + await expect(page.getByTestId('runtime-params')).toHaveText( + JSON.stringify(hostParams), + ) + await expect(page.getByText('PROFILE_MATCH', { exact: true })).toBeVisible() + await expect(page.getByText('MEMBERS_MATCH', { exact: true })).toHaveCount( + 0, + ) + await page.getByRole('link', { name: 'API members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test(`useLinkProps navigates within the document under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + await expect( + page.getByRole('link', { name: 'Custom members' }), + ).toBeVisible() + const documentRequests: Array = [] + page.on('request', (request) => { + if ( + request.isNavigationRequest() && + request.frame() === page.mainFrame() + ) { + documentRequests.push(request.url()) + } + }) + await page.getByRole('link', { name: 'Custom members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + expect(documentRequests).toEqual([]) + }) + + test(`RouteApi navigation resolves ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await page.getByRole('button', { name: 'Navigate members' }).click() + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test(`Navigate captures installation under ${base}`, async ({ page }) => { + await page.goto(`${base}/forward`) + await expect(page.getByText('MEMBERS_PAGE')).toBeVisible() + await expect(page).toHaveURL(`${base}/members`) + }) + + test(`component notFound reaches module boundary under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/missing`) + await expect(page.getByText('MODULE_NOT_FOUND')).toBeVisible() + }) + for (const button of ['Route up', 'Explicit from home']) { + test(`${button} uses the route origin under ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + await page.getByRole('button', { name: button, exact: true }).click() + await expect(page).toHaveURL(base) + await expect( + page.getByRole('link', { name: 'Profile', exact: true }), + ).toHaveAttribute('href', `${base}/profile`) + }) + } + + test(`scoped router view builds and navigates under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + await expect(page.getByTestId('scoped-href')).toHaveText(`${base}/members`) + await page.getByRole('button', { name: 'Router members' }).click() + await expect(page).toHaveURL(`${base}/members`) + const profile = page.getByRole('link', { name: 'Profile', exact: true }) + await expect(profile).toHaveAttribute('href', `${base}/profile`) + await profile.click() + await expect(page).toHaveURL(`${base}/profile`) + }) + + test(`Route.Link keeps the installation under ${base}`, async ({ page }) => { + await page.goto(`${base}/profile`) + const home = page.getByRole('link', { name: 'Route home', exact: true }) + await expect(home).toHaveAttribute('href', base) + await home.click() + await expect(page).toHaveURL(base) + await expect( + page.getByRole('link', { name: 'Profile', exact: true }), + ).toHaveAttribute('href', `${base}/profile`) + }) + + test(`scoped lifecycle redirects retain the installation under ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/legacy`) + await expect(page).toHaveURL(`${base}/profile`) + await expect(page.getByText('PROFILE_MATCH', { exact: true })).toBeVisible() + }) + + test(`framework imports keep application coordinates inside ${base}`, async ({ + page, + }) => { + await page.goto(`${base}/profile`) + const host = page.getByRole('link', { name: 'Organization host' }) + await expect(host).toHaveAttribute('href', '/orgs/7') + await host.click() + await expect(page).toHaveURL('/orgs/7') + }) +} + +test('module observers and router views follow real installation changes', async ({ + page, +}) => { + await page.goto('/orgs/7/settings/profile') + await expect(page.getByTestId('organization-profile')).toHaveText( + '@route-modules/vue-settings#orgSettings:/profile', + ) + await expect(page.getByTestId('scoped-href')).toHaveText( + '/orgs/7/settings/members', + ) + await page.getByRole('link', { name: 'API members' }).click() + await expect(page).toHaveURL('/orgs/7/settings/members') + await page.getByRole('link', { name: 'Switch to person' }).click() + await expect(page).toHaveURL('/users/u1/settings/profile') + await expect(page.getByTestId('organization-profile')).toHaveText('none') + await expect(page.getByTestId('scoped-href')).toHaveText( + '/users/u1/settings/members', + ) + await page.getByRole('link', { name: 'Switch to organization' }).click() + await expect(page).toHaveURL('/orgs/7/settings/profile') + await expect(page.getByRole('link', { name: 'API members' })).toHaveAttribute( + 'href', + '/orgs/7/settings/members', + ) + const readObserved = () => + page.evaluate( + () => + ( + window as Window & { + observedModuleMatches: Array + } + ).observedModuleMatches, + ) + await expect + .poll(readObserved) + .toContain('@route-modules/vue-settings#userSettings:/profile') + const observed = await readObserved() + expect(observed).toContain('@route-modules/vue-settings#orgSettings:/profile') + expect(observed).not.toContain(undefined) +}) diff --git a/e2e/vue-router/route-modules/index.html b/e2e/vue-router/route-modules/index.html new file mode 100644 index 0000000000..fe38ed3cd4 --- /dev/null +++ b/e2e/vue-router/route-modules/index.html @@ -0,0 +1,52 @@ + + + + + Route module contracts + + + +
+ + + diff --git a/e2e/vue-router/route-modules/package.json b/e2e/vue-router/route-modules/package.json new file mode 100644 index 0000000000..ad2a94a537 --- /dev/null +++ b/e2e/vue-router/route-modules/package.json @@ -0,0 +1,29 @@ +{ + "name": "tanstack-router-e2e-vue-route-modules", + "private": true, + "type": "module", + "scripts": { + "generate": "node scripts/prepare.mjs", + "build": "node scripts/prepare.mjs && vite build && tsc --noEmit && tsc -p packages/settings/tsconfig.json --noEmit", + "preview": "vite preview", + "dev:e2e": "node scripts/prepare.mjs && vite", + "test:e2e": "playwright test --project=chromium" + }, + "dependencies": { + "@route-modules/vue-settings": "workspace:*", + "@tanstack/vue-router": "workspace:^", + "vue": "^3.5.16" + }, + "devDependencies": { + "@playwright/test": "^1.61.0", + "@tanstack/router-cli": "workspace:^", + "@tanstack/router-core": "workspace:^", + "@tanstack/router-e2e-utils": "workspace:^", + "@tanstack/router-generator": "workspace:^", + "@tanstack/router-plugin": "workspace:^", + "@types/node": "catalog:", + "vite": "^8.0.14", + "vitest": "catalog:", + "@vitejs/plugin-vue-jsx": "^5.1.5" + } +} diff --git a/e2e/vue-router/route-modules/packages/settings/package.json b/e2e/vue-router/route-modules/packages/settings/package.json new file mode 100644 index 0000000000..10eaf438b0 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/package.json @@ -0,0 +1,37 @@ +{ + "name": "@route-modules/vue-settings", + "private": true, + "type": "module", + "tanstack": { + "router": { + "module": true + } + }, + "exports": { + "./route-types": { + "types": "./.tanstack/types/src/routeContract.gen.d.ts" + }, + "./route-module": { + "types": "./.tanstack/types/src/routeModule.gen.d.ts", + "default": "./src/routeModule.gen.ts" + }, + "./scope": { + "types": "./.tanstack/types/src/routeScope.gen.d.ts", + "default": "./src/routeScope.gen.ts" + }, + "./package.json": "./package.json" + }, + "scripts": { + "generate": "tsr generate", + "emit-types": "tsc -p tsconfig.route-types.json", + "check": "tsc --noEmit" + }, + "dependencies": { + "@tanstack/vue-router": "workspace:^", + "vue": "^3.5.16" + }, + "devDependencies": { + "@tanstack/router-core": "workspace:^", + "@tanstack/router-cli": "workspace:^" + } +} diff --git a/e2e/vue-router/route-modules/packages/settings/src/routes/__root.tsx b/e2e/vue-router/route-modules/packages/settings/src/routes/__root.tsx new file mode 100644 index 0000000000..818a747831 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/src/routes/__root.tsx @@ -0,0 +1,9 @@ +import * as Vue from 'vue' +import { Outlet } from '@tanstack/vue-router' +import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot<{ + onProfileMatch?: (routeId: string | undefined) => void +}>()({ + component: () => , + notFoundComponent: () =>

MODULE_NOT_FOUND

, +}) diff --git a/e2e/vue-router/route-modules/packages/settings/src/routes/forward.tsx b/e2e/vue-router/route-modules/packages/settings/src/routes/forward.tsx new file mode 100644 index 0000000000..a01bf2b8b6 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/src/routes/forward.tsx @@ -0,0 +1,5 @@ +import * as Vue from 'vue' +import { createFileRoute, Navigate } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/vue-settings:/forward')({ + component: () => , +}) diff --git a/e2e/vue-router/route-modules/packages/settings/src/routes/index.tsx b/e2e/vue-router/route-modules/packages/settings/src/routes/index.tsx new file mode 100644 index 0000000000..55697a39de --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/src/routes/index.tsx @@ -0,0 +1,4 @@ +import { createFileRoute, Link } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/vue-settings:/')({ + component: () => Profile, +}) diff --git a/e2e/vue-router/route-modules/packages/settings/src/routes/legacy.tsx b/e2e/vue-router/route-modules/packages/settings/src/routes/legacy.tsx new file mode 100644 index 0000000000..a83a5cd897 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/src/routes/legacy.tsx @@ -0,0 +1,6 @@ +import { createFileRoute, redirect } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/vue-settings:/legacy')({ + beforeLoad: () => { + throw redirect({ to: '/profile' }) + }, +}) diff --git a/e2e/vue-router/route-modules/packages/settings/src/routes/members.tsx b/e2e/vue-router/route-modules/packages/settings/src/routes/members.tsx new file mode 100644 index 0000000000..a71c4fb4bf --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/src/routes/members.tsx @@ -0,0 +1,12 @@ +import * as Vue from 'vue' +import { createFileRoute, getRouteApi } from '../routeScope.gen' +const ProfileLink = getRouteApi('@route-modules/vue-settings:/profile').Link +export const Route = createFileRoute('@route-modules/vue-settings:/members')({ + loader: () => ({ label: 'members' as const }), + component: () => ( + <> +

MEMBERS_PAGE

+ Profile + + ), +}) diff --git a/e2e/vue-router/route-modules/packages/settings/src/routes/missing.tsx b/e2e/vue-router/route-modules/packages/settings/src/routes/missing.tsx new file mode 100644 index 0000000000..eb114f3dc1 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/src/routes/missing.tsx @@ -0,0 +1,6 @@ +import { createFileRoute, notFound } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/vue-settings:/missing')({ + component: () => { + throw notFound({ routeId: '@route-modules/vue-settings:' }) + }, +}) diff --git a/e2e/vue-router/route-modules/packages/settings/src/routes/profile.tsx b/e2e/vue-router/route-modules/packages/settings/src/routes/profile.tsx new file mode 100644 index 0000000000..2849887be6 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/src/routes/profile.tsx @@ -0,0 +1,85 @@ +import * as Vue from 'vue' +import { Link as ApplicationLink } from '@tanstack/vue-router' +import { + createFileRoute, + getRouteApi, + MatchRoute, + useLinkProps, + useNavigate, + useRouter, +} from '../routeScope.gen' +const api = getRouteApi('@route-modules/vue-settings:/profile') +export const Route = createFileRoute('@route-modules/vue-settings:/profile')({ + component: Vue.defineComponent({ + setup() { + const navigate = api.useNavigate() + const routeNavigate = Route.useNavigate() + const relativeNavigate = useNavigate({ from: '/profile' }) + const anchor = useLinkProps({ to: '/members' }) + const match = Route.useMatch({ shouldThrow: false }) + const scopedRouter = useRouter() + const observe = scopedRouter.options.context?.onProfileMatch + Vue.watchEffect(() => observe?.(match.value?.routeId), { flush: 'sync' }) + return () => ( + <> +

Profile

+

Match

+
+
Route id
+
+ + {match.value?.routeId} + +
+
Params
+
+ + {JSON.stringify(match.value?.params)} + +
+
Router href
+
+ + {scopedRouter.buildLocation({ to: '/members' }).href} + +
+
MatchRoute
+
+ + PROFILE_MATCH + + + MEMBERS_MATCH + +
+
+

Links

+

+ API members + Custom members + Route home + {/* The framework's own Link keeps application coordinates. */} + + Organization host + +

+

Navigation

+

+ + + + +

+ + ) + }, + }), +}) diff --git a/e2e/vue-router/route-modules/packages/settings/src/routes/search.tsx b/e2e/vue-router/route-modules/packages/settings/src/routes/search.tsx new file mode 100644 index 0000000000..ce7240ca62 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/src/routes/search.tsx @@ -0,0 +1,4 @@ +import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@route-modules/vue-settings:/search')({ + validateSearch: (search: { query: string }) => search, +}) diff --git a/e2e/vue-router/route-modules/packages/settings/tsconfig.json b/e2e/vue-router/route-modules/packages/settings/tsconfig.json new file mode 100644 index 0000000000..03e4f22814 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "preserve", + "jsxImportSource": "vue", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": [] + }, + "include": ["src"] +} diff --git a/e2e/vue-router/route-modules/packages/settings/tsconfig.route-types.json b/e2e/vue-router/route-modules/packages/settings/tsconfig.route-types.json new file mode 100644 index 0000000000..0c9aec3caf --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/tsconfig.route-types.json @@ -0,0 +1,13 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "noEmit": false, + "declaration": true, + "emitDeclarationOnly": true, + "noEmitOnError": true, + "declarationMap": true, + "rootDir": ".", + "outDir": ".tanstack/types" + }, + "include": ["src"] +} diff --git a/e2e/vue-router/route-modules/packages/settings/tsr.config.json b/e2e/vue-router/route-modules/packages/settings/tsr.config.json new file mode 100644 index 0000000000..e026c80dc2 --- /dev/null +++ b/e2e/vue-router/route-modules/packages/settings/tsr.config.json @@ -0,0 +1,3 @@ +{ + "target": "vue" +} diff --git a/e2e/vue-router/route-modules/playwright.config.ts b/e2e/vue-router/route-modules/playwright.config.ts new file mode 100644 index 0000000000..56f2d789b1 --- /dev/null +++ b/e2e/vue-router/route-modules/playwright.config.ts @@ -0,0 +1,17 @@ +import { defineConfig, devices } from '@playwright/test' +import { appServerReady } from '@tanstack/router-e2e-utils' + +const PORT = Number(process.env.E2E_APP_PORT ?? 0) +export default defineConfig({ + testDir: './e2e', + workers: 1, + reporter: [['line']], + use: { baseURL: `http://localhost:${PORT}` }, + webServer: { + command: `pnpm build && pnpm preview --host 0.0.0.0 --port ${PORT}`, + wait: appServerReady, + reuseExistingServer: false, + stdout: 'pipe', + }, + projects: [{ name: 'chromium', use: { ...devices['Desktop Chrome'] } }], +}) diff --git a/e2e/vue-router/route-modules/scripts/prepare.mjs b/e2e/vue-router/route-modules/scripts/prepare.mjs new file mode 100644 index 0000000000..c7bad5c894 --- /dev/null +++ b/e2e/vue-router/route-modules/scripts/prepare.mjs @@ -0,0 +1,28 @@ +import { spawnSync } from 'node:child_process' +import { rmSync } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { Generator, getConfig } from '@tanstack/router-generator' + +const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') +const provider = path.join(root, 'packages/settings') +await new Generator({ + config: getConfig({ disableLogging: true }, provider), + root: provider, +}).run() +rmSync(path.join(provider, '.tanstack/types'), { recursive: true, force: true }) +const result = spawnSync( + 'pnpm', + ['exec', 'tsc', '-p', 'tsconfig.route-types.json', '--pretty', 'false'], + { cwd: provider, stdio: 'inherit', shell: process.platform === 'win32' }, +) +if (result.error) { + throw result.error +} +if (result.status !== 0) { + process.exit(result.status ?? 1) +} +await new Generator({ + config: getConfig({ disableLogging: true }, root), + root, +}).run() diff --git a/e2e/vue-router/route-modules/src/main.tsx b/e2e/vue-router/route-modules/src/main.tsx new file mode 100644 index 0000000000..239fc24f38 --- /dev/null +++ b/e2e/vue-router/route-modules/src/main.tsx @@ -0,0 +1,16 @@ +import { createApp, h } from 'vue' +import { RouterProvider, createRouter } from '@tanstack/vue-router' +import { routeTree } from './routeTree.gen' + +const observedModuleMatches: Array = [] +Object.assign(window, { observedModuleMatches }) +const router = createRouter({ + routeTree, + context: { onProfileMatch: (routeId) => observedModuleMatches.push(routeId) }, +}) +declare module '@tanstack/vue-router' { + interface Register { + router: typeof router + } +} +createApp({ setup: () => () => h(RouterProvider, { router }) }).mount('#app') diff --git a/e2e/vue-router/route-modules/src/routes/__root.tsx b/e2e/vue-router/route-modules/src/routes/__root.tsx new file mode 100644 index 0000000000..567c442bb3 --- /dev/null +++ b/e2e/vue-router/route-modules/src/routes/__root.tsx @@ -0,0 +1,32 @@ +import * as Vue from 'vue' +import { createRootRouteWithContext, Outlet } from '@tanstack/vue-router' +import { orgSettings, userSettings } from '../routeScope.gen' +export const Route = createRootRouteWithContext<{ + onProfileMatch?: (routeId: string | undefined) => void +}>()({ + component: Vue.defineComponent({ + setup() { + const organizationProfile = orgSettings.useMatch({ + from: '@route-modules/vue-settings:/profile', + shouldThrow: false, + }) + return () => ( + <> + + + + ) + }, + }), + notFoundComponent: () =>

APP_NOT_FOUND

, +}) diff --git a/e2e/vue-router/route-modules/src/routes/orgs.$orgId.tsx b/e2e/vue-router/route-modules/src/routes/orgs.$orgId.tsx new file mode 100644 index 0000000000..8612ff63dc --- /dev/null +++ b/e2e/vue-router/route-modules/src/routes/orgs.$orgId.tsx @@ -0,0 +1,2 @@ +import { createFileRoute } from '@tanstack/vue-router' +export const Route = createFileRoute('/orgs/$orgId')({}) diff --git a/e2e/vue-router/route-modules/src/routes/users.$userId.tsx b/e2e/vue-router/route-modules/src/routes/users.$userId.tsx new file mode 100644 index 0000000000..591ed91014 --- /dev/null +++ b/e2e/vue-router/route-modules/src/routes/users.$userId.tsx @@ -0,0 +1,2 @@ +import { createFileRoute } from '@tanstack/vue-router' +export const Route = createFileRoute('/users/$userId')({}) diff --git a/e2e/vue-router/route-modules/tsconfig.json b/e2e/vue-router/route-modules/tsconfig.json new file mode 100644 index 0000000000..9e43460be8 --- /dev/null +++ b/e2e/vue-router/route-modules/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "preserve", + "jsxImportSource": "vue", + "target": "ESNext", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": false, + "noEmit": true, + "types": ["vite/client"] + }, + "include": ["src", "type-tests"] +} diff --git a/e2e/vue-router/route-modules/tsr.config.json b/e2e/vue-router/route-modules/tsr.config.json new file mode 100644 index 0000000000..4c17a3b082 --- /dev/null +++ b/e2e/vue-router/route-modules/tsr.config.json @@ -0,0 +1,19 @@ +{ + "target": "vue", + "routeModules": { + "includes": [ + { + "module": "@route-modules/vue-settings", + "parent": "/orgs/$orgId", + "at": "/settings", + "as": "orgSettings" + }, + { + "module": "@route-modules/vue-settings", + "parent": "/users/$userId", + "at": "/settings", + "as": "userSettings" + } + ] + } +} diff --git a/e2e/vue-router/route-modules/type-tests/scope-contracts.tsx b/e2e/vue-router/route-modules/type-tests/scope-contracts.tsx new file mode 100644 index 0000000000..a32b8448a8 --- /dev/null +++ b/e2e/vue-router/route-modules/type-tests/scope-contracts.tsx @@ -0,0 +1,95 @@ +import { expectTypeOf, test } from 'vitest' +import { orgSettings, userSettings } from '../src/routeScope.gen' +import * as settings from '@route-modules/vue-settings/scope' + +test('reusable options preserve their installation through spreads and arrays', () => { + const user = userSettings.linkOptions({ + to: '/members', + params: () => ({ userId: 'u1', orgId: '7' }), + }) + expectTypeOf( + user._module, + ).toEqualTypeOf<'@route-modules/vue-settings#userSettings'>() + const same = + const { _module, ...neutral } = user + const compatiblePathsAndParams = + void compatiblePathsAndParams + void _module + // @ts-expect-error An explicit sibling installation is a conflicting scope. + const different = + // @ts-expect-error Rewrapping must not erase the conflicting scope. + orgSettings.linkOptions({ ...user }) + // @ts-expect-error Arrays preserve each entry's destination scope. + orgSettings.linkOptions([user]) + // @ts-expect-error Redirects enforce the same receiving-scope contract. + orgSettings.redirect(user) + orgSettings.linkOptions({ + to: '/members', + params: { orgId: '7' }, + // @ts-expect-error A mask cannot silently retarget another installation's options. + mask: user, + }) + // @ts-expect-error Hook defaults must retain and check a reusable scope stamp. + orgSettings.useNavigate({ ...user, from: '/profile' }) + // @ts-expect-error The callback checks the same destination stamp. + orgSettings.useNavigate()(user) + void same + void different +}) + +test('module-typed helper targets only known route IDs', () => { + settings.notFound({ routeId: '@route-modules/vue-settings:' }) + settings.notFound() + // @ts-expect-error This route is not declared by the module. + settings.notFound({ routeId: '@route-modules/vue-settings:/absent' }) +}) + +test('blocker locations describe the entire application and raw URL values', () => { + settings.useBlocker({ + shouldBlockFn: ({ current, next }) => { + expectTypeOf(current.routeId).toEqualTypeOf() + expectTypeOf(next.fullPath).toEqualTypeOf() + expectTypeOf(next.params).toEqualTypeOf< + Record + >() + expectTypeOf(next.search).toEqualTypeOf>() + return false + }, + }) +}) + +test('match selectors expose foreign data and the generated guard restores known data', () => { + settings.useMatch({ + strict: false, + select: (match) => { + expectTypeOf(match.context).toBeUnknown() + expectTypeOf(match.loaderData).toBeUnknown() + return match.routeId + }, + }) + settings.useMatches({ + select: (matches) => { + expectTypeOf(matches[0]!.context).toBeUnknown() + for (const match of matches) { + if ( + settings.isScopedMatch(match) && + match.localRouteId === '@route-modules/vue-settings:/members' + ) { + expectTypeOf(match.loaderData).toEqualTypeOf< + { label: 'members' } | undefined + >() + expectTypeOf(match.fullPath).toEqualTypeOf() + } + } + return matches.length + }, + }) +}) + +test('MatchRoute accepts only the scope paths in JSX', () => { + const own = + // @ts-expect-error This path is not a module route. + const foreign = + void own + void foreign +}) diff --git a/e2e/vue-router/route-modules/type-tests/validation-aliases.tsx b/e2e/vue-router/route-modules/type-tests/validation-aliases.tsx new file mode 100644 index 0000000000..8adf892950 --- /dev/null +++ b/e2e/vue-router/route-modules/type-tests/validation-aliases.tsx @@ -0,0 +1,111 @@ +import { expectTypeOf, test } from 'vitest' +import type { orgSettings } from '../src/routeScope.gen' + +test('every generated validation alias preserves its namespace contract', () => { + type Options = { to: '/profile'; params: { orgId: '7' } } + const options: Options = { to: '/profile', params: { orgId: '7' } } + const link: orgSettings.ValidateLinkOptions = options + const links: orgSettings.ValidateLinkOptionsArray = [ + options, + ] + const navigate: orgSettings.ValidateNavigateOptions = options + const navigations: orgSettings.ValidateNavigateOptionsArray< + readonly [Options] + > = [options] + const redirect: orgSettings.ValidateRedirectOptions = options + const redirects: orgSettings.ValidateRedirectOptionsArray< + readonly [Options] + > = [options] + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + expectTypeOf().toMatchTypeOf() + + const from: orgSettings.ValidateFromPath<'/profile'> = '/profile' + const to: orgSettings.ValidateToPath<'/profile'> = '/profile' + const search: orgSettings.ValidateSearch<'/search'> = { + search: { query: 'hello' }, + } + const params: orgSettings.ValidateParams<'/profile'> = { + params: { orgId: '7' }, + } + const id: orgSettings.ValidateId<'@route-modules/vue-settings:/profile'> = + '@route-modules/vue-settings:/profile' + const useSearch: orgSettings.ValidateUseSearchOptions<{ + from: '@route-modules/vue-settings:/profile' + }> = { from: '@route-modules/vue-settings:/profile' } + const useParams: orgSettings.ValidateUseParamsOptions<{ + from: '@route-modules/vue-settings:/profile' + }> = { from: '@route-modules/vue-settings:/profile' } + void [from, to, search, params, id, useSearch, useParams] + + const foreignPath = { + to: '/orgs/$orgId', + params: { orgId: '7' }, + } as const + const foreignPaths = [foreignPath] as const + const foreignOrigin = { from: '/orgs/$orgId' } as const + const wrongSearch = { search: { query: 42 } } + const wrongParams = { params: { userId: 'u1' } } + + // @ts-expect-error The validation alias is bound to this module's paths. + const invalidLink: orgSettings.ValidateLinkOptions = + foreignPath + // @ts-expect-error Tuple entries retain the generated scope. + const invalidLinks: orgSettings.ValidateLinkOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error Navigation wrappers cannot escape the module paths. + const invalidNavigate: orgSettings.ValidateNavigateOptions< + typeof foreignPath + > = foreignPath + // @ts-expect-error Every navigation array entry is checked. + const invalidNavigations: orgSettings.ValidateNavigateOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error Redirect wrappers retain module path validation. + const invalidRedirect: orgSettings.ValidateRedirectOptions< + typeof foreignPath + > = foreignPath + // @ts-expect-error Every redirect array entry is checked. + const invalidRedirects: orgSettings.ValidateRedirectOptionsArray< + typeof foreignPaths + > = foreignPaths + // @ts-expect-error A route origin must be a path in the module. + const invalidFrom: orgSettings.ValidateFromPath<'/orgs/$orgId'> = + '/orgs/$orgId' + // @ts-expect-error A destination must be a path in the module. + const invalidTo: orgSettings.ValidateToPath<'/orgs/$orgId'> = '/orgs/$orgId' + // @ts-expect-error Search validation follows the generated route schema. + const invalidSearch: orgSettings.ValidateSearch<'/search'> = wrongSearch + // @ts-expect-error The named installation requires its own host parameter. + const invalidParams: orgSettings.ValidateParams<'/profile'> = wrongParams + // @ts-expect-error A foreign route ID is not a module route. + const invalidId: orgSettings.ValidateId<'@route-modules/vue-settings:/profile'> = + '/orgs/$orgId' + // @ts-expect-error Search selectors must name a route in this module. + const invalidUseSearch: orgSettings.ValidateUseSearchOptions< + typeof foreignOrigin + > = foreignOrigin + // @ts-expect-error Parameter selectors must name a route in this module. + const invalidUseParams: orgSettings.ValidateUseParamsOptions< + typeof foreignOrigin + > = foreignOrigin + void [ + invalidLink, + invalidLinks, + invalidNavigate, + invalidNavigations, + invalidRedirect, + invalidRedirects, + invalidFrom, + invalidTo, + invalidSearch, + invalidParams, + invalidId, + invalidUseSearch, + invalidUseParams, + ] +}) diff --git a/e2e/vue-router/route-modules/vite.config.ts b/e2e/vue-router/route-modules/vite.config.ts new file mode 100644 index 0000000000..51084a35b1 --- /dev/null +++ b/e2e/vue-router/route-modules/vite.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from 'vite' +import vueJsx from '@vitejs/plugin-vue-jsx' +import { tanstackRouter } from '@tanstack/router-plugin/vite' + +export default defineConfig({ + plugins: [ + tanstackRouter({ target: 'vue', autoCodeSplitting: true }), + vueJsx(), + ], +}) diff --git a/eslint.config.js b/eslint.config.js index f58cc3fd10..f3a0c389ca 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -4,9 +4,23 @@ import { tanstackConfig } from '@tanstack/eslint-config' import unusedImports from 'eslint-plugin-unused-imports' +// Packages that set their own `no-restricted-syntax` must include this entry. +export const routerCoreAugmentation = { + selector: "TSModuleDeclaration[id.value='@tanstack/router-core']", + message: + "Augment '@tanstack/router-core/extensions' instead. Augmenting the main entry makes emitted declarations import router types from '@tanstack/router-core' (see packages/router-core/src/extensions.ts).", +} + /** @type {import('eslint').Linter.Config[]} */ export default [ ...tanstackConfig, + { + name: 'tanstack/router-core-augmentation', + files: ['src/**/*.{ts,tsx}'], + rules: { + 'no-restricted-syntax': ['error', routerCoreAugmentation], + }, + }, { name: 'tanstack/temp', rules: { diff --git a/examples/react/start-large-route-modules/.gitignore b/examples/react/start-large-route-modules/.gitignore new file mode 100644 index 0000000000..104b4239a1 --- /dev/null +++ b/examples/react/start-large-route-modules/.gitignore @@ -0,0 +1,24 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local + +# Written by `pnpm gen`: the route modules, the application's package.json +# (it depends on every generated module) and the files listing the modules. +/modules +/app/package.json +/app/node_modules +/app/route-modules.gen.ts +/app/src/moduleIndex.gen.tsx +/measurements + +# Generated by the route generator. +**/routeTree.gen.ts +**/routeTree.gen.*.ts +**/routeScope.gen.ts +**/routeScope.gen.*.ts +**/routeScope.gen/ +**/routeContract.gen.ts +**/routeModule.gen.ts +**/startModules.gen.ts diff --git a/examples/react/start-large-route-modules/.prettierignore b/examples/react/start-large-route-modules/.prettierignore new file mode 100644 index 0000000000..2be5eaa6ec --- /dev/null +++ b/examples/react/start-large-route-modules/.prettierignore @@ -0,0 +1,4 @@ +**/build +**/public +pnpm-lock.yaml +routeTree.gen.ts \ No newline at end of file diff --git a/examples/react/start-large-route-modules/README.md b/examples/react/start-large-route-modules/README.md new file mode 100644 index 0000000000..51596a70f7 --- /dev/null +++ b/examples/react/start-large-route-modules/README.md @@ -0,0 +1,80 @@ +# TanStack Start - Large Route Modules Example + +A TanStack Start application that installs many generated route modules, to +measure how builds and type checks scale with the number of modules. + +- [Route modules guide](https://tanstack.com/start/latest/docs/framework/react/guide/route-modules) + +## Layout + +- `app/`: the application. It installs every module and provides the request + context the modules require. +- `template/`: the module templates. `account` is a small module every feature + module links to. `feature` is copied once per feature module. Its layout, + item list, item and search routes load data through the module's own server + functions and middleware, and `pages/page.tsx` is copied to fill up the route + count. +- `modules/`: the generated module packages (not committed). They are linked + like workspace packages and resolve their dependencies from this example. + +## Getting Started + +```sh +pnpm install +pnpm gen +pnpm dev +``` + +`pnpm gen` generates routes and builds each package's declarations with +`tsc -p tsconfig.route-types.json`, the account module first. The script cleans +each declaration output before compiling. Router handles route generation; +the package build handles declaration output, and a task runner such as Nx can +schedule these steps in dependency order. It also writes the application files that list the +modules: `app/package.json`, `app/route-modules.gen.ts` and +`app/src/moduleIndex.gen.tsx`. Options: + +- `--modules `: number of feature modules (default 50). +- `--routes `: routes per feature module, at least 5 (default 10). +- `--transpiled`: ships the modules as JavaScript, the way a module prebuilt to + transpiled ESM would. The application still code-splits and compiles them. + +`pnpm dev` and `pnpm build` generate the default modules if none exist yet. +Run `pnpm gen` again to change their number. + +Each feature declares its cross-module references in `tanstack.router.module.uses`. +The application selects each module's mount path explicitly in `includes[].at`. +The feature's viewer requirement is a type-only `StartModuleRequirements` +augmentation; the application supplies that context through request middleware. + +## Build + +```sh +pnpm build # Vite +pnpm build:rsbuild # Rsbuild +pnpm start +``` + +The Nx build targets are uncached because these commands preserve the selected +workload in ignored generated directories. Their output must be built for the +current workload instead of restored from a cache that omits those inputs. + +## Measure + +```sh +pnpm gen --modules 100 +pnpm measure --runs 3 --profile +pnpm gen --modules 100 --transpiled +pnpm measure --runs 3 --profile +``` + +`pnpm measure` builds the application with Vite and with Rsbuild (one of them +with `--toolchain vite` or `--toolchain rsbuild`) and prints the median and +fastest build time. `--profile` adds one build under the V8 CPU profiler. It +lists where the JavaScript threads spent their time, by package. Time spent +inside a TanStack plugin, including the Babel passes it runs, counts for that +plugin. The results are saved to `measurements/` (not committed). + +The example lists `@tanstack/router-core` and `@tanstack/start-client-core` +because it links the framework packages from this repository: the modules' +declarations name the types of a linked package's dependencies by their own +package name. diff --git a/examples/react/start-large-route-modules/app/rsbuild.config.ts b/examples/react/start-large-route-modules/app/rsbuild.config.ts new file mode 100644 index 0000000000..bbb8ab7955 --- /dev/null +++ b/examples/react/start-large-route-modules/app/rsbuild.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from '@rsbuild/core' +import { pluginReact } from '@rsbuild/plugin-react' +import { tanstackStart } from '@tanstack/react-start/plugin/rsbuild' +import { routeModules } from './route-modules.gen' + +export default defineConfig({ + server: { + port: 3000, + }, + plugins: [pluginReact(), tanstackStart({ router: { routeModules } })], +}) diff --git a/examples/react/start-large-route-modules/app/server.js b/examples/react/start-large-route-modules/app/server.js new file mode 100644 index 0000000000..36d7e661c3 --- /dev/null +++ b/examples/react/start-large-route-modules/app/server.js @@ -0,0 +1,18 @@ +// Serves a production build of either toolchain: Vite writes the server +// entry to `server/server.js`, Rsbuild to `server/index.js`. +import { spawn } from 'node:child_process' +import { existsSync } from 'node:fs' +import path from 'node:path' + +const serverEntry = + ['server.js', 'index.js'] + .map((file) => path.resolve('dist', 'server', file)) + .find((file) => existsSync(file)) ?? + path.resolve('dist', 'server', 'server.js') + +const child = spawn( + 'srvx', + ['--prod', '-s', path.resolve('dist', 'client'), serverEntry], + { stdio: 'inherit', shell: process.platform === 'win32' }, +) +child.on('exit', (code) => process.exit(code ?? 0)) diff --git a/examples/react/start-large-route-modules/app/src/router.tsx b/examples/react/start-large-route-modules/app/src/router.tsx new file mode 100644 index 0000000000..a00a209fc4 --- /dev/null +++ b/examples/react/start-large-route-modules/app/src/router.tsx @@ -0,0 +1,10 @@ +import { createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' + +export function getRouter() { + return createRouter({ + routeTree, + defaultPreload: 'intent', + scrollRestoration: true, + }) +} diff --git a/examples/react/start-large-route-modules/app/src/routes/__root.tsx b/examples/react/start-large-route-modules/app/src/routes/__root.tsx new file mode 100644 index 0000000000..2f0f71764e --- /dev/null +++ b/examples/react/start-large-route-modules/app/src/routes/__root.tsx @@ -0,0 +1,44 @@ +/// +import type { ReactNode } from 'react' +import { + HeadContent, + Link, + Scripts, + createRootRoute, +} from '@tanstack/react-router' +import { account } from '../routeScope.gen' +import '../styles.css' + +export const Route = createRootRoute({ + head: () => ({ + meta: [ + { charSet: 'utf-8' }, + { name: 'viewport', content: 'width=device-width, initial-scale=1' }, + { title: 'Large route modules' }, + ], + }), + shellComponent: RootDocument, +}) + +function RootDocument({ children }: { children: ReactNode }) { + return ( + + + + + +
+ + Large route modules + + +
+
{children}
+ + + + ) +} diff --git a/examples/react/start-large-route-modules/app/src/routes/index.tsx b/examples/react/start-large-route-modules/app/src/routes/index.tsx new file mode 100644 index 0000000000..1f710d26aa --- /dev/null +++ b/examples/react/start-large-route-modules/app/src/routes/index.tsx @@ -0,0 +1,23 @@ +import { createFileRoute } from '@tanstack/react-router' +import { moduleIndex } from '../moduleIndex.gen' + +export const Route = createFileRoute('/')({ + component: Home, +}) + +function Home() { + return ( + <> +

Modules

+

+ {moduleIndex.length} generated feature modules, each its own package + with its own routes, server functions and middleware. +

+
    + {moduleIndex.map(({ name, link }) => ( +
  • {link}
  • + ))} +
+ + ) +} diff --git a/examples/react/start-large-route-modules/app/src/start.ts b/examples/react/start-large-route-modules/app/src/start.ts new file mode 100644 index 0000000000..1205da611b --- /dev/null +++ b/examples/react/start-large-route-modules/app/src/start.ts @@ -0,0 +1,10 @@ +import { createMiddleware, createStart } from '@tanstack/react-start' + +// Provides the request context every feature module requires. +const viewer = createMiddleware().server(({ next }) => + next({ context: { viewer: 'ada' } }), +) + +export const startInstance = createStart(() => ({ + requestMiddleware: [viewer], +})) diff --git a/examples/react/start-large-route-modules/app/src/styles.css b/examples/react/start-large-route-modules/app/src/styles.css new file mode 100644 index 0000000000..46046be435 --- /dev/null +++ b/examples/react/start-large-route-modules/app/src/styles.css @@ -0,0 +1,114 @@ +:root { + color-scheme: light; + --ground: #f5f6f8; + --sheet: #ffffff; + --ink: #1f2328; + --ink-2: #565e67; + --line: #d6dadf; + --accent: #3d5bd9; + --font: + ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, + 'Helvetica Neue', Arial, sans-serif; + --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; +} + +* { + box-sizing: border-box; +} + +body { + margin: 0; + background: var(--ground); + color: var(--ink); + font: 15px/1.5 var(--font); +} + +a { + color: inherit; + text-underline-offset: 3px; +} + +a.active { + color: var(--accent); + font-weight: 600; +} + +.topbar { + display: flex; + align-items: center; + gap: 24px; + padding: 12px 24px; + background: var(--sheet); + border-bottom: 1px solid var(--line); +} + +.brand { + font-weight: 700; + text-decoration: none; +} + +.nav, +.module-nav { + display: flex; + flex-wrap: wrap; + gap: 16px; +} + +.page { + max-width: 960px; + margin: 0 auto; + padding: 32px 24px 64px; +} + +.lead { + color: var(--ink-2); + max-width: 60ch; +} + +.grid { + display: grid; + grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); + gap: 8px; + padding: 0; + list-style: none; +} + +.grid a { + display: block; + padding: 8px 12px; + background: var(--sheet); + border: 1px solid var(--line); + border-radius: 6px; + text-decoration: none; +} + +.module { + padding: 20px 24px; + background: var(--sheet); + border: 1px solid var(--line); + border-radius: 8px; +} + +.module-tag { + margin: 0 0 4px; + color: var(--ink-2); + font: 12px/1.4 var(--mono); +} + +.rows { + padding-left: 20px; +} + +.facts { + display: grid; + grid-template-columns: max-content 1fr; + gap: 4px 16px; +} + +.facts dt { + color: var(--ink-2); +} + +.facts dd { + margin: 0; +} diff --git a/examples/react/start-large-route-modules/app/tsconfig.json b/examples/react/start-large-route-modules/app/tsconfig.json new file mode 100644 index 0000000000..60398c44b4 --- /dev/null +++ b/examples/react/start-large-route-modules/app/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "strict": true, + "esModuleInterop": true, + "jsx": "react-jsx", + "target": "ES2022", + "moduleResolution": "Bundler", + "module": "ESNext", + "lib": ["DOM", "DOM.Iterable", "ES2022"], + "skipLibCheck": true, + "noEmit": true, + "types": ["vite/client"] + }, + "include": [ + "src", + "vite.config.ts", + "rsbuild.config.ts", + "route-modules.gen.ts" + ] +} diff --git a/examples/react/start-large-route-modules/app/vite.config.ts b/examples/react/start-large-route-modules/app/vite.config.ts new file mode 100644 index 0000000000..f211ef9e0b --- /dev/null +++ b/examples/react/start-large-route-modules/app/vite.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from 'vite' +import { tanstackStart } from '@tanstack/react-start/plugin/vite' +import viteReact from '@vitejs/plugin-react' +import { routeModules } from './route-modules.gen' + +export default defineConfig({ + server: { + port: 3000, + }, + plugins: [tanstackStart({ router: { routeModules } }), viteReact()], +}) diff --git a/examples/react/start-large-route-modules/package.json b/examples/react/start-large-route-modules/package.json new file mode 100644 index 0000000000..acffbe1479 --- /dev/null +++ b/examples/react/start-large-route-modules/package.json @@ -0,0 +1,49 @@ +{ + "name": "tanstack-start-example-large-route-modules", + "private": true, + "sideEffects": false, + "type": "module", + "nx": { + "targets": { + "build": { + "cache": false + }, + "build:rsbuild": { + "cache": false + } + } + }, + "scripts": { + "gen": "node scripts/gen.mjs", + "dev": "node scripts/gen.mjs --if-missing && cd app && vite dev", + "dev:rsbuild": "node scripts/gen.mjs --if-missing && cd app && rsbuild dev", + "build": "node scripts/gen.mjs --if-missing && cd app && vite build && tsc --noEmit", + "build:rsbuild": "node scripts/gen.mjs --if-missing && cd app && rsbuild build && tsc --noEmit", + "start": "cd app && node server.js", + "measure": "node scripts/measure.mjs" + }, + "dependencies": { + "@tanstack/react-router": "^1.170.46", + "@tanstack/react-start": "^1.169.4", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "devDependencies": { + "@rsbuild/core": "^2.1.0", + "@rsbuild/plugin-react": "^2.0.0", + "@tanstack/router-core": "^1.171.39", + "@tanstack/router-generator": "^1.167.46", + "@tanstack/start-client-core": "^1.170.39", + "@types/node": "^22.5.4", + "@types/react": "^19.0.8", + "@types/react-dom": "^19.0.3", + "@typescript/native": "npm:typescript@^7.0.2", + "@vitejs/plugin-react": "^6.0.1", + "srvx": "^1.0.0", + "typescript": "npm:@typescript/typescript6@^6.0.2", + "vite": "^8.0.14" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git a/examples/react/start-large-route-modules/scripts/gen.mjs b/examples/react/start-large-route-modules/scripts/gen.mjs new file mode 100644 index 0000000000..13e04d5750 --- /dev/null +++ b/examples/react/start-large-route-modules/scripts/gen.mjs @@ -0,0 +1,387 @@ +// Generates the route modules of the example from `template/` and the +// application files that list them, then generates and publishes every module +// in dependency order, with ordinary TypeScript declaration builds. +// +// pnpm gen [--modules ] [--routes ] +// [--transpiled] [--if-missing] +// +// `--if-missing` keeps the modules of an earlier run: `dev` and `build` +// generate the default modules only in a fresh checkout. +// +// `--transpiled` ships every module as JavaScript, the way a module built to +// transpiled ESM would: after publishing its types, each module's TypeScript +// sources are replaced with their oxc output and its manifest lists the +// JavaScript route files. The application still code-splits and compiles +// them. Comparing builds with and without it measures what prebuilding the +// modules that way saves. +// +// The modules are packages in `modules/`, linked like workspace packages: +// `modules/node_modules/` for the modules that use each other and +// `app/node_modules` for the application. They resolve everything else from +// the example's own dependencies. +import { spawn } from 'node:child_process' +import { existsSync } from 'node:fs' +import { + mkdir, + readFile, + readdir, + rm, + symlink, + writeFile, +} from 'node:fs/promises' +import os from 'node:os' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { parseArgs } from 'node:util' +import { Generator, getConfig } from '@tanstack/router-generator' +import { transformWithOxc } from 'vite' + +const { values } = parseArgs({ + options: { + modules: { type: 'string', default: '50' }, + routes: { type: 'string', default: '10' }, + transpiled: { type: 'boolean', default: false }, + 'if-missing': { type: 'boolean', default: false }, + }, +}) +const featureCount = Number(values.modules) +const routeCount = Number(values.routes) +// Every feature has a layout, an item list, an item and a search route, and +// fills the rest with pages. +const pageCount = routeCount - 4 +if (!Number.isInteger(featureCount) || featureCount < 1) { + throw new Error('--modules must be a positive integer') +} +if (!Number.isInteger(routeCount) || pageCount < 1) { + throw new Error('--routes must be an integer of at least 5') +} + +const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') +const templateDir = path.join(root, 'template') +const modulesDir = path.join(root, 'modules') +const appDir = path.join(root, 'app') +const scope = '@large-route-modules' + +if ( + values['if-missing'] && + existsSync(path.join(appDir, 'route-modules.gen.ts')) +) { + process.exit(0) +} + +const features = Array.from({ length: featureCount }, (_, index) => ({ + name: `feature-${index}`, + title: `Feature ${index}`, +})) + +async function listFiles(dir, base = dir) { + const files = [] + for (const entry of await readdir(dir, { withFileTypes: true })) { + const full = path.join(dir, entry.name) + if (entry.isDirectory()) { + files.push(...(await listFiles(full, base))) + } else { + files.push(path.relative(base, full)) + } + } + return files +} + +async function write(file, content) { + await mkdir(path.dirname(file), { recursive: true }) + await writeFile(file, content) +} + +function replaceAll(content, replacements) { + let result = content + for (const [placeholder, value] of Object.entries(replacements)) { + result = result.replaceAll(placeholder, value) + } + return result +} + +function modulePackageJson({ name, dependencies = {} }) { + return { + name: `${scope}/${name}`, + private: true, + type: 'module', + tanstack: { router: { module: { uses: Object.keys(dependencies) } } }, + exports: { + './route-types': { + types: './.tanstack/types/src/routeContract.gen.d.ts', + }, + './route-module': { + types: './.tanstack/types/src/routeModule.gen.d.ts', + default: './src/routeModule.gen.ts', + }, + './package.json': './package.json', + }, + dependencies: { + ...dependencies, + '@tanstack/react-router': '*', + '@tanstack/react-start': '*', + react: '*', + }, + } +} + +const moduleTsconfig = { + compilerOptions: { + strict: true, + esModuleInterop: true, + jsx: 'react-jsx', + target: 'ESNext', + moduleResolution: 'Bundler', + module: 'ESNext', + lib: ['DOM', 'DOM.Iterable', 'ES2022'], + skipLibCheck: true, + noEmit: true, + types: [], + }, + include: ['src'], +} + +const json = (value) => `${JSON.stringify(value, null, 2)}\n` + +async function writeModule(name, templateName, packageJson, replacements) { + const dir = path.join(modulesDir, name) + const template = path.join(templateDir, templateName) + for (const file of await listFiles(template)) { + const content = await readFile(path.join(template, file), 'utf8') + if (file === path.join('src', 'routes', 'pages', 'page.tsx')) { + for (let page = 0; page < pageCount; page++) { + await write( + path.join(dir, 'src', 'routes', 'pages', `page-${page}.tsx`), + replaceAll(content, { + ...replacements, + __NEXT_PAGE__: String((page + 1) % pageCount), + __PAGE__: String(page), + }), + ) + } + } else { + await write(path.join(dir, file), replaceAll(content, replacements)) + } + } + await write(path.join(dir, 'package.json'), json(packageJson)) + await write(path.join(dir, 'tsconfig.json'), json(moduleTsconfig)) + await write( + path.join(dir, 'tsconfig.route-types.json'), + json({ + extends: './tsconfig.json', + compilerOptions: { + noEmit: false, + declaration: true, + emitDeclarationOnly: true, + noEmitOnError: true, + declarationMap: true, + rootDir: '.', + outDir: '.tanstack/types', + }, + // The stand-ins for the contracts of used modules: the declaration + // build needs no order among the modules. + include: ['src', '.tanstack/route-types-stubs.d.ts'], + }), + ) + await symlink( + path.join('..', '..', name), + path.join(modulesDir, 'node_modules', scope, name), + 'dir', + ) +} + +async function runPool(items, concurrency, task) { + const queue = [...items] + await Promise.all( + Array.from({ length: Math.min(concurrency, queue.length) }, async () => { + while (queue.length) { + await task(queue.shift()) + } + }), + ) +} + +async function generate(name) { + const dir = path.join(modulesDir, name) + const config = getConfig({ disableLogging: true }, dir) + await new Generator({ config, root: dir }).run() +} + +async function emitTypes(name) { + const packageRoot = path.join(modulesDir, name) + await rm(path.join(packageRoot, '.tanstack/types'), { + recursive: true, + force: true, + }) + await new Promise((resolve, reject) => { + const child = spawn( + path.join( + root, + 'node_modules/.bin', + process.platform === 'win32' ? 'tsc.cmd' : 'tsc', + ), + ['-p', 'tsconfig.route-types.json', '--pretty', 'false'], + { + cwd: packageRoot, + stdio: 'inherit', + shell: process.platform === 'win32', + }, + ) + child.once('error', reject) + child.once('close', (code) => { + if (code === 0) { + resolve() + } else { + reject(new Error(`Declaration build of ${name} exited with ${code}`)) + } + }) + }) +} + +const started = performance.now() + +await rm(modulesDir, { recursive: true, force: true }) +await rm(path.join(appDir, 'node_modules'), { recursive: true, force: true }) +await mkdir(path.join(modulesDir, 'node_modules', scope), { recursive: true }) +await mkdir(path.join(appDir, 'node_modules'), { recursive: true }) +await symlink( + path.join('..', '..', 'modules', 'node_modules', scope), + path.join(appDir, 'node_modules', scope), + 'dir', +) + +await writeModule( + 'account', + 'account', + modulePackageJson({ name: 'account' }), + {}, +) +for (const feature of features) { + await writeModule( + feature.name, + 'feature', + modulePackageJson({ + name: feature.name, + dependencies: { [`${scope}/account`]: 'link:../account' }, + }), + { __MODULE_ID__: `${scope}/${feature.name}`, __TITLE__: feature.title }, + ) +} + +// The application depends on every module it installs. +const moduleIds = ['account', ...features.map((feature) => feature.name)].map( + (name) => `${scope}/${name}`, +) +await write( + path.join(appDir, 'package.json'), + json({ + name: `${scope}/app`, + private: true, + type: 'module', + dependencies: { + ...Object.fromEntries( + moduleIds.map((id) => [ + id, + `link:../modules/${id.slice(scope.length + 1)}`, + ]), + ), + '@tanstack/react-router': '*', + '@tanstack/react-start': '*', + react: '*', + 'react-dom': '*', + }, + }), +) +await write( + path.join(appDir, 'route-modules.gen.ts'), + `// Written by \`pnpm gen\`: the modules the application installs. +export const routeModules = { + includes: ${JSON.stringify( + moduleIds.map((module) => ({ + module, + at: `/${module.slice(scope.length + 1)}`, + })), + null, + 2, + ).replaceAll('\n', '\n ')}, +} +`, +) +const namespace = (name) => name.replace(/-(\w)/g, (_, c) => c.toUpperCase()) +await write( + path.join(appDir, 'src', 'moduleIndex.gen.tsx'), + `// Written by \`pnpm gen\`: a link to every feature module. +import { ${features.map((feature) => namespace(feature.name)).join(', ')} } from './routeScope.gen' + +export const moduleIndex = [ +${features + .map( + (feature) => + ` { name: '${feature.name}', link: <${namespace(feature.name)}.Link to="/">${feature.title} },`, + ) + .join('\n')} +] +`, +) + +// The features use the account module: it is published first. +await generate('account') +await emitTypes('account') +for (const feature of features) { + await generate(feature.name) +} +await runPool( + features.map((feature) => feature.name), + os.availableParallelism(), + emitTypes, +) + +async function transpile(name) { + const dir = path.join(modulesDir, name) + const src = path.join(dir, 'src') + for (const file of await listFiles(src)) { + if (!/\.tsx?$/.test(file)) { + continue + } + const source = path.join(src, file) + const result = await transformWithOxc( + await readFile(source, 'utf8'), + source, + { jsx: { runtime: 'automatic' } }, + ) + await writeFile(source.replace(/\.tsx?$/, '.js'), result.code) + await rm(source) + } + const manifestPath = path.join(dir, '.tanstack', 'route-module.json') + const manifest = JSON.parse(await readFile(manifestPath, 'utf8')) + for (const routeFile of manifest.routeFiles) { + routeFile.file = routeFile.file.replace(/\.tsx?$/, '.js') + } + for (const tree of manifest.clientTrees) { + tree.file = tree.file.replace(/\.tsx?$/, '.js') + tree.clientFile = tree.clientFile.replace(/\.tsx?$/, '.js') + } + await writeFile(manifestPath, json(manifest)) + const packageJsonPath = path.join(dir, 'package.json') + const packageJson = JSON.parse(await readFile(packageJsonPath, 'utf8')) + packageJson.exports['./route-module'].default = './src/routeModule.gen.js' + await writeFile(packageJsonPath, json(packageJson)) +} + +if (values.transpiled) { + await runPool( + ['account', ...features.map((feature) => feature.name)], + os.availableParallelism(), + transpile, + ) +} + +const seconds = ((performance.now() - started) / 1000).toFixed(1) +console.log( + `Generated ${featureCount} feature modules with ${routeCount} routes each, plus the account module${values.transpiled ? ', as transpiled JavaScript,' : ''} in ${seconds}s.`, +) +if (!existsSync(path.join(appDir, 'src', 'routeTree.gen.ts'))) { + console.log( + 'The application generates its route tree on `pnpm dev` or `pnpm build`.', + ) +} diff --git a/examples/react/start-large-route-modules/scripts/measure.mjs b/examples/react/start-large-route-modules/scripts/measure.mjs new file mode 100644 index 0000000000..0c130f5a76 --- /dev/null +++ b/examples/react/start-large-route-modules/scripts/measure.mjs @@ -0,0 +1,242 @@ +// Measures production builds of the application with the modules `pnpm gen` +// generated last. +// +// pnpm measure [--toolchain vite|rsbuild] [--runs ] [--profile] +// +// Each run is a fresh build process without the type check. `--profile` adds +// one run under the V8 CPU profiler and lists where the JavaScript thread +// spent its time, grouped by package. Work in native threads (Rolldown, Oxc, +// Rspack, SWC) shows up only as the JavaScript thread waiting for it. +import { spawn } from 'node:child_process' +import { existsSync } from 'node:fs' +import { mkdir, readFile, readdir, rm, writeFile } from 'node:fs/promises' +import { createRequire } from 'node:module' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { parseArgs } from 'node:util' + +const { values } = parseArgs({ + options: { + toolchain: { type: 'string', multiple: true }, + runs: { type: 'string', default: '3' }, + profile: { type: 'boolean', default: false }, + }, +}) +const toolchains = values.toolchain ?? ['vite', 'rsbuild'] +const runs = Number(values.runs) + +const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') +const appDir = path.join(root, 'app') +const modulesDir = path.join(root, 'modules') +const require = createRequire(path.join(root, 'package.json')) + +const bins = { + vite: path.join( + path.dirname(require.resolve('vite/package.json')), + 'bin', + 'vite.js', + ), + rsbuild: path.join( + path.dirname(require.resolve('@rsbuild/core/package.json')), + 'bin', + 'rsbuild.js', + ), +} + +if (!existsSync(path.join(appDir, 'route-modules.gen.ts'))) { + throw new Error('Generate the modules first: pnpm gen') +} + +async function listFiles(dir) { + const files = [] + for (const entry of await readdir(dir, { withFileTypes: true })) { + const full = path.join(dir, entry.name) + if (entry.isDirectory()) { + files.push(...(await listFiles(full))) + } else { + files.push(full) + } + } + return files +} + +function build(toolchain, nodeArgs = []) { + return new Promise((resolve, reject) => { + const started = performance.now() + const child = spawn( + process.execPath, + [...nodeArgs, bins[toolchain], 'build'], + { + cwd: appDir, + env: { ...process.env, NODE_ENV: 'production' }, + stdio: ['ignore', 'ignore', 'pipe'], + }, + ) + let stderr = '' + child.stderr.on('data', (chunk) => (stderr += chunk)) + child.on('error', reject) + child.on('close', (code) => { + if (code !== 0) { + reject(new Error(`${toolchain} build failed:\n${stderr}`)) + } else { + resolve(performance.now() - started) + } + }) + }) +} + +const workspacePackages = path.resolve(root, '..', '..', '..', 'packages') + +/** The package a profiled function belongs to, or a V8 category. */ +function categorize(callFrame) { + const url = callFrame.url + if (!url) { + return callFrame.functionName.startsWith('(') + ? callFrame.functionName + : '(native)' + } + if (url.startsWith('node:')) { + return 'node' + } + const file = url.startsWith('file://') ? fileURLToPath(url) : url + const nodeModules = file.lastIndexOf(`${path.sep}node_modules${path.sep}`) + if (nodeModules !== -1) { + const [first, second] = file + .slice(nodeModules + '/node_modules/'.length) + .split(path.sep) + return first.startsWith('@') ? `${first}/${second}` : first + } + if (file.startsWith(workspacePackages + path.sep)) { + return `@tanstack/${file.slice(workspacePackages.length + 1).split(path.sep)[0]}` + } + return path.relative(root, file).split(path.sep)[0] +} + +/** + * Sums the sampled time of the profiles by the package of the sampled + * function, except that time spent inside a TanStack package's call (its + * Babel passes, for example) counts for the outermost TanStack package on the + * stack: the plugin that ran. + */ +async function summarizeProfiles(dir) { + const times = new Map() + let total = 0 + for (const file of await readdir(dir)) { + const profile = JSON.parse(await readFile(path.join(dir, file), 'utf8')) + const nodes = new Map(profile.nodes.map((node) => [node.id, node])) + const parents = new Map() + for (const node of profile.nodes) { + for (const child of node.children ?? []) { + parents.set(child, node.id) + } + } + const owners = new Map() + const ownerOf = (id) => { + if (!owners.has(id)) { + const parent = parents.get(id) + const outer = parent === undefined ? undefined : ownerOf(parent) + const category = categorize(nodes.get(id).callFrame) + owners.set( + id, + outer ?? (category.startsWith('@tanstack/') ? category : undefined), + ) + } + return owners.get(id) + } + for (let index = 0; index < profile.samples.length; index++) { + const id = profile.samples[index] + const delta = profile.timeDeltas[index] / 1000 + const owner = ownerOf(id) + const category = owner + ? `${owner} (with callees)` + : categorize(nodes.get(id).callFrame) + times.set(category, (times.get(category) ?? 0) + delta) + total += delta + } + } + return { + total, + categories: [...times] + .sort((a, b) => b[1] - a[1]) + .map(([category, ms]) => ({ category, ms })), + } +} + +const median = (numbers) => { + const sorted = [...numbers].sort((a, b) => a - b) + const middle = Math.floor(sorted.length / 2) + return sorted.length % 2 + ? sorted[middle] + : (sorted[middle - 1] + sorted[middle]) / 2 +} +const ms = (value) => `${Math.round(value).toLocaleString('en-US')} ms` + +const moduleNames = (await readdir(modulesDir)).filter( + (name) => name !== 'node_modules', +) +const moduleFiles = ( + await Promise.all( + moduleNames.map((name) => listFiles(path.join(modulesDir, name, 'src'))), + ) +).flat() +const moduleCount = moduleNames.length +const transpiled = !moduleFiles.some((file) => /\.tsx?$/.test(file)) +console.log( + `${moduleCount} modules, ${moduleFiles.length} module source files (${transpiled ? 'transpiled JavaScript' : 'TypeScript'})`, +) + +const results = { + date: new Date().toISOString(), + modules: moduleCount, + moduleFiles: moduleFiles.length, + transpiled, + toolchains: {}, +} + +for (const toolchain of toolchains) { + if (!bins[toolchain]) { + throw new Error(`Unknown toolchain "${toolchain}": use vite or rsbuild`) + } + const times = [] + for (let run = 0; run < runs; run++) { + await rm(path.join(appDir, 'dist'), { recursive: true, force: true }) + times.push(await build(toolchain)) + } + const clientChunks = ( + await listFiles(path.join(appDir, 'dist', 'client')) + ).filter((file) => file.endsWith('.js')).length + console.log( + `${toolchain}: median ${ms(median(times))}, min ${ms(Math.min(...times))} over ${runs} runs (${clientChunks} client chunks)`, + ) + const result = { times, clientChunks } + + if (values.profile) { + const profileDir = path.join( + root, + 'measurements', + `${toolchain}-cpuprofile`, + ) + await rm(profileDir, { recursive: true, force: true }) + await mkdir(profileDir, { recursive: true }) + await rm(path.join(appDir, 'dist'), { recursive: true, force: true }) + await build(toolchain, ['--cpu-prof', `--cpu-prof-dir=${profileDir}`]) + const summary = await summarizeProfiles(profileDir) + console.log(` JavaScript threads, ${ms(summary.total)} sampled:`) + for (const { category, ms: time } of summary.categories.slice(0, 15)) { + console.log( + ` ${category.padEnd(44)} ${ms(time).padStart(10)} ${((time / summary.total) * 100).toFixed(1).padStart(5)}%`, + ) + } + result.profile = summary + } + results.toolchains[toolchain] = result +} + +await mkdir(path.join(root, 'measurements'), { recursive: true }) +const resultFile = path.join( + root, + 'measurements', + `${results.date.replace(/[:.]/g, '-')}.json`, +) +await writeFile(resultFile, `${JSON.stringify(results, null, 2)}\n`) +console.log(`Saved ${path.relative(root, resultFile)}`) diff --git a/examples/react/start-large-route-modules/template/account/src/api.ts b/examples/react/start-large-route-modules/template/account/src/api.ts new file mode 100644 index 0000000000..c94341627d --- /dev/null +++ b/examples/react/start-large-route-modules/template/account/src/api.ts @@ -0,0 +1,8 @@ +import { createServerFn } from './routeScope.gen' + +/** The signed-in account, loaded on the server. */ +export const getAccount = createServerFn().handler(() => ({ + name: 'Ada Lovelace', + plan: 'Team', + seats: 12, +})) diff --git a/examples/react/start-large-route-modules/template/account/src/routes/__root.tsx b/examples/react/start-large-route-modules/template/account/src/routes/__root.tsx new file mode 100644 index 0000000000..244e474f54 --- /dev/null +++ b/examples/react/start-large-route-modules/template/account/src/routes/__root.tsx @@ -0,0 +1,18 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ + component: AccountLayout, +}) + +function AccountLayout() { + return ( +
+

+ @large-route-modules/account {Route.fullPath} +

+

Account

+ +
+ ) +} diff --git a/examples/react/start-large-route-modules/template/account/src/routes/index.tsx b/examples/react/start-large-route-modules/template/account/src/routes/index.tsx new file mode 100644 index 0000000000..01480ab45a --- /dev/null +++ b/examples/react/start-large-route-modules/template/account/src/routes/index.tsx @@ -0,0 +1,21 @@ +import { createFileRoute } from '../routeScope.gen' +import { getAccount } from '../api' + +export const Route = createFileRoute('@large-route-modules/account:/')({ + loader: () => getAccount(), + component: Account, +}) + +function Account() { + const account = Route.useLoaderData() + return ( +
+
Name
+
{account.name}
+
Plan
+
{account.plan}
+
Seats
+
{account.seats}
+
+ ) +} diff --git a/examples/react/start-large-route-modules/template/feature/src/api.ts b/examples/react/start-large-route-modules/template/feature/src/api.ts new file mode 100644 index 0000000000..4cf635cb26 --- /dev/null +++ b/examples/react/start-large-route-modules/template/feature/src/api.ts @@ -0,0 +1,45 @@ +import { notFound } from '@tanstack/react-router' +import { createMiddleware, createServerFn } from './routeScope.gen' + +// Module-local: only this module's server functions run it. +const audience = createMiddleware({ type: 'function' }).server( + ({ context, next }) => + next({ context: { audience: `${context.viewer} in __MODULE_ID__` } }), +) + +const items = Array.from({ length: 24 }, (_, index) => ({ + id: `item-${index + 1}`, + name: `__TITLE__ item ${index + 1}`, + quantity: (index * 7) % 13, +})) + +export const listItems = createServerFn() + .middleware([audience]) + .handler(({ context }) => ({ + audience: context.audience, + items: items.slice(0, 8).map(({ id, name }) => ({ id, name })), + })) + +export const getItem = createServerFn() + .middleware([audience]) + .validator((id: string) => id) + .handler(({ data, context }) => { + const item = items.find((candidate) => candidate.id === data) + if (!item) { + throw notFound() + } + return { ...item, viewedBy: context.audience } + }) + +const pageSize = 6 + +/** Filters the items on whichever side runs the loader. */ +export function searchItems(query: string, page: number) { + const matches = items.filter((item) => + item.name.toLowerCase().includes(query.toLowerCase()), + ) + return { + items: matches.slice((page - 1) * pageSize, page * pageSize), + hasMore: matches.length > page * pageSize, + } +} diff --git a/examples/react/start-large-route-modules/template/feature/src/requirements.ts b/examples/react/start-large-route-modules/template/feature/src/requirements.ts new file mode 100644 index 0000000000..4f1f611458 --- /dev/null +++ b/examples/react/start-large-route-modules/template/feature/src/requirements.ts @@ -0,0 +1,10 @@ +export type { StartModuleRequirements } from '@tanstack/react-start' + +// The application says who is viewing; the module does not authenticate. +declare module '@tanstack/react-start' { + interface StartModuleRequirements { + ['__MODULE_ID__']: { + requestContext: { viewer: string } + } + } +} diff --git a/examples/react/start-large-route-modules/template/feature/src/routes/$itemId.tsx b/examples/react/start-large-route-modules/template/feature/src/routes/$itemId.tsx new file mode 100644 index 0000000000..3619e92ef4 --- /dev/null +++ b/examples/react/start-large-route-modules/template/feature/src/routes/$itemId.tsx @@ -0,0 +1,28 @@ +import { Link, account, createFileRoute } from '../routeScope.gen' +import { getItem } from '../api' + +export const Route = createFileRoute('__MODULE_ID__:/$itemId')({ + loader: ({ params }) => getItem({ data: params.itemId }), + component: Item, +}) + +function Item() { + const item = Route.useLoaderData() + return ( +
+

{item.name}

+
+
Quantity
+
{item.quantity}
+
Viewed by
+
+ {item.viewedBy} +
+
+

+ All items ·{' '} + Your account +

+
+ ) +} diff --git a/examples/react/start-large-route-modules/template/feature/src/routes/__root.tsx b/examples/react/start-large-route-modules/template/feature/src/routes/__root.tsx new file mode 100644 index 0000000000..2c74ff494e --- /dev/null +++ b/examples/react/start-large-route-modules/template/feature/src/routes/__root.tsx @@ -0,0 +1,28 @@ +import { Outlet } from '@tanstack/react-router' +import { Link, createModuleRoot } from '../routeScope.gen' +export type {} from '../requirements' + +export const Route = createModuleRoot()({ + component: FeatureLayout, +}) + +function FeatureLayout() { + return ( +
+

+ __MODULE_ID__ {Route.fullPath} +

+

__TITLE__

+ + +
+ ) +} diff --git a/examples/react/start-large-route-modules/template/feature/src/routes/index.tsx b/examples/react/start-large-route-modules/template/feature/src/routes/index.tsx new file mode 100644 index 0000000000..0bb446ebda --- /dev/null +++ b/examples/react/start-large-route-modules/template/feature/src/routes/index.tsx @@ -0,0 +1,25 @@ +import { Link, createFileRoute } from '../routeScope.gen' +import { listItems } from '../api' + +export const Route = createFileRoute('__MODULE_ID__:/')({ + loader: () => listItems(), + component: Items, +}) + +function Items() { + const { audience, items } = Route.useLoaderData() + return ( + <> +

Loaded on the server for {audience}.

+
    + {items.map((item) => ( +
  • + + {item.name} + +
  • + ))} +
+ + ) +} diff --git a/examples/react/start-large-route-modules/template/feature/src/routes/pages/page.tsx b/examples/react/start-large-route-modules/template/feature/src/routes/pages/page.tsx new file mode 100644 index 0000000000..e4e2b1a42c --- /dev/null +++ b/examples/react/start-large-route-modules/template/feature/src/routes/pages/page.tsx @@ -0,0 +1,30 @@ +import { Fragment } from 'react' +import { Link, createFileRoute } from '../../routeScope.gen' + +export const Route = createFileRoute('__MODULE_ID__:/pages/page-__PAGE__')({ + loader: () => ({ + rows: Array.from({ length: 8 }, (_, index) => ({ + label: `Row ${index + 1}`, + value: (index + 1) * (__PAGE__ + 1), + })), + }), + component: Page, +}) + +function Page() { + const { rows } = Route.useLoaderData() + return ( +
+

Page __PAGE__ of __TITLE__

+
+ {rows.map((row) => ( + +
{row.label}
+
{row.value}
+
+ ))} +
+ Next page +
+ ) +} diff --git a/examples/react/start-large-route-modules/template/feature/src/routes/search.tsx b/examples/react/start-large-route-modules/template/feature/src/routes/search.tsx new file mode 100644 index 0000000000..a6316c2946 --- /dev/null +++ b/examples/react/start-large-route-modules/template/feature/src/routes/search.tsx @@ -0,0 +1,44 @@ +import { Link, createFileRoute } from '../routeScope.gen' +import { searchItems } from '../api' + +export const Route = createFileRoute('__MODULE_ID__:/search')({ + validateSearch: (search: Record) => ({ + q: typeof search.q === 'string' ? search.q : '', + page: Math.max(1, Number(search.page) || 1), + }), + loaderDeps: ({ search }) => search, + loader: ({ deps }) => searchItems(deps.q, deps.page), + component: Search, +}) + +function Search() { + const { q, page } = Route.useSearch() + const results = Route.useLoaderData() + const navigate = Route.useNavigate() + return ( + <> + + navigate({ search: { q: event.target.value, page: 1 } }) + } + /> +
    + {results.items.map((item) => ( +
  • + + {item.name} + +
  • + ))} +
+ {results.hasMore ? ( + + Next results + + ) : null} + + ) +} diff --git a/package.json b/package.json index 3ef11b1969..311397e48e 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "markdown-link-extractor": "^4.0.3", "nx": "24.0.0", "prettier": "^3.8.0", + "sass": "1.97.2", "tinyglobby": "^0.2.15", "typescript": "npm:@typescript/typescript6@^6.0.2", "vite": "catalog:", diff --git a/packages/eslint-plugin-router/src/__tests__/fixtures/app/package.json b/packages/eslint-plugin-router/src/__tests__/fixtures/app/package.json new file mode 100644 index 0000000000..87b8a0c318 --- /dev/null +++ b/packages/eslint-plugin-router/src/__tests__/fixtures/app/package.json @@ -0,0 +1,4 @@ +{ + "name": "@fixture/app", + "private": true +} diff --git a/packages/eslint-plugin-router/src/__tests__/fixtures/route-module/package.json b/packages/eslint-plugin-router/src/__tests__/fixtures/route-module/package.json new file mode 100644 index 0000000000..1f7a8ccc84 --- /dev/null +++ b/packages/eslint-plugin-router/src/__tests__/fixtures/route-module/package.json @@ -0,0 +1,17 @@ +{ + "name": "@fixture/route-module", + "private": true, + "tanstack": { + "router": { + "module": { + "uses": [ + "@fixture/used", + { + "module": "@fixture/other", + "as": "other" + } + ] + } + } + } +} diff --git a/packages/eslint-plugin-router/src/__tests__/route-module-imports.rule.test.ts b/packages/eslint-plugin-router/src/__tests__/route-module-imports.rule.test.ts new file mode 100644 index 0000000000..f9cb1b20f1 --- /dev/null +++ b/packages/eslint-plugin-router/src/__tests__/route-module-imports.rule.test.ts @@ -0,0 +1,156 @@ +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { RuleTester } from '@typescript-eslint/rule-tester' + +import { + name, + rule, +} from '../rules/route-module-imports/route-module-imports.rule' + +const fixtures = path.join( + path.dirname(fileURLToPath(import.meta.url)), + 'fixtures', +) +const moduleFile = path.join(fixtures, 'route-module/src/routes/index.tsx') +const appFile = path.join(fixtures, 'app/src/routes/index.tsx') +const generatedFile = path.join(fixtures, 'route-module/src/routeScope.gen.ts') + +const ruleTester = new RuleTester() + +ruleTester.run(name, rule, { + valid: [ + { + name: 'scope imports in a route module', + filename: moduleFile, + code: ` + import { createFileRoute, Link } from '../routeScope.gen' + export const Route = createFileRoute('@fixture/route-module:/')({}) + `, + }, + { + name: 'APIs the scope does not provide', + filename: moduleFile, + code: ` + import { Outlet, createSerializationAdapter } from '@tanstack/react-router' + import { useServerFn } from '@tanstack/react-start' + `, + }, + { + name: 'type-only imports', + filename: moduleFile, + code: ` + import type { Link } from '@tanstack/react-router' + import { type useNavigate } from '@tanstack/solid-router' + `, + }, + { + name: 'applications are not route modules', + filename: appFile, + code: ` + import { createFileRoute, Link, createRootRoute } from '@tanstack/react-router' + import { createServerFn } from '@tanstack/react-start' + `, + }, + ...[ + generatedFile, + path.join(fixtures, 'route-module/src/routeScope.gen.namespace0.ts'), + path.join(fixtures, 'route-module/src/routeScope.gen.products.ts'), + path.join(fixtures, 'route-module/src/routeScope.gen/products.ts'), + ].map((filename) => ({ + name: `generated file ${path.relative(fixtures, filename)}`, + filename, + code: ` + import { createServerFn as createStartServerFn } from '@tanstack/react-start' + import type { Router } from '@fixture/used/route-types' + `, + })), + { + name: 'imports from modules that are not used', + filename: moduleFile, + code: ` + import { schema } from '@fixture/shared' + import type { Order } from '@fixture/used-not' + import { used } from '../routeScope.gen' + `, + }, + { + name: 'used modules imported by an application', + filename: appFile, + code: ` + import type { Router } from '@fixture/used/route-types' + `, + }, + ], + invalid: [ + { + name: 'imports from used modules', + filename: moduleFile, + code: ` + import type { Order } from '@fixture/used' + import { formatPrice } from '@fixture/used/api' + import { type Settings } from '@fixture/other' + `, + errors: [ + { messageId: 'noUsedModuleImport', data: { module: '@fixture/used' } }, + { messageId: 'noUsedModuleImport', data: { module: '@fixture/used' } }, + { messageId: 'noUsedModuleImport', data: { module: '@fixture/other' } }, + ], + }, + { + name: 're-exports of and dynamic imports from used modules', + filename: moduleFile, + code: ` + export * from '@fixture/used/schemas' + export type { Order } from '@fixture/used' + const load = () => import('@fixture/other/api') + `, + errors: [ + { messageId: 'noUsedModuleImport', data: { module: '@fixture/used' } }, + { messageId: 'noUsedModuleImport', data: { module: '@fixture/used' } }, + { messageId: 'noUsedModuleImport', data: { module: '@fixture/other' } }, + ], + }, + { + name: 'routing APIs from the framework package', + filename: moduleFile, + code: ` + import { createFileRoute, Link as RouterLink, Outlet } from '@tanstack/react-router' + import { useNavigate } from '@tanstack/vue-router' + import { useLinkProps, useBlocker, notFound } from '@tanstack/solid-router' + `, + errors: [ + { messageId: 'useRouteScope', data: { name: 'createFileRoute' } }, + { messageId: 'useRouteScope', data: { name: 'Link' } }, + { messageId: 'useRouteScope', data: { name: 'useNavigate' } }, + { messageId: 'useRouteScope', data: { name: 'useLinkProps' } }, + { messageId: 'useRouteScope', data: { name: 'useBlocker' } }, + { messageId: 'useRouteScope', data: { name: 'notFound' } }, + ], + }, + { + name: 'root route constructors', + filename: moduleFile, + code: ` + import { createRootRouteWithContext } from '@tanstack/solid-router' + `, + errors: [ + { + messageId: 'useModuleRoot', + data: { name: 'createRootRouteWithContext' }, + }, + ], + }, + { + name: 'Start APIs from the framework package', + filename: moduleFile, + code: ` + import { createServerFn, createMiddleware, createStartModule } from '@tanstack/react-start' + `, + errors: [ + { messageId: 'useRouteScope', data: { name: 'createServerFn' } }, + { messageId: 'useRouteScope', data: { name: 'createMiddleware' } }, + { messageId: 'useRouteScope', data: { name: 'createStartModule' } }, + ], + }, + ], +}) diff --git a/packages/eslint-plugin-router/src/index.ts b/packages/eslint-plugin-router/src/index.ts index 7b8855cdf2..5bbc48de1e 100644 --- a/packages/eslint-plugin-router/src/index.ts +++ b/packages/eslint-plugin-router/src/index.ts @@ -27,6 +27,7 @@ Object.assign(plugin.configs, { rules: { '@tanstack/router/create-route-property-order': 'warn', '@tanstack/router/route-param-names': 'error', + '@tanstack/router/route-module-imports': 'error', }, }, 'flat/recommended': [ @@ -37,6 +38,7 @@ Object.assign(plugin.configs, { rules: { '@tanstack/router/create-route-property-order': 'warn', '@tanstack/router/route-param-names': 'error', + '@tanstack/router/route-module-imports': 'error', }, }, ], diff --git a/packages/eslint-plugin-router/src/rules.ts b/packages/eslint-plugin-router/src/rules.ts index 1042929a45..ebe904d098 100644 --- a/packages/eslint-plugin-router/src/rules.ts +++ b/packages/eslint-plugin-router/src/rules.ts @@ -1,5 +1,6 @@ import * as createRoutePropertyOrder from './rules/create-route-property-order/create-route-property-order.rule' import * as routeParamNames from './rules/route-param-names/route-param-names.rule' +import * as routeModuleImports from './rules/route-module-imports/route-module-imports.rule' import type { ESLintUtils } from '@typescript-eslint/utils' import type { ExtraRuleDocs } from './types' @@ -14,4 +15,5 @@ export const rules: Record< > = { [createRoutePropertyOrder.name]: createRoutePropertyOrder.rule, [routeParamNames.name]: routeParamNames.rule, + [routeModuleImports.name]: routeModuleImports.rule, } diff --git a/packages/eslint-plugin-router/src/rules/route-module-imports/constants.ts b/packages/eslint-plugin-router/src/rules/route-module-imports/constants.ts new file mode 100644 index 0000000000..fe33b59074 --- /dev/null +++ b/packages/eslint-plugin-router/src/rules/route-module-imports/constants.ts @@ -0,0 +1,45 @@ +/** + * Routing APIs a route module's generated scope (`routeScope.gen.ts`) exports + * typed against the module's own routes. Keep in step with `scopeApis` in + * `packages/router-generator/src/route-module/emit.ts`. + */ +export const scopedRouterApis = [ + 'createFileRoute', + 'Link', + 'createLink', + 'linkOptions', + 'Navigate', + 'useNavigate', + 'redirect', + 'MatchRoute', + 'useMatchRoute', + 'useRouter', + 'getRouteApi', + 'useMatch', + 'useMatches', + 'useParentMatches', + 'useChildMatches', + 'useLoaderData', + 'useLoaderDeps', + 'useSearch', + 'useParams', + 'useRouteContext', + 'useLocation', + 'useRouterState', + 'useLinkProps', + 'useBlocker', + 'notFound', +] as const + +/** Root route constructors; a route module's root is `createModuleRoot`. */ +export const rootRouteConstructors = [ + 'createRootRoute', + 'createRootRouteWithContext', +] as const + +/** Start APIs a Start route module's scope exports. */ +export const scopedStartApis = [ + 'createServerFn', + 'createMiddleware', + 'createStartModule', +] as const diff --git a/packages/eslint-plugin-router/src/rules/route-module-imports/route-module-imports.rule.ts b/packages/eslint-plugin-router/src/rules/route-module-imports/route-module-imports.rule.ts new file mode 100644 index 0000000000..2ee1110ba1 --- /dev/null +++ b/packages/eslint-plugin-router/src/rules/route-module-imports/route-module-imports.rule.ts @@ -0,0 +1,128 @@ +import path from 'node:path' +import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils' + +import { getDocsUrl } from '../../utils/get-docs-url' +import { + rootRouteConstructors, + scopedRouterApis, + scopedStartApis, +} from './constants' +import { + getRouteModule, + getUsedModule, + isGeneratedFile, +} from './route-module-imports.utils' +import type { TSESTree } from '@typescript-eslint/utils' +import type { ExtraRuleDocs } from '../../types' + +const createRule = ESLintUtils.RuleCreator(getDocsUrl) + +const routerPackage = /^@tanstack\/(react|solid|vue)-router$/ +const startPackage = /^@tanstack\/(react|solid|vue)-start$/ +const scopedRouterApiSet = new Set(scopedRouterApis) +const rootRouteConstructorSet = new Set(rootRouteConstructors) +const scopedStartApiSet = new Set(scopedStartApis) + +export const name = 'route-module-imports' + +export const rule = createRule({ + name, + meta: { + type: 'problem', + docs: { + description: + 'Ensure route modules import routing and Start APIs from their generated route scope and do not import from the modules they use', + recommended: 'error', + }, + messages: { + useRouteScope: + '"{{name}}" in a route module must be imported from its generated route scope (routeScope.gen), which types it against the module\'s own routes.', + useModuleRoot: + 'The root route of a route module is created with "createModuleRoot" from its generated route scope (routeScope.gen), not with "{{name}}".', + noUsedModuleImport: + 'A route module must not import from a module it uses ("{{module}}"), in values or in types: its declaration build compiles against a stand-in for that module\'s contract. Link into its routes through the generated namespace in routeScope.gen, and move shared code into a package both modules depend on.', + }, + schema: [], + }, + defaultOptions: [], + + create(context) { + const filename = context.filename + const module = isGeneratedFile(filename) + ? null + : getRouteModule(path.dirname(filename)) + if (!module) { + return {} + } + + const reportUsedModule = (node: TSESTree.Node, source: string) => { + const used = getUsedModule(module, source) + if (used !== undefined) { + context.report({ + node, + messageId: 'noUsedModuleImport', + data: { module: used }, + }) + } + } + + return { + ExportNamedDeclaration(node) { + if (node.source) { + reportUsedModule(node, node.source.value) + } + }, + ExportAllDeclaration(node) { + reportUsedModule(node, node.source.value) + }, + ImportExpression(node) { + if ( + node.source.type === AST_NODE_TYPES.Literal && + typeof node.source.value === 'string' + ) { + reportUsedModule(node, node.source.value) + } + }, + ImportDeclaration(node) { + reportUsedModule(node, node.source.value) + if (node.importKind === 'type') { + return + } + const source = node.source.value + const fromRouter = routerPackage.test(source) + const fromStart = startPackage.test(source) + if (!fromRouter && !fromStart) { + return + } + for (const specifier of node.specifiers) { + if ( + specifier.type !== AST_NODE_TYPES.ImportSpecifier || + specifier.importKind === 'type' + ) { + continue + } + const imported = + specifier.imported.type === AST_NODE_TYPES.Identifier + ? specifier.imported.name + : specifier.imported.value + if (fromRouter && rootRouteConstructorSet.has(imported)) { + context.report({ + node: specifier, + messageId: 'useModuleRoot', + data: { name: imported }, + }) + } else if ( + (fromRouter && scopedRouterApiSet.has(imported)) || + (fromStart && scopedStartApiSet.has(imported)) + ) { + context.report({ + node: specifier, + messageId: 'useRouteScope', + data: { name: imported }, + }) + } + } + }, + } + }, +}) diff --git a/packages/eslint-plugin-router/src/rules/route-module-imports/route-module-imports.utils.ts b/packages/eslint-plugin-router/src/rules/route-module-imports/route-module-imports.utils.ts new file mode 100644 index 0000000000..ded3af2ac5 --- /dev/null +++ b/packages/eslint-plugin-router/src/rules/route-module-imports/route-module-imports.utils.ts @@ -0,0 +1,114 @@ +import fs from 'node:fs' +import path from 'node:path' + +/** What the rule needs to know about the route module a file belongs to. */ +export interface RouteModuleInfo { + /** Ids of the modules the package lists in `tanstack.router.module.uses`. */ + uses: ReadonlyArray +} + +/** The nearest `package.json` of a directory; `null` when there is none. */ +const packageJsonByDirectory = new Map() +/** Parsed route-module declarations, revalidated by modification time. */ +const routeModuleByPackageJson = new Map< + string, + { mtimeMs: number; info: RouteModuleInfo | null } +>() + +function findPackageJson(directory: string): string | null { + const visited: Array = [] + let current = path.resolve(directory) + let result: string | null = null + for (;;) { + const cached = packageJsonByDirectory.get(current) + if (cached !== undefined) { + result = cached + break + } + visited.push(current) + const packageJsonPath = path.join(current, 'package.json') + if (fs.existsSync(packageJsonPath)) { + result = packageJsonPath + break + } + const parent = path.dirname(current) + if (parent === current) { + break + } + current = parent + } + for (const dir of visited) { + packageJsonByDirectory.set(dir, result) + } + return result +} + +function readRouteModule(packageJsonPath: string): RouteModuleInfo | null { + try { + const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) + const declaration = packageJson?.tanstack?.router?.module + if (declaration === undefined) { + return null + } + const uses: Array = Array.isArray(declaration?.uses) + ? declaration.uses + : [] + return { + uses: uses.flatMap((entry) => { + const module = + typeof entry === 'string' + ? entry + : (entry as { module?: unknown } | null)?.module + return typeof module === 'string' ? [module] : [] + }), + } + } catch { + return null + } +} + +/** + * The route module `directory` belongs to: its nearest `package.json` + * declares `tanstack.router.module`. `null` for other packages. The + * directory walk is cached for the process; the declaration is re-read when + * the package.json changes, so a long-lived ESLint server sees edits. + */ +export function getRouteModule(directory: string): RouteModuleInfo | null { + const packageJsonPath = findPackageJson(directory) + if (packageJsonPath === null) { + return null + } + let mtimeMs: number + try { + mtimeMs = fs.statSync(packageJsonPath).mtimeMs + } catch { + return null + } + const cached = routeModuleByPackageJson.get(packageJsonPath) + if (cached && cached.mtimeMs === mtimeMs) { + return cached.info + } + const info = readRouteModule(packageJsonPath) + routeModuleByPackageJson.set(packageJsonPath, { mtimeMs, info }) + return info +} + +/** The used module an import specifier points into, if any. */ +export function getUsedModule( + module: RouteModuleInfo, + source: string, +): string | undefined { + return module.uses.find( + (used) => source === used || source.startsWith(`${used}/`), + ) +} + +/** + * Generated files: `routeScope.gen.ts`, the namespace files of every + * `routeScopeNamespaceFiles` layout (`routeScope.gen.namespace0.ts`, + * `routeScope.gen.products.ts`, `routeScope.gen/products.ts`) and the route + * trees. They import the framework and used contracts themselves. + */ +export function isGeneratedFile(filename: string): boolean { + return /\.gen(?:\.|[\\/])/.test(filename) +} diff --git a/packages/eslint-plugin-router/tsconfig.json b/packages/eslint-plugin-router/tsconfig.json index cbceff3f8b..1715152a91 100644 --- a/packages/eslint-plugin-router/tsconfig.json +++ b/packages/eslint-plugin-router/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "moduleResolution": "Bundler" + "moduleResolution": "Bundler", + "types": ["node"] }, "include": ["src", "eslint.config.js", "vite.config.ts"] } diff --git a/packages/react-router/package.json b/packages/react-router/package.json index 9a61d5af25..94ce82d1ac 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -27,12 +27,12 @@ "clean": "rimraf ./dist && rimraf ./coverage", "test:eslint": "eslint", "test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"", - "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js -p tsconfig.legacy.json", - "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js -p tsconfig.legacy.json", - "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js -p tsconfig.legacy.json", - "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js -p tsconfig.legacy.json", - "test:types:ts60": "tsc6 -p tsconfig.legacy.json", - "test:types:ts70": "tsc -p tsconfig.legacy.json", + "test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js -p tsconfig.legacy.json && node ../../node_modules/typescript56/lib/tsc.js -p tests/registered-router-cycle/tsconfig.json", + "test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js -p tsconfig.legacy.json && node ../../node_modules/typescript57/lib/tsc.js -p tests/registered-router-cycle/tsconfig.json", + "test:types:ts58": "node ../../node_modules/typescript58/lib/tsc.js -p tsconfig.legacy.json && node ../../node_modules/typescript58/lib/tsc.js -p tests/registered-router-cycle/tsconfig.json", + "test:types:ts59": "node ../../node_modules/typescript59/lib/tsc.js -p tsconfig.legacy.json && node ../../node_modules/typescript59/lib/tsc.js -p tests/registered-router-cycle/tsconfig.json", + "test:types:ts60": "tsc6 -p tsconfig.legacy.json && tsc6 -p tests/registered-router-cycle/tsconfig.json", + "test:types:ts70": "tsc -p tsconfig.legacy.json && tsc -p tests/registered-router-cycle/tsconfig.json", "test:unit": "vitest", "test:unit:dev": "pnpm run test:unit --watch --hideSkippedTests", "test:perf": "vitest bench", @@ -81,7 +81,17 @@ "default": "./dist/cjs/ssr/client.cjs" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./_internal/route-module": { + "import": { + "types": "./dist/esm/route-module-internal.d.ts", + "default": "./dist/esm/route-module-internal.js" + }, + "require": { + "types": "./dist/cjs/route-module-internal.d.cts", + "default": "./dist/cjs/route-module-internal.cjs" + } + } }, "sideEffects": false, "files": [ diff --git a/packages/react-router/src/Match.tsx b/packages/react-router/src/Match.tsx index db1d341ec4..a6dd8c6d94 100644 --- a/packages/react-router/src/Match.tsx +++ b/packages/react-router/src/Match.tsx @@ -1,5 +1,6 @@ 'use client' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import * as React from 'react' import { useSelector } from '@tanstack/react-store' import { isNotFound, rootRouteId } from '@tanstack/router-core' @@ -111,7 +112,13 @@ function matchView(router: ReturnType, match: AnyRouteMatch) { { error.routeId ??= match.routeId - if (error.routeId !== match.routeId) { + if ( + (routeModules?.resolveRouteId( + router, + error.routeId, + match.routeId, + ) ?? error.routeId) !== match.routeId + ) { throw error } const notFoundElement = React.createElement( diff --git a/packages/react-router/src/Matches.tsx b/packages/react-router/src/Matches.tsx index a20c862b23..50c118769a 100644 --- a/packages/react-router/src/Matches.tsx +++ b/packages/react-router/src/Matches.tsx @@ -25,12 +25,14 @@ import type { MakeRouteMatchUnion, MaskOptions, MatchRouteOptions, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveRoute, ToSubOptionsProps, } from '@tanstack/router-core' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface RouteMatchExtensions { meta?: Array links?: Array @@ -134,6 +136,21 @@ export type UseMatchRouteOptions< MaskOptions & MatchRouteOptions +/** + * The signature of `useMatchRoute`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useMatchRoute` of this type. + */ +export type UseMatchRouteFn = < + TRouter extends AnyRouter = RegisteredRouterOf, +>() => < + const TFrom extends string = string, + const TTo extends string | undefined = undefined, + const TMaskFrom extends string = TFrom, + const TMaskTo extends string = '', +>( + opts: UseMatchRouteOptions, +) => false | Expand['types']['allParams']> + /** * Create a matcher function for testing locations against route definitions. * @@ -213,6 +230,20 @@ export type MakeMatchRouteOptions< | React.ReactNode } +/** + * The signature of `MatchRoute`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `MatchRoute` of this type. + */ +export type MatchRouteFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string = string, + const TTo extends string | undefined = undefined, + const TMaskFrom extends string = TFrom, + const TMaskTo extends string = '', +>( + props: MakeMatchRouteOptions, +) => any + /** * Component that conditionally renders its children based on whether a route * matches the provided `from`/`to` options. If `children` is a function, it @@ -252,6 +283,19 @@ export type UseMatchesResult< TSelected, > = unknown extends TSelected ? Array> : TSelected +/** + * The signature of `useMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useMatches` of this type. + */ +export type UseMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts?: UseMatchesBaseOptions & + StructuralSharingOption, +) => UseMatchesResult + export function useMatches< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, @@ -280,6 +324,19 @@ export function useMatches< ) as UseMatchesResult } +/** + * The signature of `useParentMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useParentMatches` of this type. + */ +export type UseParentMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts?: UseMatchesBaseOptions & + StructuralSharingOption, +) => UseMatchesResult + /** * Read the presented route matches above the current match, or select a * derived value from them. @@ -306,6 +363,19 @@ export function useParentMatches< } as any) } +/** + * The signature of `useChildMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useChildMatches` of this type. + */ +export type UseChildMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts?: UseMatchesBaseOptions & + StructuralSharingOption, +) => UseMatchesResult + /** * Read the presented route matches below the current match, or select a * derived value from them. diff --git a/packages/react-router/src/fileRoute.ts b/packages/react-router/src/fileRoute.ts index f4d8c9b967..154422460c 100644 --- a/packages/react-router/src/fileRoute.ts +++ b/packages/react-router/src/fileRoute.ts @@ -64,6 +64,81 @@ export function createFileRoute< } } +/** + * The route factory returned by `createFileRoute(path)`. `TDefaultRegister` + * is the scope of the created route: the application's `Register`, or the + * scope register of a route module. + */ +export type FileRouteFactory< + TFilePath extends string, + TParentRoute extends AnyRoute, + TId extends RouteConstraints['TId'], + TPath extends RouteConstraints['TPath'], + TFullPath extends RouteConstraints['TFullPath'], + TDefaultRegister = Register, +> = < + TRegister = TDefaultRegister, + TSearchValidator = undefined, + TParams = ResolveParams, + TRouteContextFn = AnyContext, + TBeforeLoadFn = AnyContext, + TLoaderDeps extends Record = {}, + TLoaderFn = undefined, + TChildren = unknown, + TSSR = unknown, + const TMiddlewares = unknown, + THandlers = undefined, +>( + options?: FileBaseRouteOptions< + TRegister, + TParentRoute, + TId, + TPath, + TSearchValidator, + TParams, + TLoaderDeps, + TLoaderFn, + AnyContext, + TRouteContextFn, + TBeforeLoadFn, + AnyContext, + TSSR, + TMiddlewares, + THandlers + > & + UpdatableRouteOptions< + TParentRoute, + TId, + TFullPath, + TParams, + TSearchValidator, + TLoaderFn, + TLoaderDeps, + AnyContext, + TRouteContextFn, + TBeforeLoadFn + >, +) => Route< + TRegister, + TParentRoute, + TPath, + TFullPath, + TFilePath, + TId, + TSearchValidator, + TParams, + AnyContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + TChildren, + unknown, + TSSR, + TMiddlewares, + THandlers +> + /** @deprecated It's no longer recommended to use the `FileRoute` class directly. Instead, use `createFileRoute('/path/to/file')(options)` to create a file route. @@ -85,68 +160,13 @@ export class FileRoute< this.silent = _opts?.silent } - createRoute = < - TRegister = Register, - TSearchValidator = undefined, - TParams = ResolveParams, - TRouteContextFn = AnyContext, - TBeforeLoadFn = AnyContext, - TLoaderDeps extends Record = {}, - TLoaderFn = undefined, - TChildren = unknown, - TSSR = unknown, - const TMiddlewares = unknown, - THandlers = undefined, - >( - options?: FileBaseRouteOptions< - TRegister, - TParentRoute, - TId, - TPath, - TSearchValidator, - TParams, - TLoaderDeps, - TLoaderFn, - AnyContext, - TRouteContextFn, - TBeforeLoadFn, - AnyContext, - TSSR, - TMiddlewares, - THandlers - > & - UpdatableRouteOptions< - TParentRoute, - TId, - TFullPath, - TParams, - TSearchValidator, - TLoaderFn, - TLoaderDeps, - AnyContext, - TRouteContextFn, - TBeforeLoadFn - >, - ): Route< - TRegister, - TParentRoute, - TPath, - TFullPath, + createRoute: FileRouteFactory< TFilePath, + TParentRoute, TId, - TSearchValidator, - TParams, - AnyContext, - TRouteContextFn, - TBeforeLoadFn, - TLoaderDeps, - TLoaderFn, - TChildren, - unknown, - TSSR, - TMiddlewares, - THandlers - > => { + TPath, + TFullPath + > = (options) => { if (process.env.NODE_ENV !== 'production') { if (!this.silent) { console.warn( @@ -192,7 +212,7 @@ export function FileRouteLoader< return (loaderFn) => loaderFn as any } -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface LazyRoute { useMatch: UseMatchRoute useRouteContext: UseRouteContextRoute diff --git a/packages/react-router/src/index.tsx b/packages/react-router/src/index.tsx index 23ebf57938..b3e11f3300 100644 --- a/packages/react-router/src/index.tsx +++ b/packages/react-router/src/index.tsx @@ -185,6 +185,8 @@ export type { ResolvedRedirect, MakeRouteMatch, MakeRouteMatchUnion, + KnownRouteMatchUnion, + ForeignRouteMatch, RouteMatch, AnyRouteMatch, RouteContextFn, @@ -269,9 +271,50 @@ export type { DefaultRouteTypes, RouteTypes, } from './route' +// `createFileRoute` returns router-core's `Route`, and `Route` above is this +// package's class: declarations name the type of file routes through this +// export, so they need no import of `@tanstack/router-core`. +export type { Route as RouteCore } from '@tanstack/router-core' export { createRouter, Router } from './router' +export type { FileRouteScope, RouteScope } from './routeModule' +export type { FileRouteFactory } from './fileRoute' +export type { + HostedRouter, + InstallationRoutesById, + MountedRoutesById, + ModuleRootRoute, + ModuleRootRouteOptions, + MountRouteModuleOptions, + RedirectFn, + RegisteredRouterOf, + ScopeRouter, + ScopedRouter, + ScopedRouterView, + ValidateRouteModuleMount, + ValidateRouteModuleMountPath, +} from '@tanstack/router-core' +export type { GetRouteApiFn } from './route' +export type { CreateLinkFn, LinkOptionsFn } from './link' +export type { NavigateComponentFn, UseNavigateFn } from './useNavigate' +export type { + MatchRouteFn, + UseChildMatchesFn, + UseMatchRouteFn, + UseMatchesFn, + UseParentMatchesFn, +} from './Matches' +export type { UseRouterFn } from './useRouter' +export type { UseMatchFn } from './useMatch' +export type { UseLoaderDataFn } from './useLoaderData' +export type { UseLoaderDepsFn } from './useLoaderDeps' +export type { UseSearchFn } from './useSearch' +export type { UseParamsFn } from './useParams' +export type { UseRouteContextFn } from './useRouteContext' +export type { UseLocationFn } from './useLocation' +export type { UseRouterStateFn } from './useRouterState' + export { lazyFn, SearchParamError } from '@tanstack/router-core' export { RouterProvider, RouterContextProvider } from './RouterProvider' diff --git a/packages/react-router/src/link.tsx b/packages/react-router/src/link.tsx index ce6a7ed9d1..101a13f7e2 100644 --- a/packages/react-router/src/link.tsx +++ b/packages/react-router/src/link.tsx @@ -10,18 +10,23 @@ import { removeTrailingSlash, } from '@tanstack/router-core' import { isServer } from '@tanstack/router-core/isServer' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import { useRouter } from './useRouter' import { createLinkScope, matchContext } from './matchContext' - import type { ActiveOptions, AnyRouter, Constrain, LinkOptions, ParsedLocation, + Register, RegisteredRouter, + RegisteredRouterOf, + RouteModuleScope, RoutePaths, + ScopedRouteOptions, } from '@tanstack/router-core' + import type { ReactNode } from 'react' import type { ValidateLinkOptions, @@ -131,6 +136,17 @@ function resolveIsActive( * @returns React anchor props suitable for `` or custom components. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useLinkPropsHook */ +export type UseLinkPropsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TFrom extends string = string, + TTo extends string = '', + TMaskFrom extends string = TFrom, + TMaskTo extends string = '', +>( + options: UseLinkPropsOptions, + forwardedRef?: React.ForwardedRef, +) => React.ComponentPropsWithRef<'a'> + export function useLinkProps< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, @@ -188,7 +204,14 @@ export function useLinkProps< // browser-build constant `isServer = false` and drop this server block, // together with `getServerLinkProps` and the key sets only it references. if (isServer ?? router.isServer) { - return getServerLinkProps(router, options, forwardedRef, host) + return getServerLinkProps( + router, + options, + forwardedRef, + host, + // eslint-disable-next-line react-hooks/rules-of-hooks -- the server condition is static + React.useContext(matchContext), + ) } // ========================================================================== @@ -247,8 +270,10 @@ export function useLinkProps< options.params, activeOptions, ) - // The links of a route share its location source. Links outside every - // match share one that never departs. + // The route of the nearest match: it scopes the links of a route, and + // module destinations resolve to the installation it belongs to. The links + // of a route share its location source. Links outside every match share + // one that never departs. // eslint-disable-next-line react-hooks/rules-of-hooks const routeId = React.useContext(matchContext) const scope = ((router.stores._linkScopes ??= {})[routeId!] ??= @@ -271,6 +296,11 @@ export function useLinkProps< } const dest = { ...options } as any + // The nearest route resolves module destinations to the installation + // the link renders under. Only the route-module translation reads it. + if (routeModules) { + dest._nearestRoute = routeId + } let source: ParsedLocation | undefined let state: LinkState let hydrationState: LinkState | undefined @@ -337,6 +367,12 @@ export function useLinkProps< options.unsafeRelative, stableActiveOptions, disabled, + // Spread route-module link options can change the scope of the same + // destination. The `_fromRoute` of a route's own `Link` is constant. + // eslint-disable-next-line react-hooks/exhaustive-deps -- the condition is constant for an application + ...(routeModules + ? [(options as { _module?: RouteModuleScope })._module] + : []), ]) // eslint-disable-next-line react-hooks/rules-of-hooks @@ -450,9 +486,18 @@ export function useLinkProps< cancelPreload(innerRef) // The current options carry the navigation controls; `dest` only - // contributes the location the link displays. Navigation builds again - // to run `validateSearch` before committing. - router.navigate({ ...options, _fromLocation: dest._fromLocation }) + // contributes the location the link displays and the installation of a + // module destination. Navigation builds again to run `validateSearch` + // before committing. + router.navigate( + routeModules + ? { + ...options, + _fromLocation: dest._fromLocation, + _nearestRoute: routeId, + } + : { ...options, _fromLocation: dest._fromLocation }, + ) } } @@ -480,7 +525,8 @@ export function useLinkProps< const STATIC_EMPTY_OBJECT = {} const STATIC_ACTIVE_OBJECT = { className: 'active' } // Options the router consumes; they never reach the element. Every other -// option is an element prop and passes through. +// option is an element prop and passes through. Route-module code adds the +// options of its scopes (`addRouteModuleLinkOptions`). const ROUTER_OPTION_KEYS = /* @__PURE__ */ new Set([ 'to', 'params', @@ -506,6 +552,11 @@ const ROUTER_OPTION_KEYS = /* @__PURE__ */ new Set([ '_asChild', ]) +/** Called by route-module code: its scopes pass these internal options. */ +export function addRouteModuleLinkOptions(): void { + ROUTER_OPTION_KEYS.add('_module').add('_fromRoute') +} + // Copies the element props. An object rest would test every key against the // whole exclusion list; the key set is much cheaper. `Link` hosts never render // `type`, and an anchor has no `disabled` attribute. @@ -588,6 +639,7 @@ function getServerLinkProps( options: any, forwardedRef: React.ForwardedRef | undefined, host: 'a' | React.ElementType | undefined, + routeId: string | undefined, ): React.ComponentPropsWithRef<'a'> { const { to, disabled, activeOptions } = options as { to: string | undefined @@ -600,7 +652,13 @@ function getServerLinkProps( // Direct-scheme links need no route resolution. Blocked links still use // the shared inactive-prop merge so their server and client markup agree. const next = - directExternalLink === undefined ? router.buildLocation(options) : undefined + directExternalLink === undefined + ? router.buildLocation( + options._module === undefined + ? options + : { ...options, _nearestRoute: routeId }, + ) + : undefined const hrefOption = next ? getHrefOption(next, router, disabled) @@ -778,8 +836,9 @@ export type CreateLinkProps = LinkProps< export type LinkComponent< in out TComp, in out TDefaultFrom extends string = string, + in out TDefaultRegister = Register, > = < - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, const TFrom extends string = TDefaultFrom, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, @@ -790,10 +849,11 @@ export type LinkComponent< export interface LinkComponentRoute< in out TDefaultFrom extends string = string, + in out TDefaultRegister = Register, > { defaultFrom: TDefaultFrom; < - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, const TTo extends string | undefined = undefined, const TMaskTo extends string = '', >( @@ -808,6 +868,14 @@ export interface LinkComponentRoute< ): React.ReactElement } +/** + * The signature of `createLink`, creating links typed against the router of `TDefaultRegister`. + * Route modules export a `createLink` of this type. + */ +export type CreateLinkFn = ( + Comp: Constrain ReactNode>, +) => LinkComponent + /** * Creates a typed Link-like component that preserves TanStack Router's * navigation semantics and type-safety while delegating rendering to the @@ -899,12 +967,12 @@ export type LinkOptionsFnOptions< ? ValidateLinkOptionsArray : ValidateLinkOptions -export type LinkOptionsFn = < +export type LinkOptionsFn = < const TOptions, - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, >( options: LinkOptionsFnOptions, -) => TOptions +) => ScopedRouteOptions /** * Validate and reuse navigation options for `Link`, `navigate` or `redirect`. diff --git a/packages/react-router/src/matchContext.tsx b/packages/react-router/src/matchContext.tsx index 12db4dbada..0948eb8048 100644 --- a/packages/react-router/src/matchContext.tsx +++ b/packages/react-router/src/matchContext.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { _isRouteDeparting } from '@tanstack/router-core' import type { AnyRoute, AnyRouter, ParsedLocation } from '@tanstack/router-core' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { // Declaration merging requires the original type parameters. // eslint-disable-next-line unused-imports/no-unused-vars interface RouterStores { diff --git a/packages/react-router/src/route-module-internal.ts b/packages/react-router/src/route-module-internal.ts new file mode 100644 index 0000000000..3ac86d6306 --- /dev/null +++ b/packages/react-router/src/route-module-internal.ts @@ -0,0 +1,6 @@ +// Internal generated/framework wiring; use generated scopes to author modules. +export * from './routeModule' +export { + mountRouteModule, + getRouteModuleId, +} from '@tanstack/router-core/_internal/route-module' diff --git a/packages/react-router/src/route.tsx b/packages/react-router/src/route.tsx index 57dca9ef02..6a11cb062d 100644 --- a/packages/react-router/src/route.tsx +++ b/packages/react-router/src/route.tsx @@ -4,6 +4,7 @@ import { BaseRouteApi, notFound, } from '@tanstack/router-core' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import React from 'react' import { useLoaderData } from './useLoaderData' import { useLoaderDeps } from './useLoaderDeps' @@ -24,6 +25,7 @@ import type { NotFoundRouteProps, Register, RegisteredRouter, + RegisteredRouterOf, ResolveFullPath, ResolveId, ResolveParams, @@ -48,7 +50,7 @@ import type { UseSearchRoute } from './useSearch' import type { UseRouteContextRoute } from './useRouteContext' import type { LinkComponentRoute } from './link' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface UpdatableRouteOptionsExtensions { component?: RouteComponent errorComponent?: false | null | undefined | ErrorRouteComponent @@ -67,18 +69,31 @@ declare module '@tanstack/router-core' { export interface RouteExtensions< in out TId extends string, in out TFullPath extends string, + in out TRegister, > { - useMatch: UseMatchRoute - useRouteContext: UseRouteContextRoute - useSearch: UseSearchRoute - useParams: UseParamsRoute - useLoaderDeps: UseLoaderDepsRoute - useLoaderData: UseLoaderDataRoute - useNavigate: () => UseNavigateResult - Link: LinkComponentRoute + useMatch: UseMatchRoute + useRouteContext: UseRouteContextRoute + useSearch: UseSearchRoute + useParams: UseParamsRoute + useLoaderDeps: UseLoaderDepsRoute + useLoaderData: UseLoaderDataRoute + useNavigate: () => UseNavigateResult + Link: LinkComponentRoute } } +/** + * The signature of `getRouteApi`, typed against the router of `TDefaultRegister` unless a + * router type is passed explicitly. Route modules export a `getRouteApi` of + * this type. + */ +export type GetRouteApiFn = < + const TId, + TRouter extends AnyRouter = RegisteredRouterOf, +>( + id: ConstrainLiteral>, +) => RouteApi + /** * Returns a route-specific API that exposes type-safe hooks pre-bound * to a single route ID. Useful for consuming a route's APIs from files @@ -106,49 +121,63 @@ export class RouteApi< super({ id }) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts) => { + useRouteContext: UseRouteContextRoute = (opts) => { return useRouteContext({ ...(opts as any), from: this.id }) } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id, strict: false } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id, strict: false } as any) } useNavigate = (): UseNavigateResult< - RouteTypesById['fullPath'] + RouteTypesById['fullPath'], + { router: TRouter } > => { const router = useRouter() - return useNavigate({ from: router.routesById[this.id as string].fullPath }) + return useNavigate({ + from: router.routesById[this.id as string]?.fullPath, + ...routeModules?.navigationScope(this.id as string), + } as any) as any } notFound = (opts?: NotFoundError) => { return notFound({ routeId: this.id as string, ...opts }) } - Link: LinkComponentRoute['fullPath']> = - React.forwardRef((props, ref: React.ForwardedRef) => { - const router = useRouter() - const fullPath = router.routesById[this.id as string].fullPath - return - }) as unknown as LinkComponentRoute< - RouteTypesById['fullPath'] - > + Link: LinkComponentRoute< + RouteTypesById['fullPath'], + { router: TRouter } + > = React.forwardRef((props, ref: React.ForwardedRef) => { + const router = useRouter() + const fullPath = router.routesById[this.id as string]?.fullPath + return ( + + ) + }) as unknown as LinkComponentRoute< + RouteTypesById['fullPath'], + { router: TRouter } + > } export class Route< @@ -246,39 +275,49 @@ export class Route< super(options) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts?) => { + useRouteContext: UseRouteContextRoute = (opts?) => { return useRouteContext({ ...(opts as any), from: this.id }) } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id } as any) } - useNavigate = (): UseNavigateResult => { - return useNavigate({ from: this.fullPath }) + useNavigate = (): UseNavigateResult => { + return useNavigate({ + from: this.fullPath, + ...routeModules?.navigationScope(this.id), + } as any) as any } - Link: LinkComponentRoute = React.forwardRef( + Link: LinkComponentRoute = React.forwardRef( (props, ref: React.ForwardedRef) => { - return + return ( + + ) }, - ) as unknown as LinkComponentRoute + ) as unknown as LinkComponentRoute } /** @@ -503,39 +542,39 @@ export class RootRoute< super(options) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts) => { + useRouteContext: UseRouteContextRoute = (opts) => { return useRouteContext({ ...(opts as any), from: this.id }) } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id } as any) } - useNavigate = (): UseNavigateResult<'/'> => { - return useNavigate({ from: this.fullPath }) + useNavigate = (): UseNavigateResult<'/', TRegister> => { + return useNavigate({ from: this.fullPath }) as any } - Link: LinkComponentRoute<'/'> = React.forwardRef( + Link: LinkComponentRoute<'/', TRegister> = React.forwardRef( (props, ref: React.ForwardedRef) => { return }, - ) as unknown as LinkComponentRoute<'/'> + ) as unknown as LinkComponentRoute<'/', TRegister> } /** diff --git a/packages/react-router/src/routeModule.tsx b/packages/react-router/src/routeModule.tsx new file mode 100644 index 0000000000..618bf513ad --- /dev/null +++ b/packages/react-router/src/routeModule.tsx @@ -0,0 +1,385 @@ +import * as React from 'react' +import { notFound } from '@tanstack/router-core' +import { + bindRouteScopeIdApi, + bindRouteScopeOptions, + createScopedRedirect, + getScopedRouterView, + installRouteModules, +} from '@tanstack/router-core/_internal/route-module' +import { Route, getRouteApi } from './route' +import { Link, addRouteModuleLinkOptions, useLinkProps } from './link' +import { Navigate, useNavigate } from './useNavigate' +import { MatchRoute, useMatchRoute } from './Matches' +import { useRouter } from './useRouter' +import { matchContext } from './matchContext' +import { useMatch } from './useMatch' +import { useLoaderData } from './useLoaderData' +import { useLoaderDeps } from './useLoaderDeps' +import { useSearch } from './useSearch' +import { useParams } from './useParams' +import { useRouteContext } from './useRouteContext' +import type { UseBlockerFn } from './useBlocker' +import type { + AnyContext, + AnyRoute, + AnyRouter, + ModuleRootRoute, + ModuleRootRouteOptions, + NotFoundError, + RedirectFn, + RouteIds, + ScopedRouterView, +} from '@tanstack/router-core' +import type { FileRouteFactory } from './fileRoute' +import type { GetRouteApiFn } from './route' +import type { + CreateLinkFn, + LinkComponent, + LinkOptionsFn, + UseLinkPropsFn, +} from './link' +import type { NavigateComponentFn, UseNavigateFn } from './useNavigate' +import type { + MatchRouteFn, + UseChildMatchesFn, + UseMatchRouteFn, + UseMatchesFn, + UseParentMatchesFn, +} from './Matches' +import type { UseMatchFn } from './useMatch' +import type { UseLoaderDataFn } from './useLoaderData' +import type { UseLoaderDepsFn } from './useLoaderDeps' +import type { UseSearchFn } from './useSearch' +import type { UseParamsFn } from './useParams' +import type { UseRouteContextFn } from './useRouteContext' +import type { UseLocationFn } from './useLocation' +import type { UseRouterStateFn } from './useRouterState' + +// Entries reference the route files, whose types depend on these factories: +// read one property at a time and never constrain or check whole entries. +type FileRouteEntry = + TFileRoutesByPath[TFilePath & keyof TFileRoutesByPath] +type FileRouteParent = + FileRouteEntry extends { + parentRoute: infer TParentRoute extends AnyRoute + } + ? TParentRoute + : never +type FileRouteId = + FileRouteEntry extends { + id: infer TId extends string + } + ? TId + : never +type FileRoutePath = + FileRouteEntry extends { + path: infer TPath extends string + } + ? TPath + : never +type FileRouteFullPath = + FileRouteEntry extends { + fullPath: infer TFullPath extends string + } + ? TFullPath + : never + +/** + * Route factories of a route module, typed against the module's generated + * `FileRoutesByPath` and its scope register instead of the application's + * global registrations. + */ +export interface FileRouteScope< + TFileRoutesByPath, + TRegister, + TModuleId extends string, +> { + /** `createFileRoute`, typed against the module's own route files. */ + createFileRoute: ( + path?: TFilePath, + ) => FileRouteFactory< + FileRouteId, + FileRouteParent, + FileRouteId, + FileRoutePath, + FileRouteFullPath, + TRegister + > + /** + * Creates the module root. `TRouterContext` is the router context the module + * requires from the route it is mounted under. + */ + createModuleRoot: () => < + TRouteContextFn = AnyContext, + TBeforeLoadFn = AnyContext, + TSearchValidator = undefined, + TLoaderDeps extends Record = {}, + TLoaderFn = undefined, + TSSR = unknown, + const TServerMiddlewares = unknown, + THandlers = undefined, + >( + options?: ModuleRootRouteOptions< + TModuleId, + TRegister, + TSearchValidator, + TRouterContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + TSSR, + TServerMiddlewares, + THandlers + >, + ) => ModuleRootRoute< + TModuleId, + TRegister, + TSearchValidator, + TRouterContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + unknown, + unknown, + TSSR, + TServerMiddlewares, + THandlers + > +} + +/** + * Installs the route-module behavior of the core and of this framework's + * links. Module roots call it when they are created, before an application + * creates its router. + */ +function installRouteModuleBindings() { + installRouteModules() + addRouteModuleLinkOptions() +} + +/** Binds only the module-root factory used by generated route scopes. */ +export function bindCreateModuleRoot( + moduleId: TModuleId, +): FileRouteScope['createModuleRoot'] { + return () => (options) => { + // Module routes resolve their route-bound APIs through the route-module + // behavior: install it with the first module root. Binding the factory + // itself, as every generated scope does, has no effect. + installRouteModuleBindings() + return new Route({ ...(options as any), _module: moduleId }) as any + } +} + +/** + * The routing APIs of a route scope, typed against `TRouter`. + * + * Path-based APIs (`Link`, `useNavigate`, `redirect`, ...) address routes by + * the module-local paths of the module: they work wherever the module is + * mounted. Id-based APIs (`useMatch`, `getRouteApi`, ...) take qualified route + * ids such as `@acme/products:/$productId`. + */ +export interface RouteScope { + Link: LinkComponent<'a', string, { router: TRouter }> + createLink: CreateLinkFn<{ router: TRouter }> + linkOptions: LinkOptionsFn<'a', { router: TRouter }> + Navigate: NavigateComponentFn<{ router: TRouter }> + useNavigate: UseNavigateFn<{ router: TRouter }> + useLinkProps: UseLinkPropsFn<{ router: TRouter }> + useBlocker: UseBlockerFn<{ router: TRouter }> + notFound: ( + options?: Omit & { + routeId?: RouteIds + }, + ) => NotFoundError + redirect: RedirectFn<{ router: TRouter }> + MatchRoute: MatchRouteFn<{ router: TRouter }> + useMatchRoute: UseMatchRouteFn<{ router: TRouter }> + /** + * The router, viewed from the module: its `navigate`, `buildLocation`, + * `preloadRoute` and `matchRoute` take module-local paths. + */ + useRouter: (opts?: { warn?: boolean }) => ScopedRouterView + getRouteApi: GetRouteApiFn<{ router: TRouter }> + useMatch: UseMatchFn<{ router: TRouter }> + useMatches: UseMatchesFn<{ router: TRouter }> + useParentMatches: UseParentMatchesFn<{ router: TRouter }> + useChildMatches: UseChildMatchesFn<{ router: TRouter }> + useLoaderData: UseLoaderDataFn<{ router: TRouter }> + useLoaderDeps: UseLoaderDepsFn<{ router: TRouter }> + useSearch: UseSearchFn<{ router: TRouter }> + useParams: UseParamsFn<{ router: TRouter }> + useRouteContext: UseRouteContextFn<{ router: TRouter }> + useLocation: UseLocationFn<{ router: TRouter }> + useRouterState: UseRouterStateFn<{ router: TRouter }> +} + +// Each generated ESM export binds only its own API. These functions allocate +// closures/components; they never access a router or register runtime state. +function useBoundOptions(moduleId: string): (options: any) => any { + const router = useRouter() + const routeId = React.useContext(matchContext) + return React.useCallback( + (options: any) => + bindRouteScopeOptions(moduleId, options ?? {}, router, routeId), + [moduleId, router, routeId], + ) +} + +export function bindRouteScopeLink( + moduleId: string, +): RouteScope['Link'] { + const AnyLink = Link as React.ComponentType + return React.forwardRef((props, ref) => { + const bind = useBoundOptions(moduleId) + return + }) as any +} + +export function bindRouteScopeCreateLink( + moduleId: string, +): RouteScope['createLink'] { + const AnyLink = Link as React.ComponentType + return ((Comp: unknown) => + React.forwardRef((props, ref) => { + const bind = useBoundOptions(moduleId) + return + })) as any +} + +export function bindRouteScopeNavigate( + moduleId: string, +): RouteScope['Navigate'] { + const AnyNavigate = Navigate as React.ComponentType + return function ScopedNavigate(props: object) { + const bind = useBoundOptions(moduleId) + return + } as any +} + +export function bindRouteScopeMatchRoute( + moduleId: string, +): RouteScope['MatchRoute'] { + const AnyMatchRoute = MatchRoute as React.ComponentType + return function ScopedMatchRoute(props: object) { + const bind = useBoundOptions(moduleId) + const routeId = React.useContext(matchContext) + return + } as any +} + +export function bindRouteScopeUseLinkProps( + moduleId: string, +): RouteScope['useLinkProps'] { + return function useScopedLinkProps( + options: any, + ref: React.ForwardedRef, + ) { + return useLinkProps(useBoundOptions(moduleId)(options), ref) + } as any +} + +export function bindRouteScopeLinkOptions( + moduleId: string, +): RouteScope['linkOptions'] { + return ((options: any) => + Array.isArray(options) + ? options.map((option) => bindRouteScopeOptions(moduleId, option)) + : bindRouteScopeOptions(moduleId, options)) as any +} + +export function bindRouteScopeUseNavigate( + moduleId: string, +): RouteScope['useNavigate'] { + return function useScopedNavigate(options?: any) { + const bind = useBoundOptions(moduleId) + const navigate = useNavigate(bind(options)) + return React.useCallback( + (next: any) => navigate(bind(next)), + [navigate, bind], + ) + } as any +} + +export function bindRouteScopeRedirect( + moduleId: string, +): RouteScope['redirect'] { + return createScopedRedirect(moduleId) +} + +export function bindRouteScopeUseMatchRoute( + moduleId: string, +): RouteScope['useMatchRoute'] { + return function useScopedMatchRoute() { + const bind = useBoundOptions(moduleId) + const matchRoute = useMatchRoute() + const routeId = React.useContext(matchContext) + return React.useCallback( + (options: any) => + matchRoute({ ...bind(options), _nearestRoute: routeId }), + [matchRoute, bind, routeId], + ) + } as any +} + +export function bindRouteScopeUseRouter( + moduleId: string, +): RouteScope['useRouter'] { + return function useScopedRouter(options?: { warn?: boolean }) { + return getScopedRouterView( + useRouter(options), + moduleId, + React.useContext(matchContext), + ) + } as any +} + +export function bindRouteScopeGetRouteApi( + moduleId: string, +): RouteScope['getRouteApi'] { + return bindRouteScopeIdApi(moduleId, getRouteApi) as any +} + +export function bindRouteScopeUseMatch( + moduleId: string, +): RouteScope['useMatch'] { + return bindRouteScopeIdApi(moduleId, useMatch, 'from') as any +} + +export function bindRouteScopeUseLoaderData( + moduleId: string, +): RouteScope['useLoaderData'] { + return bindRouteScopeIdApi(moduleId, useLoaderData, 'from') as any +} + +export function bindRouteScopeUseLoaderDeps( + moduleId: string, +): RouteScope['useLoaderDeps'] { + return bindRouteScopeIdApi(moduleId, useLoaderDeps, 'from') as any +} + +export function bindRouteScopeUseSearch( + moduleId: string, +): RouteScope['useSearch'] { + return bindRouteScopeIdApi(moduleId, useSearch, 'from') as any +} + +export function bindRouteScopeUseParams( + moduleId: string, +): RouteScope['useParams'] { + return bindRouteScopeIdApi(moduleId, useParams, 'from') as any +} + +export function bindRouteScopeUseRouteContext( + moduleId: string, +): RouteScope['useRouteContext'] { + return bindRouteScopeIdApi(moduleId, useRouteContext, 'from') as any +} + +export function bindRouteScopeNotFound( + moduleId: string, +): RouteScope['notFound'] { + return bindRouteScopeIdApi(moduleId, notFound, 'routeId') as any +} diff --git a/packages/react-router/src/router.ts b/packages/react-router/src/router.ts index de5e89a9fb..041c8ac642 100644 --- a/packages/react-router/src/router.ts +++ b/packages/react-router/src/router.ts @@ -14,7 +14,7 @@ import type { RouteComponent, } from './route' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface RouterOptionsExtensions { /** * The default `component` a route should use if no component is provided. diff --git a/packages/react-router/src/routerStores.ts b/packages/react-router/src/routerStores.ts index 3197f54681..853c1c21c4 100644 --- a/packages/react-router/src/routerStores.ts +++ b/packages/react-router/src/routerStores.ts @@ -7,7 +7,7 @@ import { isServer } from '@tanstack/router-core/isServer' import type { Readable } from '@tanstack/react-store' import type { GetStoreConfig } from '@tanstack/router-core' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface RouterReadableStore extends Readable {} } export const getStoreFactory: GetStoreConfig = (opts) => { diff --git a/packages/react-router/src/ssr/serializer.ts b/packages/react-router/src/ssr/serializer.ts index 9a1743c18a..b04f8e1270 100644 --- a/packages/react-router/src/ssr/serializer.ts +++ b/packages/react-router/src/ssr/serializer.ts @@ -1,6 +1,6 @@ import type * as React from 'react' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface SerializerExtensions { ReadableStream: React.JSX.Element } diff --git a/packages/react-router/src/useBlocker.tsx b/packages/react-router/src/useBlocker.tsx index 65636510c9..55e722c7d0 100644 --- a/packages/react-router/src/useBlocker.tsx +++ b/packages/react-router/src/useBlocker.tsx @@ -1,5 +1,6 @@ 'use client' +import { isServer } from '@tanstack/router-core/isServer' import * as React from 'react' import { useRouter } from './useRouter' import type { @@ -12,6 +13,8 @@ import type { AnyRouter, ParseRoute, RegisteredRouter, + RegisteredRouterOf, + RouteScopeMarker, } from '@tanstack/router-core' type ShouldBlockFnLocation< @@ -31,14 +34,21 @@ type AnyShouldBlockFnLocation = ShouldBlockFnLocation type MakeShouldBlockFnLocationUnion< TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute, -> = TRoute extends any +> = TRouter['routeTree'] extends RouteScopeMarker ? ShouldBlockFnLocation< - TRoute['id'], - TRoute['fullPath'], - TRoute['types']['allParams'], - TRoute['types']['fullSearchSchema'] + string, + string, + Record, + Record > - : never + : TRoute extends any + ? ShouldBlockFnLocation< + TRoute['id'], + TRoute['fullPath'], + TRoute['types']['allParams'], + TRoute['types']['fullSearchSchema'] + > + : never type BlockerResolver = | { @@ -130,6 +140,14 @@ function _resolveBlockerOpts( } } +/** The generated module hook observes navigation across the entire application. */ +export type UseBlockerFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TWithResolver extends boolean = false, +>( + opts: UseBlockerOpts, +) => TWithResolver extends true ? BlockerResolver : void + export function useBlocker< TRouter extends AnyRouter = RegisteredRouter, TWithResolver extends boolean = false, @@ -164,15 +182,22 @@ export function useBlocker( const router = useRouter() const { history } = router - const [resolver, setResolver] = React.useState({ + const idle: BlockerResolver = { status: 'idle', current: undefined, next: undefined, action: undefined, proceed: undefined, reset: undefined, - }) + } + if (isServer ?? router.isServer) { + return idle + } + // eslint-disable-next-line react-hooks/rules-of-hooks -- the server condition is static + const [resolver, setResolver] = React.useState(idle) + + // eslint-disable-next-line react-hooks/rules-of-hooks -- the server condition is static React.useEffect(() => { const blockerFnComposed = async (blockerFnArgs: BlockerFnArgs) => { function getLocation( diff --git a/packages/react-router/src/useLoaderData.tsx b/packages/react-router/src/useLoaderData.tsx index 755a39616e..f9781b260c 100644 --- a/packages/react-router/src/useLoaderData.tsx +++ b/packages/react-router/src/useLoaderData.tsx @@ -5,7 +5,9 @@ import type { } from './structuralSharing' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseLoaderData, StrictOrFrom, UseLoaderDataResult, @@ -39,8 +41,8 @@ export type UseLoaderDataOptions< > & StructuralSharingOption -export type UseLoaderDataRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseLoaderDataRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TStructuralSharing extends boolean = boolean, >( @@ -54,6 +56,26 @@ export type UseLoaderDataRoute = < StructuralSharingOption, ) => UseLoaderDataResult +/** + * The signature of `useLoaderData`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLoaderData` of this type. + */ +export type UseLoaderDataFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts: UseLoaderDataOptions< + TRouter, + TFrom, + TStrict, + TSelected, + TStructuralSharing + >, +) => UseLoaderDataResult + /** * Read and select the current route's loader data with type‑safety. * diff --git a/packages/react-router/src/useLoaderDeps.tsx b/packages/react-router/src/useLoaderDeps.tsx index 21e7267d4e..014c91efa0 100644 --- a/packages/react-router/src/useLoaderDeps.tsx +++ b/packages/react-router/src/useLoaderDeps.tsx @@ -5,7 +5,9 @@ import type { } from './structuralSharing' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseLoaderDeps, StrictOrFrom, UseLoaderDepsResult, @@ -31,8 +33,8 @@ export type UseLoaderDepsOptions< UseLoaderDepsBaseOptions & StructuralSharingOption -export type UseLoaderDepsRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseLoaderDepsRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TStructuralSharing extends boolean = boolean, >( @@ -40,6 +42,19 @@ export type UseLoaderDepsRoute = < StructuralSharingOption, ) => UseLoaderDepsResult +/** + * The signature of `useLoaderDeps`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLoaderDeps` of this type. + */ +export type UseLoaderDepsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts: UseLoaderDepsOptions, +) => UseLoaderDepsResult + /** * Read and select the current route's loader dependencies object. * diff --git a/packages/react-router/src/useLocation.tsx b/packages/react-router/src/useLocation.tsx index 5fa39fa92e..155dd88ea6 100644 --- a/packages/react-router/src/useLocation.tsx +++ b/packages/react-router/src/useLocation.tsx @@ -10,7 +10,9 @@ import type { } from './structuralSharing' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, RouterState, } from '@tanstack/router-core' @@ -31,6 +33,19 @@ export type UseLocationResult< ? RouterState['location'] : TSelected +/** + * The signature of `useLocation`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLocation` of this type. + */ +export type UseLocationFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts?: UseLocationBaseOptions & + StructuralSharingOption, +) => UseLocationResult + /** * Read the current location from the router state with optional selection. * Useful for subscribing to just the pieces of location you care about. diff --git a/packages/react-router/src/useMatch.tsx b/packages/react-router/src/useMatch.tsx index 95a4aaa286..a4471b38bb 100644 --- a/packages/react-router/src/useMatch.tsx +++ b/packages/react-router/src/useMatch.tsx @@ -3,6 +3,7 @@ import * as React from 'react' import { useSelector } from '@tanstack/react-store' import { invariant, replaceEqualDeep } from '@tanstack/router-core' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import { isServer } from '@tanstack/router-core/isServer' import { dummyMatchContext, matchContext } from './matchContext' import { useRouter } from './useRouter' @@ -14,7 +15,10 @@ import type { AnyRouter, MakeRouteMatch, MakeRouteMatchUnion, + Register, RegisteredRouter, + RegisteredRouterOf, + RouteScopeMarker, StrictOrFrom, ThrowConstraint, ThrowOrOptional, @@ -70,13 +74,17 @@ export interface UseMatchBaseOptions< TStructuralSharing extends boolean, > { select?: ( - match: MakeRouteMatch, + match: TRouter['routeTree'] extends RouteScopeMarker + ? TStrict extends true + ? MakeRouteMatch + : MakeRouteMatchUnion + : MakeRouteMatch, ) => ValidateSelected shouldThrow?: TThrow } -export type UseMatchRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseMatchRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TStructuralSharing extends boolean = boolean, TThrow extends boolean = true, @@ -121,6 +129,28 @@ export type UseMatchResult< : MakeRouteMatchUnion : TSelected +/** + * The signature of `useMatch`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useMatch` of this type. + */ +export type UseMatchFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts: UseMatchOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected, + TStructuralSharing + >, +) => ThrowOrOptional, TThrow> + /** * Read and select the nearest or targeted route match. * @link https://tanstack.com/router/latest/docs/framework/react/api/router/useMatchHook @@ -143,11 +173,20 @@ export function useMatch< >, ): ThrowOrOptional, TThrow> { const router = useRouter() - const nearestRouteId = React.useContext( - opts.from ? dummyMatchContext : matchContext, + // `from` that is not a route of the router can be the module-local id of a + // module installed several times: it resolves through the nearest match. + const moduleFrom = + routeModules && opts.from && !router.routesById[opts.from] + ? opts.from + : undefined + const nearestRouteId: string | undefined = React.useContext( + opts.from && !moduleFrom ? dummyMatchContext : matchContext, ) - const routeId = opts.from ?? nearestRouteId + const routeId = + routeModules && moduleFrom + ? routeModules.resolveRouteId(router, moduleFrom, nearestRouteId) + : (opts.from ?? nearestRouteId) const matchStore = router.stores.getMatchStore(routeId!) if (isServer ?? router.isServer) { diff --git a/packages/react-router/src/useNavigate.tsx b/packages/react-router/src/useNavigate.tsx index ce95e5b4c1..ebd41ac5ed 100644 --- a/packages/react-router/src/useNavigate.tsx +++ b/packages/react-router/src/useNavigate.tsx @@ -1,16 +1,35 @@ 'use client' import * as React from 'react' +import { isServer } from '@tanstack/router-core/isServer' +import { routeModules } from '@tanstack/router-core/_internal/route-module' +import { matchContext } from './matchContext' import { useLayoutEffect } from './utils' import { useRouter } from './useRouter' import type { AnyRouter, + CompatibleRouteScope, FromPathOption, NavigateOptions, + Register, RegisteredRouter, + RegisteredRouterOf, + RouteModuleScope, UseNavigateResult, } from '@tanstack/router-core' +/** + * The signature of `useNavigate`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useNavigate` of this type. + */ +export type UseNavigateFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TDefaultFrom extends string = string, +>(_defaultOpts?: { + from?: FromPathOption + _module?: RouteModuleScope> +}) => UseNavigateResult + /** * Imperative navigation hook. * @@ -30,20 +49,52 @@ export function useNavigate< TDefaultFrom extends string = string, >(_defaultOpts?: { from?: FromPathOption -}): UseNavigateResult { +}): UseNavigateResult { const router = useRouter() + // Only the route-module translation reads the nearest route. Route modules + // install it when the route tree is created, before the first render, so + // the condition is the same in every render of an application. + const routeId = routeModules + ? // eslint-disable-next-line react-hooks/rules-of-hooks -- see above + React.useContext(matchContext) + : undefined return React.useCallback( (options: NavigateOptions) => { - return router.navigate({ - ...options, - from: options.from ?? _defaultOpts?.from, - }) + return router.navigate( + routeModules + ? { + // Route-module APIs also pass their internal `_module` and + // `_fromRoute` scope, constant for a route or scoped API. + ..._defaultOpts, + _nearestRoute: routeId, + ...options, + from: options.from ?? _defaultOpts?.from, + } + : { ...options, from: options.from ?? _defaultOpts?.from }, + ) }, - [_defaultOpts?.from, router], - ) as UseNavigateResult + // eslint-disable-next-line react-hooks/exhaustive-deps -- the scope of the defaults is constant + routeModules + ? [_defaultOpts?.from, routeId, router] + : [_defaultOpts?.from, router], + ) as UseNavigateResult } +/** + * The signature of `Navigate`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `Navigate` of this type. + */ +export type NavigateComponentFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string = string, + const TTo extends string | undefined = undefined, + const TMaskFrom extends string = TFrom, + const TMaskTo extends string = '', +>( + props: NavigateOptions, +) => null + /** * Component that triggers a navigation when rendered. Navigation executes * in an effect after mount/update. @@ -61,8 +112,13 @@ export function Navigate< const TMaskTo extends string = '', >(props: NavigateOptions): null { const router = useRouter() + if (isServer ?? router.isServer) { + return null + } + // eslint-disable-next-line react-hooks/rules-of-hooks -- the server condition is static const navigate = useNavigate() + // eslint-disable-next-line react-hooks/rules-of-hooks -- the server condition is static const previousPropsRef = React.useRef | null>(null) + // eslint-disable-next-line react-hooks/rules-of-hooks -- the server condition is static useLayoutEffect(() => { if (previousPropsRef.current !== props) { navigate(props) diff --git a/packages/react-router/src/useParams.tsx b/packages/react-router/src/useParams.tsx index 44a6e47f9d..6ea1c8711b 100644 --- a/packages/react-router/src/useParams.tsx +++ b/packages/react-router/src/useParams.tsx @@ -5,7 +5,9 @@ import type { } from './structuralSharing' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseParams, StrictOrFrom, ThrowConstraint, @@ -45,8 +47,8 @@ export type UseParamsOptions< > & StructuralSharingOption -export type UseParamsRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseParamsRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TStructuralSharing extends boolean = boolean, TThrow extends boolean = true, @@ -62,6 +64,31 @@ export type UseParamsRoute = < StructuralSharingOption, ) => ThrowOrOptional, TThrow> +/** + * The signature of `useParams`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useParams` of this type. + */ +export type UseParamsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts: UseParamsOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected, + TStructuralSharing + >, +) => ThrowOrOptional< + UseParamsResult, + TThrow +> + /** * Access the current route's path parameters with type-safety. * diff --git a/packages/react-router/src/useRouteContext.ts b/packages/react-router/src/useRouteContext.ts index 0aed8720e6..3e5df91fc6 100644 --- a/packages/react-router/src/useRouteContext.ts +++ b/packages/react-router/src/useRouteContext.ts @@ -1,19 +1,34 @@ import { useMatch } from './useMatch' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, UseRouteContextBaseOptions, UseRouteContextOptions, UseRouteContextResult, } from '@tanstack/router-core' -export type UseRouteContextRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseRouteContextRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, >( opts?: UseRouteContextBaseOptions, ) => UseRouteContextResult +/** + * The signature of `useRouteContext`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouteContext` of this type. + */ +export type UseRouteContextFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TSelected = unknown, +>( + opts: UseRouteContextOptions, +) => UseRouteContextResult + export function useRouteContext< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/react-router/src/useRouter.tsx b/packages/react-router/src/useRouter.tsx index 6708274c11..06785a1a43 100644 --- a/packages/react-router/src/useRouter.tsx +++ b/packages/react-router/src/useRouter.tsx @@ -2,7 +2,22 @@ import * as React from 'react' import { routerContext } from './routerContext' -import type { AnyRouter, RegisteredRouter } from '@tanstack/router-core' +import type { + AnyRouter, + Register, + RegisteredRouter, + RegisteredRouterOf, +} from '@tanstack/router-core' + +/** + * The signature of `useRouter`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouter` of this type. + */ +export type UseRouterFn = < + TRouter extends AnyRouter = RegisteredRouterOf, +>(opts?: { + warn?: boolean +}) => TRouter /** * Access the current TanStack Router instance from React context. diff --git a/packages/react-router/src/useRouterState.tsx b/packages/react-router/src/useRouterState.tsx index fa17ee9f59..afdd858a59 100644 --- a/packages/react-router/src/useRouterState.tsx +++ b/packages/react-router/src/useRouterState.tsx @@ -6,7 +6,9 @@ import { useRouter } from './useRouter' import { useStructuralSharing } from './useMatch' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, RouterState, } from '@tanstack/router-core' import type { @@ -30,6 +32,18 @@ export type UseRouterStateResult< TSelected, > = unknown extends TSelected ? RouterState : TSelected +/** + * The signature of `useRouterState`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouterState` of this type. + */ +export type UseRouterStateFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts?: UseRouterStateOptions, +) => UseRouterStateResult + /** * Subscribe to the router's state store with optional selection and * structural sharing for render optimization. @@ -59,7 +73,7 @@ export function useRouterState< // The expression must stay inlined in the `if` so bundlers fold the // browser-build constant `isServer = false` and drop this server block. if (isServer ?? router.isServer) { - const state = router.stores.__store.get() as RouterState< + const state = router.stores.__store.get() as unknown as RouterState< TRouter['routeTree'] > return (opts?.select ? opts.select(state) : state) as UseRouterStateResult< diff --git a/packages/react-router/src/useSearch.tsx b/packages/react-router/src/useSearch.tsx index 3979967d76..7a3398e999 100644 --- a/packages/react-router/src/useSearch.tsx +++ b/packages/react-router/src/useSearch.tsx @@ -5,7 +5,9 @@ import type { } from './structuralSharing' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseSearch, StrictOrFrom, ThrowConstraint, @@ -45,8 +47,8 @@ export type UseSearchOptions< > & StructuralSharingOption -export type UseSearchRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseSearchRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TStructuralSharing extends boolean = boolean, TThrow extends boolean = true, @@ -62,6 +64,31 @@ export type UseSearchRoute = < StructuralSharingOption, ) => ThrowOrOptional, TThrow> +/** + * The signature of `useSearch`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useSearch` of this type. + */ +export type UseSearchFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, + TStructuralSharing extends boolean = boolean, +>( + opts: UseSearchOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected, + TStructuralSharing + >, +) => ThrowOrOptional< + UseSearchResult, + TThrow +> + /** * Read and select the current route's search parameters with type-safety. * diff --git a/packages/react-router/tests/blocker-server.test.tsx b/packages/react-router/tests/blocker-server.test.tsx new file mode 100644 index 0000000000..752e638fbf --- /dev/null +++ b/packages/react-router/tests/blocker-server.test.tsx @@ -0,0 +1,33 @@ +import * as React from 'react' +import { afterEach, expect, test, vi } from 'vitest' +import { cleanup, render, screen } from '@testing-library/react' +import { + RouterContextProvider, + createMemoryHistory, + createRootRoute, + createRouter, + useBlocker, +} from '../src' + +afterEach(cleanup) + +test('a server router does not register navigation blockers', async () => { + const history = createMemoryHistory({ initialEntries: ['/'] }) + const block = vi.spyOn(history, 'block') + const router = createRouter({ + routeTree: createRootRoute(), + history, + isServer: true, + }) + function Observer() { + const state = useBlocker({ shouldBlockFn: () => true, withResolver: true }) + return {state.status} + } + render( + + + , + ) + await screen.findByText('idle') + expect(block).not.toHaveBeenCalled() +}) diff --git a/packages/react-router/tests/navigate-options-parity.test.tsx b/packages/react-router/tests/navigate-options-parity.test.tsx new file mode 100644 index 0000000000..7217d0e07e --- /dev/null +++ b/packages/react-router/tests/navigate-options-parity.test.tsx @@ -0,0 +1,96 @@ +import * as React from 'react' +import { renderToString } from 'react-dom/server' +import { afterEach, expect, test, vi } from 'vitest' +import { + cleanup, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/react' +import { + Navigate, + Outlet, + RouterContextProvider, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +afterEach(cleanup) + +test('Navigate leaves the request location unchanged during server rendering', () => { + const root = createRootRoute() + const next = createRoute({ getParentRoute: () => root, path: '/next' }) + const router = createRouter({ + routeTree: root.addChildren([next]), + history: createMemoryHistory({ initialEntries: ['/'] }), + isServer: true, + }) + const navigate = vi.spyOn(router, 'navigate') + const html = renderToString( + + + Request content + , + ) + expect(html).toContain('Request content') + expect(navigate).not.toHaveBeenCalled() + expect(router.state.location.href).toBe('/') +}) + +test('Navigate responds to option changes while mounted', async () => { + function TestRoot() { + const [id, setId] = React.useState('one') + const [q, setQ] = React.useState('first') + const [replace, setReplace] = React.useState(true) + return ( + <> + + + + + + ) + } + const root = createRootRoute({ component: TestRoot }) + const item = createRoute({ getParentRoute: () => root, path: '/items/$id' }) + const history = createMemoryHistory({ initialEntries: ['/'] }) + const router = createRouter({ routeTree: root.addChildren([item]), history }) + render() + await waitFor(() => + expect(router.state.location.href).toBe('/items/one?q=first'), + ) + const initialLength = history.length + await fireEvent.click(screen.getByText('Change params')) + await waitFor(() => + expect(router.state.location.href).toBe('/items/two?q=first'), + ) + expect(history.length).toBe(initialLength + 1) + await fireEvent.click(screen.getByText('Change search')) + await waitFor(() => + expect(router.state.location.href).toBe('/items/two?q=second'), + ) + expect(history.length).toBe(initialLength + 1) +}) diff --git a/packages/react-router/tests/registered-router-cycle/app.tsx b/packages/react-router/tests/registered-router-cycle/app.tsx new file mode 100644 index 0000000000..0d0199c346 --- /dev/null +++ b/packages/react-router/tests/registered-router-cycle/app.tsx @@ -0,0 +1,95 @@ +// A code-based app that registers its router in the same program and uses +// route-bound APIs inside its own routes. Resolving any of them must not need +// the registered router while the routes are still being inferred. +import * as React from 'react' +import { + Link, + Outlet, + createRootRoute, + createRoute, + createRouteMask, + createRouter, + useNavigate, +} from '@tanstack/react-router' + +const rootRoute = createRootRoute({ component: Root }) + +const itemRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/items/$itemId', + // Contextual types of lifecycle options name the registered router. + beforeLoad: ({ buildLocation }) => { + void buildLocation + }, + loader: ({ params, navigate }) => { + if (params.itemId === 'old') { + throw itemRoute.redirect({ to: '.', params: { itemId: 'new' } }) + } + void navigate + return { name: `item ${params.itemId}` } + }, + component: Item, +}) + +const publicRoute = createRoute({ + getParentRoute: () => rootRoute, + path: '/public/$name', + component: PublicItem, +}) + +const routeTree = rootRoute.addChildren([itemRoute, publicRoute]) + +const mask = createRouteMask({ + routeTree, + from: '/items/$itemId', + to: '/public/$name', + params: (previous) => ({ name: previous.itemId }), +}) + +export const router = createRouter({ routeTree, routeMasks: [mask] }) + +declare module '@tanstack/react-router' { + interface Register { + router: typeof router + } +} + +function Root() { + const navigate = useNavigate() + return ( + <> + + Item + + + + + ) +} + +function itemLink(index: number) { + return ( + + {index} + + ) +} + +function Item() { + const data = itemRoute.useLoaderData() + const params = itemRoute.useParams() + const navigate = itemRoute.useNavigate() + return ( +
+

{data.name}

+

{params.itemId}

+ + {[1, 2].map(itemLink)} +
+ ) +} + +function PublicItem() { + const { name } = publicRoute.useParams() + return {name} +} diff --git a/packages/react-router/tests/registered-router-cycle/tsconfig.json b/packages/react-router/tests/registered-router-cycle/tsconfig.json new file mode 100644 index 0000000000..182dbe2d9a --- /dev/null +++ b/packages/react-router/tests/registered-router-cycle/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { "noEmit": true }, + "include": ["app.tsx"], + "exclude": [] +} diff --git a/packages/react-router/tests/routeApi.test-d.tsx b/packages/react-router/tests/routeApi.test-d.tsx index d0553a9e0b..55ecb7c233 100644 --- a/packages/react-router/tests/routeApi.test-d.tsx +++ b/packages/react-router/tests/routeApi.test-d.tsx @@ -122,7 +122,7 @@ describe('getRouteApi', () => { test('Link', () => { const Link = invoiceRouteApi.Link expectTypeOf(Link).toEqualTypeOf< - LinkComponentRoute<'/invoices/$invoiceId'> + LinkComponentRoute<'/invoices/$invoiceId', { router: DefaultRouter }> >() }) }) diff --git a/packages/react-router/tsconfig.json b/packages/react-router/tsconfig.json index f406bf1c09..47c29de602 100644 --- a/packages/react-router/tsconfig.json +++ b/packages/react-router/tsconfig.json @@ -5,5 +5,6 @@ "jsxImportSource": "react", "types": ["node"] }, - "include": ["src", "tests", "vite.config.ts", "eslint.config.ts"] + "include": ["src", "tests", "vite.config.ts", "eslint.config.ts"], + "exclude": ["tests/registered-router-cycle"] } diff --git a/packages/react-router/vite.config.ts b/packages/react-router/vite.config.ts index 798d9b74e4..10453fca6a 100644 --- a/packages/react-router/vite.config.ts +++ b/packages/react-router/vite.config.ts @@ -28,6 +28,7 @@ export default mergeConfig( tsconfigPath: './tsconfig.build.json', entry: [ './src/index.tsx', + './src/route-module-internal.ts', './src/index.rsc.ts', './src/index.dev.tsx', './src/ssr/client.ts', diff --git a/packages/react-start-rsc/eslint.config.js b/packages/react-start-rsc/eslint.config.js index daf1baa88a..9ee915f52a 100644 --- a/packages/react-start-rsc/eslint.config.js +++ b/packages/react-start-rsc/eslint.config.js @@ -2,7 +2,7 @@ import pluginReact from '@eslint-react/eslint-plugin' import pluginReactHooks from 'eslint-plugin-react-hooks' -import rootConfig from '../../eslint.config.js' +import rootConfig, { routerCoreAugmentation } from '../../eslint.config.js' export default [ ...rootConfig, @@ -46,6 +46,7 @@ export default [ message: 'Dynamically import a dedicated @tanstack/start-server-core subpath instead of the root barrel.', }, + routerCoreAugmentation, ], }, }, diff --git a/packages/react-start-rsc/package.json b/packages/react-start-rsc/package.json index 346ce62750..944ac8e15e 100644 --- a/packages/react-start-rsc/package.json +++ b/packages/react-start-rsc/package.json @@ -94,7 +94,7 @@ "src" ], "engines": { - "node": ">=22.12.0" + "node": ">=22.22.0" }, "dependencies": { "@tanstack/react-router": "workspace:*", diff --git a/packages/react-start-rsc/src/ServerComponentTypes.ts b/packages/react-start-rsc/src/ServerComponentTypes.ts index 5e1fa32a52..96b24de444 100644 --- a/packages/react-start-rsc/src/ServerComponentTypes.ts +++ b/packages/react-start-rsc/src/ServerComponentTypes.ts @@ -203,7 +203,7 @@ export interface RenderableServerComponentAttributes { [RENDERABLE_RSC]: true } -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface SerializableExtensions { CompositeComponent: AnyCompositeComponent RenderableServerComponent: AnyRenderableServerComponent diff --git a/packages/react-start/package.json b/packages/react-start/package.json index 6d51a4c6d0..7c839b6ced 100644 --- a/packages/react-start/package.json +++ b/packages/react-start/package.json @@ -26,6 +26,7 @@ "scripts": { "clean": "rimraf ./dist && rimraf ./coverage", "test": "pnpm test:build", + "test:unit": "vitest", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build && vite build -c vite.config.server-entry.ts" }, @@ -146,7 +147,13 @@ "default": "./dist/esm/client-only.js" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./_internal/route-module": { + "import": { + "types": "./dist/esm/route-module-internal.d.ts", + "default": "./dist/esm/route-module-internal.js" + } + } }, "sideEffects": false, "files": [ @@ -157,7 +164,7 @@ "!skills/_artifacts" ], "engines": { - "node": ">=22.12.0" + "node": ">=22.22.0" }, "dependencies": { "@tanstack/react-router": "workspace:*", @@ -201,6 +208,19 @@ "@types/react-dom": "catalog:", "@arethetypeswrong/cli": "catalog:", "publint": "catalog:", - "rimraf": "catalog:" + "rimraf": "catalog:", + "@tanstack/router-generator": "workspace:*", + "@vitejs/plugin-react": "catalog:", + "vite": "*" + }, + "nx": { + "targets": { + "test:unit": { + "dependsOn": [ + "^build", + "build" + ] + } + } } } diff --git a/packages/react-start/src/index.ts b/packages/react-start/src/index.ts index 6ea839a967..ce402094dd 100644 --- a/packages/react-start/src/index.ts +++ b/packages/react-start/src/index.ts @@ -1,5 +1,6 @@ export { useServerFn } from './useServerFn' export * from '@tanstack/start-client-core' +export type { StartModuleRequirements } from '@tanstack/start-client-core' // Explicit re-exports shadow `export *` above so these public-API names are // registered on the namespace at link time (via Vite SSR's `defineExport` // at fileStartIndex), surviving the cold-start SSR cycle through user diff --git a/packages/react-start/src/route-module-internal.ts b/packages/react-start/src/route-module-internal.ts new file mode 100644 index 0000000000..8642a07276 --- /dev/null +++ b/packages/react-start/src/route-module-internal.ts @@ -0,0 +1 @@ +export { createStartModule } from '@tanstack/start-client-core/_internal/route-module' diff --git a/packages/react-start/tests/route-module-build.test.ts b/packages/react-start/tests/route-module-build.test.ts new file mode 100644 index 0000000000..e37ce40c21 --- /dev/null +++ b/packages/react-start/tests/route-module-build.test.ts @@ -0,0 +1,13 @@ +// @vitest-environment node +import { fileURLToPath } from 'node:url' +import { defineRouteModuleBuildTests } from '../../start-plugin-core/tests/route-module-build' + +// Builds a Start application that mounts a route module with this package's +// public Vite and Rsbuild plugins, then runs its server and client output. +defineRouteModuleBuildTests({ + framework: 'react', + frameworkPackage: 'react', + frameworkPlugins: ['@vitejs/plugin-react'], + pluginOptions: '', + packageRoot: fileURLToPath(new URL('..', import.meta.url)), +}) diff --git a/packages/react-start/vite.config.ts b/packages/react-start/vite.config.ts index 652e4ef842..e6dac9bf27 100644 --- a/packages/react-start/vite.config.ts +++ b/packages/react-start/vite.config.ts @@ -26,6 +26,7 @@ export default mergeConfig( exclude: ['./src/default-entry'], entry: [ './src/index.ts', + './src/route-module-internal.ts', './src/client.tsx', './src/hydration.ts', './src/client-rpc.ts', diff --git a/packages/router-cli/package.json b/packages/router-cli/package.json index 51a729d79b..91b9e68d44 100644 --- a/packages/router-cli/package.json +++ b/packages/router-cli/package.json @@ -63,7 +63,7 @@ "bin/**" ], "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=22.22.0" }, "dependencies": { "@tanstack/router-generator": "workspace:*", diff --git a/packages/router-core/package.json b/packages/router-core/package.json index ed2b794278..36644cdafb 100644 --- a/packages/router-core/package.json +++ b/packages/router-core/package.json @@ -48,6 +48,16 @@ "default": "./dist/cjs/index.cjs" } }, + "./extensions": { + "import": { + "types": "./dist/esm/extensions.d.ts", + "default": "./dist/esm/extensions.js" + }, + "require": { + "types": "./dist/cjs/extensions.d.cts", + "default": "./dist/cjs/extensions.cjs" + } + }, "./ssr/server": { "import": { "types": "./dist/esm/ssr/server.d.ts", @@ -168,7 +178,17 @@ "default": "./dist/cjs/scroll-restoration-script/server.cjs" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./_internal/route-module": { + "import": { + "types": "./dist/esm/route-module-internal.d.ts", + "default": "./dist/esm/route-module-internal.js" + }, + "require": { + "types": "./dist/cjs/route-module-internal.d.cts", + "default": "./dist/cjs/route-module-internal.cjs" + } + } }, "sideEffects": false, "files": [ diff --git a/packages/router-core/src/Matches.ts b/packages/router-core/src/Matches.ts index 41fd4018b5..185dbdeb51 100644 --- a/packages/router-core/src/Matches.ts +++ b/packages/router-core/src/Matches.ts @@ -7,7 +7,9 @@ import type { ParseRoute, RouteById, RouteIds, + RoutesById, } from './routeInfo' +import type { RouteScopeMarker } from './route-module' import type { AnyRouter, RegisteredRouter, SSROption } from './router' import type { Constrain } from './utils' @@ -126,6 +128,8 @@ export interface RouteMatch< > extends RouteMatchExtensions { id: string routeId: TRouteId + /** The authored route ID for module matches, independent of installation. */ + localRouteId?: string fullPath: TFullPath index: number pathname: string @@ -186,29 +190,76 @@ export type MakePreValidationErrorHandlingRouteMatchUnion< > = TRoute extends any ? PreValidationErrorHandlingRouteMatch< TRoute['id'], - TRoute['fullPath'], + MatchFullPath, TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'] > : never +type LocalRouteId = TRouteId extends `/${string}` + ? never + : TRouteId extends `${infer TNamespace}:${infer TPath}` + ? TNamespace extends `${infer TModule}#${string}` + ? `${TModule}:${TPath}` + : TRouteId + : never + +type NonModuleRouteId = TRouteId extends `/${string}` + ? TRouteId + : TRouteId extends `${string}:${string}` + ? never + : TRouteId + +type ModuleMatchIdentity = string extends TRouteId + ? {} + : [NonModuleRouteId] extends [never] + ? { localRouteId: LocalRouteId } + : {} + +type MatchFullPath = [LocalRouteId] extends [ + never, +] + ? TFullPath + : string + +type InstalledRouteId = TRouteId extends `/${string}` + ? TRouteId + : TRouteId extends `${infer TModule}:${infer TPath}` + ? TModule extends `${string}#${string}` + ? TRouteId + : TRouteId | `${TModule}#${string}:${TPath}` + : TRouteId + +type MatchRouteId = + TRouteTree extends RouteScopeMarker + ? TModuleId extends `${infer TModule}#${string}` + ? TRouteId extends `${TModule}:${infer TPath}` + ? `${TModuleId}:${TPath}` + : InstalledRouteId + : InstalledRouteId + : TRouteId + export type MakeRouteMatchFromRoute = RouteMatch< - TRoute['types']['id'], - TRoute['types']['fullPath'], + InstalledRouteId, + MatchFullPath, TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps'] -> +> & + ModuleMatchIdentity export type MakeRouteMatch< TRouteTree extends AnyRoute = RegisteredRouter['routeTree'], TRouteId = RouteIds, TStrict extends boolean = true, > = RouteMatch< - TRouteId, - RouteById['types']['fullPath'], + MatchRouteId, + MatchFullPath< + RouteById['id'], + RouteById['types']['fullPath'] + >, TStrict extends false ? AllParams : RouteById['types']['allParams'], @@ -222,25 +273,51 @@ export type MakeRouteMatch< ? AllContext : RouteById['types']['allContext'], RouteById['types']['loaderDeps'] -> +> & + ModuleMatchIdentity['id']> export type AnyRouteMatch = RouteMatch -export type MakeRouteMatchUnion< +/** A full-chain match whose route-specific contract is unknown to a scope. */ +export type ForeignRouteMatch = RouteMatch< + string, + string, + unknown, + unknown, + unknown, + unknown, + unknown +> + +type MatchRoutes = + TRouteTree extends RouteScopeMarker + ? ParseRoute + : Extract[keyof RoutesById], AnyRoute> + +/** The known routes only, used by generated scope membership guards. */ +export type KnownRouteMatchUnion< TRouter extends AnyRouter = RegisteredRouter, - TRoute extends AnyRoute = ParseRoute, + TRoute extends AnyRoute = MatchRoutes, > = TRoute extends any ? RouteMatch< - TRoute['id'], - TRoute['fullPath'], + MatchRouteId, + MatchFullPath, TRoute['types']['allParams'], TRoute['types']['fullSearchSchema'], TRoute['types']['loaderData'], TRoute['types']['allContext'], TRoute['types']['loaderDeps'] - > + > & + ModuleMatchIdentity : never +export type MakeRouteMatchUnion< + TRouter extends AnyRouter = RegisteredRouter, + TRoute extends AnyRoute = MatchRoutes, +> = + | KnownRouteMatchUnion + | (TRouter['routeTree'] extends RouteScopeMarker ? ForeignRouteMatch : never) + /** * The `MatchRouteOptions` type is used to describe the options that can be used when matching a route. * diff --git a/packages/router-core/src/RouterProvider.ts b/packages/router-core/src/RouterProvider.ts index 52aeaffabb..d9af27c92a 100644 --- a/packages/router-core/src/RouterProvider.ts +++ b/packages/router-core/src/RouterProvider.ts @@ -1,7 +1,8 @@ import type { NavigateOptions, ToOptions } from './link' import type { ParsedLocation } from './location' import type { RoutePaths } from './routeInfo' -import type { RegisteredRouter, ViewTransitionOptions } from './router' +import type { AnyRouter, Register, ViewTransitionOptions } from './router' +import type { RegisteredRouterOf } from './route-module' export interface MatchLocation { to?: string | number | null @@ -22,9 +23,11 @@ export interface CommitLocationOptions { ignoreBlocker?: boolean } -export type NavigateFn = < - TRouter extends RegisteredRouter, - TTo extends string | undefined, +export type NavigateFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + // A default equal to the constraint keeps the inference of a destination-less + // call unchanged while allowing the router type to have a default. + TTo extends string | undefined = string | undefined, TFrom extends RoutePaths | string = string, TMaskFrom extends RoutePaths | string = TFrom, TMaskTo extends string = '', @@ -32,9 +35,11 @@ export type NavigateFn = < opts: NavigateOptions, ) => Promise -export type BuildLocationFn = < - TRouter extends RegisteredRouter, - TTo extends string | undefined, +export type BuildLocationFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + // A default equal to the constraint keeps the inference of a destination-less + // call unchanged while allowing the router type to have a default. + TTo extends string | undefined = string | undefined, TFrom extends RoutePaths | string = string, TMaskFrom extends RoutePaths | string = TFrom, TMaskTo extends string = '', diff --git a/packages/router-core/src/extensions.ts b/packages/router-core/src/extensions.ts new file mode 100644 index 0000000000..fb8cbc0896 --- /dev/null +++ b/packages/router-core/src/extensions.ts @@ -0,0 +1,32 @@ +// The interfaces that framework packages augment: +// +// declare module '@tanstack/router-core/extensions' { +// interface UpdatableRouteOptionsExtensions { component?: RouteComponent } +// } +// +// Augment this entry, never `@tanstack/router-core` itself. An augmentation +// gives its module a name that TypeScript prefers when it writes types into +// declaration files. Augmenting the main entry would make a route module's +// `.d.ts` say `import("@tanstack/router-core").Route` instead of +// `import("@tanstack/react-router").RouteCore`, although the module only +// depends on `@tanstack/react-router`. Under pnpm the module's consumers then +// cannot resolve that import, and with `skipLibCheck` the type silently +// becomes `any`. +export type { LazyRoute } from './fileRoute' +export type { RouteMatchExtensions } from './Matches' +export type { + BeforeLoadContextOptions, + ErrorBoundaryTypes, + FilebaseRouteOptionsInterface, + LoaderFnContext, + RootRouteOptionsExtensions, + RouteExtensions, + RouteTypes, + UpdatableRouteOptionsExtensions, +} from './route' +export type { RouterOptionsExtensions } from './router' +export type { RouterReadableStore, RouterStores } from './stores' +export type { + SerializableExtensions, + SerializerExtensions, +} from './ssr/serializer/transformer' diff --git a/packages/router-core/src/index.ts b/packages/router-core/src/index.ts index 9206ef60dd..1c33c3050e 100644 --- a/packages/router-core/src/index.ts +++ b/packages/router-core/src/index.ts @@ -1,4 +1,24 @@ export * from './global' +// Exported through `./extensions` so that loading router-core loads that entry +// too: TypeScript does not load a module just because something augments it, +// and it ignores augmentations of modules it has not loaded. +export type { + BeforeLoadContextOptions, + ErrorBoundaryTypes, + FilebaseRouteOptionsInterface, + LazyRoute, + LoaderFnContext, + RootRouteOptionsExtensions, + RouteExtensions, + RouteMatchExtensions, + RouteTypes, + RouterOptionsExtensions, + RouterReadableStore, + RouterStores, + SerializableExtensions, + SerializerExtensions, + UpdatableRouteOptionsExtensions, +} from './extensions' export { TSR_DEFERRED_PROMISE, defer } from './defer' export type { DeferredPromiseState, DeferredPromise } from './defer' @@ -62,7 +82,6 @@ export type { FileRouteTypes, FileRoutesByPath, CreateFileRoute, - LazyRoute, LazyRouteOptions, CreateLazyFileRoute, } from './fileRoute' @@ -121,8 +140,9 @@ export type { IsMatchParse, IsMatch, RouteMatch, - RouteMatchExtensions, MakeRouteMatchUnion, + KnownRouteMatchUnion, + ForeignRouteMatch, MakeRouteMatch, AnyRouteMatch, MakeRouteMatchFromRoute, @@ -171,7 +191,6 @@ export type { ErrorRouteProps, ErrorComponentProps, DefaultErrorBoundaryTypes, - ErrorBoundaryTypes, NotFoundRouteProps, ResolveParams, ParseParamsFn, @@ -198,7 +217,6 @@ export type { ResolveAllParamsFromParent, AnyRoute, Route, - RouteTypes, FullSearchSchemaOption, RemountDepsOptions, MakeRemountDepsOptionsUnion, @@ -211,19 +229,14 @@ export type { LoaderStaleReloadMode, RouteLoaderFn, RouteLoaderEntry, - LoaderFnContext, RouteContextFn, ContextOptions, RouteContextOptions, SsrContextOptions, - BeforeLoadContextOptions, RootRouteOptions, - RootRouteOptionsExtensions, - UpdatableRouteOptionsExtensions, RouteConstraints, RouteTypesById, RouteMask, - RouteExtensions, RouteLazyFn, RouteAddChildrenFn, RouteAddFileChildrenFn, @@ -231,7 +244,6 @@ export type { ResolveOptionalParams, ResolveRequiredParams, RootRoute, - FilebaseRouteOptionsInterface, } from './route' export { createNonReactiveMutableStore, @@ -239,9 +251,7 @@ export { } from './stores' export type { RouterBatchFn, - RouterReadableStore, GetStoreConfig, - RouterStores, RouterWritableStore, } from './stores' export { @@ -269,7 +279,6 @@ export type { ListenerFn, RouterEvents, MatchRoutesOpts, - RouterOptionsExtensions, DefaultRemountDepsFn, PreloadRouteFn, MatchRouteFn, @@ -412,6 +421,7 @@ export type { UseLoaderDataResult, ResolveUseLoaderData } from './useLoaderData' export type { Redirect, + RedirectFn, RedirectOptions, RedirectOptionsRoute, RedirectFnRoute, @@ -419,6 +429,25 @@ export type { AnyRedirect, } from './redirect' +export type { + HostedRouter, + InstallationRoutesById, + MountedRoutesById, + ModuleRootRoute, + ModuleRootRouteOptions, + MountRouteModuleOptions, + RegisteredRouterOf, + ScopeRouter, + ScopedRouter, + CompatibleRouteScope, + ScopedRouteOptions, + RouteScopeMarker, + RouteModuleScope, + ScopedRouterView, + ValidateRouteModuleMount, + ValidateRouteModuleMountPath, +} from './route-module' + export { redirect, isRedirect, @@ -466,10 +495,8 @@ export type { AnySerializationAdapter, SerializationAdapter, ValidateSerializableInput, - SerializerExtensions, ValidateSerializable, RegisteredSerializableInput, - SerializableExtensions, DefaultSerializable, Serializable, TSR_SERIALIZABLE, diff --git a/packages/router-core/src/link.ts b/packages/router-core/src/link.ts index 799ae50811..bb68c10723 100644 --- a/packages/router-core/src/link.ts +++ b/packages/router-core/src/link.ts @@ -1,3 +1,4 @@ +import type { CompatibleRouteScope, RouteModuleScope } from './route-module' import type { HistoryState, ParsedHistoryState } from '@tanstack/history' import type { AllParams, @@ -18,6 +19,7 @@ import type { ViewTransitionOptions, } from './router' import type { + Assign, ConstrainLiteral, Expand, MakeDifferenceOptional, @@ -371,6 +373,22 @@ export interface MaskOptions< in out TMaskTo extends string, > { _fromLocation?: ParsedLocation + /** + * Internal: absolute `to`/`from` are local to this route module. Set by the + * scoped APIs of a route module; do not set it manually. + */ + _module?: RouteModuleScope> + /** + * Internal: resolve `from` as the current full path of the route with this + * id. Set by route-bound APIs of route-module routes. + */ + _fromRoute?: string + /** + * Internal: the route id of the caller's nearest match. `_module` and + * `_fromRoute` of a module installed several times resolve to the + * installation it belongs to. Set by the framework bindings. + */ + _nearestRoute?: string mask?: ToMaskOptions } @@ -379,6 +397,7 @@ export type ToMaskOptions< TMaskFrom extends string = string, TMaskTo extends string = '.', > = ToSubOptions & { + _module?: RouteModuleScope> unmaskOnReload?: boolean } @@ -503,11 +522,33 @@ type ResolveAllToParams< ? AllParams : FullSearchSchemaInput +/** + * The path params of a destination, with the host params of a route module + * installation for its `HostedRouter`. + */ +type WithHostParams = TRouter extends { + '~hostParams': infer THostParams +} + ? Assign + : TParams + export type ResolveToParams< TRouter extends AnyRouter, TParamVariant extends ParamVariant, TFrom, TTo, +> = TParamVariant extends 'PATH' + ? WithHostParams< + TRouter, + ResolveDestinationParams + > + : ResolveDestinationParams + +type ResolveDestinationParams< + TRouter extends AnyRouter, + TParamVariant extends ParamVariant, + TFrom, + TTo, > = ResolveRelativePath extends infer TPath ? undefined extends TPath diff --git a/packages/router-core/src/load-client.ts b/packages/router-core/src/load-client.ts index e84bb8fba5..f96938e8e4 100644 --- a/packages/router-core/src/load-client.ts +++ b/packages/router-core/src/load-client.ts @@ -8,6 +8,7 @@ import { runRouteLifecycle, } from './router' import { dehydrateSsrMatchId } from './ssr/ssr-match-id' +import { routeModules } from './route-module-hooks' import type { GLOBAL_SEROVAL, GLOBAL_TSR } from './ssr/constants' import type { TsrSsrGlobal } from './ssr/types' import type { ParsedLocation } from './location' @@ -998,8 +999,18 @@ async function getNotFoundBoundary( const cause = indexed?.[1 /* outcome */][1 /* error or redirect */] as | NotFoundError | undefined - let index = cause?.routeId - ? matches.findIndex((match) => match.routeId === cause.routeId) + let routeId = cause?.routeId + // Module-local ids of a route module installed several times resolve in + // the installation of the match that threw. + if (routeModules && routeId) { + routeId = routeModules.resolveRouteId( + router, + routeId, + matches[indexed![0 /* index */]]?.routeId, + ) + } + let index = routeId + ? matches.findIndex((match) => match.routeId === routeId) : (indexed?.[0 /* index */] ?? matches.length - 1) if (index < 0) { index = 0 @@ -1092,6 +1103,11 @@ function materializeRedirect( while (outcome[0 /* kind */] === REDIRECTED) { const redirect = outcome[1 /* redirect */] const redirectOptions = redirect.options + // Module redirects resolve in the installation of the route that threw. + // Only route modules, which install the behavior, read it. + if (routeModules) { + redirectOptions._nearestRoute ??= route.id + } try { if (redirectOptions.href || redirect.headers.has('Location')) { router.resolveRedirect(redirect) diff --git a/packages/router-core/src/load-server.ts b/packages/router-core/src/load-server.ts index 325f8d63f7..a34fc78579 100644 --- a/packages/router-core/src/load-server.ts +++ b/packages/router-core/src/load-server.ts @@ -10,6 +10,7 @@ import { lifecycleEnd, runRouteLifecycle, } from './router' +import { routeModules } from './route-module-hooks' import type { ParsedLocation } from './location' import type { AnyRouteMatch } from './Matches' import type { NotFoundError } from './not-found' @@ -132,6 +133,11 @@ function materializeRedirect( signal?.throwIfAborted() try { outcome[1].options._fromLocation = lane.location + // Module redirects resolve in the installation of the route that threw. + // Only route modules, which install the behavior, read it. + if (routeModules) { + outcome[1].options._nearestRoute ??= route.id + } router.resolveRedirect(outcome[1]) signal?.throwIfAborted() return outcome @@ -505,8 +511,18 @@ async function getNotFoundBoundary( fallback = 0, ): Promise { const cause = indexed?.[1][1] as NotFoundError | undefined - let index = cause?.routeId - ? matches.findIndex((match) => match.routeId === cause.routeId) + let routeId = cause?.routeId + // Module-local ids of a route module installed several times resolve in + // the installation of the match that threw. + if (routeModules && routeId) { + routeId = routeModules.resolveRouteId( + router, + routeId, + matches[indexed![0]]?.routeId, + ) + } + let index = routeId + ? matches.findIndex((match) => match.routeId === routeId) : (indexed?.[0] ?? matches.length - 1) if (index < 0) { index = 0 diff --git a/packages/router-core/src/redirect.ts b/packages/router-core/src/redirect.ts index dc6551d174..0065cf7a2b 100644 --- a/packages/router-core/src/redirect.ts +++ b/packages/router-core/src/redirect.ts @@ -1,5 +1,6 @@ import type { NavigateOptions } from './link' -import type { AnyRouter, RegisteredRouter } from './router' +import type { AnyRouter, Register, RegisteredRouter } from './router' +import type { RegisteredRouterOf } from './route-module' export type AnyRedirect = Redirect @@ -72,9 +73,12 @@ export type RedirectOptionsRoute< * This enables relative redirects like `Route.redirect({ to: './overview' })`. * @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RedirectType) */ -export interface RedirectFnRoute { +export interface RedirectFnRoute< + in out TDefaultFrom extends string = string, + in out TDefaultRegister = Register, +> { < - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, const TTo extends string | undefined = undefined, const TMaskTo extends string = '', >( @@ -82,6 +86,20 @@ export interface RedirectFnRoute { ): Redirect } +/** + * The signature of `redirect`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `redirect` of this type. + */ +export type RedirectFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TTo extends string | undefined = '.', + const TFrom extends string = string, + const TMaskFrom extends string = TFrom, + const TMaskTo extends string = '', +>( + opts: RedirectOptions, +) => Redirect + /** * Create a redirect Response understood by TanStack Router. * diff --git a/packages/router-core/src/route-module-hooks.ts b/packages/router-core/src/route-module-hooks.ts new file mode 100644 index 0000000000..88ca1fb33a --- /dev/null +++ b/packages/router-core/src/route-module-hooks.ts @@ -0,0 +1,59 @@ +import type { AnyRouter, BuildNextOptions } from './router' + +/** + * The route-module behavior of the core. Route-module code installs it + * (`installRouteModules`) when a module root is created or mounted, before an + * application creates its router; applications without route modules never + * assign `routeModules`, so bundlers drop every branch that reads it. + */ +export interface RouteModuleBehavior { + /** + * The id of a route module's root (`:`, from its `_module` + * option), which qualifies the ids of its subtree such as + * `@acme/products:/$productId` wherever the module is mounted; `undefined` + * for every other route. + */ + rootId: (options: { _module?: string } | undefined) => string | undefined + /** + * Resolves the id of the route whose matches the caller reads. Route modules + * address their routes by module-local ids such as `@acme/settings:/profile`; + * when the route tree installs the module several times, such an id resolves + * to the route of the installation of the caller's nearest match + * (`nearestRouteId`). Every other id is returned as it is. + */ + resolveRouteId: ( + router: AnyRouter, + routeId: string, + nearestRouteId: string | undefined, + ) => string + /** + * Translates the module-local options of route-module APIs (`_module`, + * `_fromRoute`, `_nearestRoute`) into application options. + */ + scopeLocation: ( + router: AnyRouter, + opts: TOptions, + ) => TOptions + /** + * The navigation scope of a route's route-bound APIs (`redirect`, + * `useNavigate`, `Link`). A route-module route resolves absolute + * destinations in its module and takes `from` from its current full path, + * which depends on the mount; it returns `undefined` for application routes, + * which keep `from`. + */ + navigationScope: ( + routeId: string, + ) => { from: undefined; _module: string; _fromRoute: string } | undefined +} + +/** + * Installed before the first render and never removed, so framework hooks may + * branch on it statically, like on `isServer`. + */ +export let routeModules: RouteModuleBehavior | undefined + +export function installRouteModuleBehavior( + behavior: RouteModuleBehavior, +): void { + routeModules = behavior +} diff --git a/packages/router-core/src/route-module-internal.ts b/packages/router-core/src/route-module-internal.ts new file mode 100644 index 0000000000..d35d5dda2f --- /dev/null +++ b/packages/router-core/src/route-module-internal.ts @@ -0,0 +1,4 @@ +// Internal generated/framework wiring; use generated scopes to author modules. +export * from './route-module' +export { routeModules } from './route-module-hooks' +export { getParamNames, parseSegments } from './new-process-route-tree' diff --git a/packages/router-core/src/route-module.ts b/packages/router-core/src/route-module.ts new file mode 100644 index 0000000000..b79decc104 --- /dev/null +++ b/packages/router-core/src/route-module.ts @@ -0,0 +1,915 @@ +import { invariant } from './invariant' +import { redirect } from './redirect' +import { rootRouteId } from './root' +import { installRouteModuleBehavior } from './route-module-hooks' +import type { RouteModuleBehavior } from './route-module-hooks' +import type { RedirectFn } from './redirect' +import type { BuildLocationFn, NavigateFn } from './RouterProvider' +import type { AnyContext, AnyRoute, Route, RouteOptions } from './route' +import type { + AnyRouter, + Register, + RegisteredRouter, + RegisteredSsr, + RouterCore, +} from './router' +import type { ParseRoute } from './routeInfo' +import type { + RegisteredSSROption, + ValidateSerializableInput, +} from './ssr/serializer/transformer' +import type { LooseReturnType } from './utils' + +/** + * The router a route scope is typed against. + * + * A scope register (`{ router: TRouter }`) selects its router. Any other + * register, including `unknown` from code-based routes, falls back to the + * application's registered router. + */ +export type RegisteredRouterOf = TRegister extends { + router: infer TRouter extends AnyRouter +} + ? TRouter + : RegisteredRouter + +/** + * The router type of a route scope: the router of a route tree that contains + * the scope's routes, typed independently of the application that mounts it. + */ +export type ScopeRouter< + TRouteTree extends AnyRoute, + TModuleId extends string = string, +> = RouterCore, 'never', false> + +declare const routeScopeMarker: unique symbol + +/** Internal generated/framework wiring: An erased distinction between a provider scope and a host router. */ +export interface RouteScopeMarker { + [routeScopeMarker]: TModuleId +} + +/** Internal generated/framework wiring: Selects an installation without changing the provider's route types. */ +export type ScopedRouter = + Omit< + TRouter['routeTree'], + typeof routeScopeMarker + > extends infer TTree extends AnyRoute + ? ScopeRouter & + Pick> + : never + +/** Internal generated/framework wiring: The scope stamp accepted by a destination's consuming API. */ +export type CompatibleRouteScope = + TRouter['routeTree'] extends RouteScopeMarker + ? TModuleId extends `${infer TModule}#${string}` + ? TModuleId | TModule + : TModuleId | `${TModuleId}#${string}` + : string + +/** Internal generated/framework wiring: A receiver constraint is deferred only until an origin is available. */ +export type RouteModuleScope = + | TModuleId + | { + receiver: TModuleId + target: TModuleId + } + +type BoundScope = TOptions extends { + _module: infer TScope +} + ? TScope extends { receiver: string; target: string } + ? TScope + : TScope extends `${string}#${string}` + ? TModuleId extends `${string}#${string}` + ? TModuleId + : { receiver: TModuleId; target: TScope } + : TModuleId + : TModuleId + +/** Internal generated/framework wiring: Preserve scope identity through reusable options and spreads. */ +export type ScopedRouteOptions = + TRouter['routeTree'] extends RouteScopeMarker + ? TOptions extends ReadonlyArray + ? { + [TKey in keyof TOptions]: ScopedRouteOptions + } + : Omit & { + readonly _module: BoundScope + } + : TOptions + +/** + * The router of a route module as seen from where it is mounted: links into + * the module also take the path params of the routes above it (`THostParams`). + * Code inside the module uses its own router, which never has them. + */ +export type HostedRouter = TRouter & { + '~hostParams': THostParams +} + +/** + * Application route maps cannot infer final paths from a provider's local + * templates. Keep own identity and data precise; raw parent/child links point + * into the application graph rather than the provider's template graph. + */ +export type MountedRoutesById = { + [TId in keyof TRoutesById]: TRoutesById[TId] extends { + types: infer TTypes + options: infer TOptions + } + ? Omit< + TRoutesById[TId], + | 'path' + | 'fullPath' + | 'to' + | 'parentRoute' + | 'children' + | 'options' + | 'types' + > & { + readonly path: string | undefined + readonly fullPath: string + readonly to: string + parentRoute: AnyRoute + children?: Array + options: Omit & { + path: string | undefined + getParentRoute: () => AnyRoute + } + types: Omit< + TTypes, + 'path' | 'fullPath' | 'to' | 'parentRoute' | 'children' + > & { + path: string | undefined + fullPath: string + to: string + parentRoute: AnyRoute + children: Array | undefined + } + } + : TRoutesById[TId] +} + +/** + * The routes of one installation of a route module installed several times, + * by id: `#:/…` for each `:/…` of `TRoutesById`. + */ +export type InstallationRoutesById< + TRoutesById, + TModuleId extends string, + TAs extends string, +> = { + [TId in keyof TRoutesById as TId extends `${TModuleId}:${infer TPath}` + ? `${TModuleId}#${TAs}:${TPath}` + : TId]: TId extends `${TModuleId}:${infer TPath}` + ? InstallationRoute + : TRoutesById[TId] +} + +type InstallationRoute = TRoute extends { + types: infer TTypes +} + ? Omit & { + readonly id: TId + types: Omit & { id: TId } + } + : TRoute + +/** + * Options of a route module's root route (`createModuleRoot`). + * + * The root has no path or id of its own: the module id determines its id and + * the including route tree chooses where it is mounted. + */ +export interface ModuleRootRouteOptions< + TModuleId extends string, + TRegister, + TSearchValidator = undefined, + TRouterContext = {}, + TRouteContextFn = AnyContext, + TBeforeLoadFn = AnyContext, + TLoaderDeps extends Record = {}, + TLoaderFn = undefined, + TSSR = unknown, + TServerMiddlewares = unknown, + THandlers = undefined, +> extends Omit< + RouteOptions< + TRegister, + any, // TParentRoute: provided by the including tree + `${TModuleId}:`, // TId + `${TModuleId}:`, // TCustomId + '/', // TFullPath: module-local + '/', // TPath + TSearchValidator, + {}, // TParams + TLoaderDeps, + TLoaderFn, + TRouterContext, + TRouteContextFn, + TBeforeLoadFn, + TSSR, + TServerMiddlewares, + THandlers + >, + | 'path' + | 'id' + | 'getParentRoute' + | 'caseSensitive' + | 'parseParams' + | 'stringifyParams' + | 'params' + | '_module' + | '_uses' +> {} + +/** + * The root route of a route module. Its router context (`TRouterContext`) is + * the context the module requires from the route it is mounted under. + */ +export type ModuleRootRoute< + TModuleId extends string, + TRegister, + TSearchValidator = undefined, + TRouterContext = {}, + TRouteContextFn = AnyContext, + TBeforeLoadFn = AnyContext, + TLoaderDeps extends Record = {}, + TLoaderFn = undefined, + TChildren = unknown, + TFileRouteTypes = unknown, + TSSR = unknown, + TServerMiddlewares = unknown, + THandlers = undefined, +> = Route< + TRegister, + any, // TParentRoute + '/', // TPath + '/', // TFullPath + `${TModuleId}:`, // TCustomId + `${TModuleId}:`, // TId + TSearchValidator, + {}, // TParams + TRouterContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + TChildren, + TFileRouteTypes, + TSSR, + TServerMiddlewares, + THandlers +> + +/** + * Returns the id of the route module that owns a route, or `undefined` for + * routes that do not belong to a route module. + * + * Route-module routes have qualified ids such as `@acme/products:/$productId`; + * the module root's id is `@acme/products:`. Package names cannot contain + * `:`, and application route ids start with `/` (or are `__root__`). + */ +export function getRouteModuleId(routeId: string): string | undefined { + const index = routeId.indexOf(':') + return index > 0 && routeId[0] !== '/' ? routeId.slice(0, index) : undefined +} + +/** + * The route ids of a namespace of one installation of a module installed + * several times (`#`): the namespace takes the module's own + * ids (`:/…`) and addresses the routes of its installation. + * Returns `undefined` for the namespace of a module installed once. + */ +export function getInstallationRouteIdMapper( + namespaceId: string, +): ((routeId: T) => T) | undefined { + const separator = namespaceId.indexOf('#') + if (separator < 0) { + return undefined + } + const prefix = `${namespaceId.slice(0, separator)}:` + return (routeId) => + typeof routeId === 'string' && routeId.startsWith(prefix) + ? ((namespaceId + routeId.slice(separator)) as typeof routeId) + : routeId +} + +/** + * The navigation scope of a route-module route: its route-bound APIs resolve + * absolute destinations in the module and take `from` from the route's + * current full path, which depends on the mount. + */ +function getModuleNavigationScope(routeId: string) { + const moduleId = getRouteModuleId(routeId) + return moduleId === undefined + ? undefined + : { from: undefined, _module: moduleId, _fromRoute: routeId } +} + +/** The id of a module root: `:`. */ +function getModuleRootId(options: { _module?: string } | undefined) { + return options?._module === undefined ? undefined : `${options._module}:` +} + +/** + * Installs the route-module behavior of the core. Module roots and mounts + * call it when they are created, before an application creates its router, so + * applications without route modules never ship that behavior. Installing + * again assigns the same behavior. + */ +export function installRouteModules(): void { + installRouteModuleBehavior({ + rootId: getModuleRootId, + resolveRouteId: resolveModuleRouteId, + scopeLocation: scopeLocationOptions, + navigationScope: getModuleNavigationScope, + } satisfies RouteModuleBehavior) +} + +type MissingKeys = Exclude & string + +type RouteModuleName = + TRoot['id'] extends `${infer TModuleId}:` ? TModuleId : TRoot['id'] + +/** + * Validates the mount path of a route module: it must be static, since links + * into the module could not provide path params of the mount path. + */ +export type ValidateRouteModuleMountPath< + TRoot extends AnyRoute, + TAt extends string, +> = TAt extends `${string}$${string}` + ? `Route module '${RouteModuleName}' must be mounted at a static path without path params` + : TAt + +type ValidateMountSearch< + TRoot extends AnyRoute, + TParent extends AnyRoute, +> = {} extends TParent['types']['fullSearchSchemaInput'] + ? {} + : { + '~mountSearchError': `Route module '${RouteModuleName}' cannot be mounted under '${TParent['id']}', which requires search params. Links into the module could not provide them.` + } + +type ValidateMountContext< + TRoot extends AnyRoute, + TParent extends AnyRoute, +> = TParent['types']['allContext'] extends TRoot['types']['routerContext'] + ? {} + : { + '~mountContextError': [ + MissingKeys< + TParent['types']['allContext'], + TRoot['types']['routerContext'] + >, + ] extends [never] + ? `Route module '${RouteModuleName}' requires router context that '${TParent['id']}' does not provide with compatible types` + : `Route module '${RouteModuleName}' requires router context '${MissingKeys< + TParent['types']['allContext'], + TRoot['types']['routerContext'] + >}' that '${TParent['id']}' does not provide` + } + +type ModuleParamKeys = + ParseRoute extends infer TRoute + ? TRoute extends AnyRoute + ? keyof TRoute['types']['params'] + : never + : never + +type ConflictingHostParams< + TRoot extends AnyRoute, + TParent extends AnyRoute, +> = Extract> & + string + +type ValidateMountParams = [ + ConflictingHostParams, +] extends [never] + ? {} + : { + '~mountParamsError': `Route module '${RouteModuleName}' cannot be mounted under '${TParent['id']}' because its routes overwrite host params '${ConflictingHostParams}'` + } + +type IsSerializableResult = [T] extends [ + ValidateSerializableInput, +] + ? true + : false + +/** The ids of a module's server-rendered routes with unserializable results. */ +type UnserializableRouteIds = + ParseRoute extends infer TRoute + ? TRoute extends AnyRoute + ? TRoute['types']['allSsr'] extends false + ? never + : IsSerializableResult extends false + ? TRoute['id'] + : IsSerializableResult< + LooseReturnType + > extends false + ? TRoute['id'] + : never + : never + : never + +/** + * In a server-rendering application (`Register['ssr']`), the loader and + * `beforeLoad` results of a module's server-rendered routes are serialized + * with the application's serialization adapters. The module is typed without + * them, so the mount checks every route. + */ +type ValidateMountLifecycle = + false extends RegisteredSsr + ? {} + : RegisteredSSROption extends false + ? {} + : [UnserializableRouteIds] extends [never] + ? {} + : { + '~mountSerializationError': `Route module '${RouteModuleName}' returns loader or beforeLoad results from '${UnserializableRouteIds & string}' that the application cannot serialize` + } + +/** + * Validates that a route module can be mounted under `TParent`. + * + * A module is checked against its own module-local types. Path params of the + * host chain carry over into the module's own links, and links from where the + * module is mounted pass them (`HostedRouter`). Required search params would + * not carry over, so the host chain must not have any. The host must provide + * the router context the module root requires, and a server-rendering + * application must be able to serialize the module's lifecycle results. + */ +export type ValidateRouteModuleMount< + TRoot extends AnyRoute, + TParent extends AnyRoute, +> = ValidateMountSearch & + ValidateMountContext & + ValidateMountParams & + ValidateMountLifecycle + +export interface MountRouteModuleOptions< + TRoot extends AnyRoute, + TParent extends AnyRoute, + TAt extends string, +> { + /** + * The host route the module root is mounted under. It must satisfy the + * module's requirements (see `ValidateRouteModuleMount`). + */ + // Validating on this property instead of the options object keeps the + // inference of `TAt` precise. + parent: (() => TParent) & ValidateRouteModuleMount + /** + * The static path of the module root relative to `parent`. Omit it (or use + * `'/'`) to mount the module without a path segment. + */ + at?: ValidateRouteModuleMountPath + /** + * The name of this installation when the route tree installs the module + * several times. The installation gets copies of the module's routes with + * ids `#:/…`; module code keeps addressing them by its own + * ids, which resolve to the installation it renders under. + */ + as?: string + /** + * The installations of modules installed several times that this + * installation links to, keyed by module id. + */ + uses?: Record +} + +/** + * Resolves a module-local route id of a module installed several times + * (`@acme/settings:/profile`) to the route of an installation + * (`@acme/settings#orgSettings:/profile`): the installation of the caller's + * nearest match, or the installation its module uses (`uses`). A route tree + * never matches two installations of one module at once, so the caller's + * match chain determines the installation. Every other id, including those of + * the router's routes, is returned as it is. + */ +function resolveModuleRouteId( + router: AnyRouter, + routeId: string, + nearestRouteId: string | undefined, +): string { + const index = routeId.indexOf(':') + const nearestIndex = nearestRouteId?.indexOf(':') ?? -1 + if ( + router.routesById[routeId] || + index <= 0 || + routeId[0] === '/' || + nearestIndex <= 0 || + nearestRouteId![0] === '/' + ) { + return routeId + } + const moduleId = routeId.slice(0, index) + const caller = nearestRouteId!.slice(0, nearestIndex) + const installation = caller.startsWith(`${moduleId}#`) + ? caller + : (router.routesById[`${caller}:`] as AnyRoute | undefined)?.options + ._uses?.[moduleId] + return installation === undefined + ? routeId + : installation + routeId.slice(index) +} + +/** + * Resolves the internal route-module options of a location build: + * - `_module`: absolute `to`/`from` (and mask `to`/`from`) are local to the + * module whose root has the id `<_module>:`; + * - `_fromRoute`: without an explicit `from`, resolve from the current full + * path of the route with this id; + * - `_nearestRoute`: both resolve to the installation of the caller (see + * `resolveModuleRouteId`). + */ +function scopeLocationOptions< + TOptions extends { + to?: unknown + from?: string + mask?: { to?: unknown; from?: string; _module?: RouteModuleScope } + _module?: RouteModuleScope + _fromRoute?: string + _nearestRoute?: string + }, +>(router: AnyRouter, opts: TOptions): TOptions { + // Called with `_module` set on the options or on their mask (see + // `RouterCore.buildLocation`); module roots and mounts installed it. + if (opts._module === undefined) { + // A mask is built in the scope of its destination: a module mask of an + // application destination has no module to resolve its paths in. + if (process.env.NODE_ENV !== 'production') { + throw new Error( + `Invariant failed: The mask of an application destination cannot come from route module "${scopeTarget(opts.mask!._module!)}". Build the destination and its mask in the same scope.`, + ) + } + invariant() + } + // Route/RouteApi consumers retain their authored origin even when reusable + // options supply a destination stamp. + if (opts._fromRoute) { + const index = opts._fromRoute.indexOf(':') + if (index > 0 && opts._fromRoute[0] !== '/') { + opts = bindRouteScopeOptions( + opts._fromRoute.slice(0, index), + opts, + router, + opts._nearestRoute, + ) as TOptions + } + } + const moduleId = + typeof opts._module === 'object' + ? resolveRouteScopeConstraint(router, opts._module, opts._nearestRoute) + : // Checked above; a `_fromRoute` rebinding keeps it set. + opts._module! + const rootId = resolveModuleRouteId( + router, + `${moduleId}:`, + opts._nearestRoute, + ) + const root = router.routesById[rootId] as AnyRoute | undefined + if (!root) { + if (process.env.NODE_ENV !== 'production') { + const names = Object.keys(router.routesById) + .filter((id) => id.startsWith(`${moduleId}#`) && id.endsWith(':')) + .map((id) => `"${id.slice(moduleId.length + 1, -1)}"`) + throw new Error( + names.length > 1 + ? `Invariant failed: Route module "${moduleId}" is installed several times in this router (as ${names.join(', ')}). Address one installation through its namespace.` + : names.length === 1 + ? `Invariant failed: Route module "${moduleId}" is installed as ${names[0]} in this router. Address it through its namespace.` + : `Invariant failed: Route module "${moduleId}" is not installed in this router. Mount it with mountRouteModule() in the route tree of the app.`, + ) + } + invariant() + } + if (opts.mask?._module !== undefined) { + // The mask shares the scope of its destination. + resolveRouteScope( + rootId.slice(0, -1), + opts.mask._module, + router, + opts._nearestRoute, + ) + } + const prefix = root.fullPath === '/' ? '' : root.fullPath + const localize = (path: T): T => + prefix && typeof path === 'string' && path[0] === '/' + ? ((prefix + path) as T) + : path + return { + ...opts, + to: localize(opts.to), + from: + opts.from === undefined && opts._fromRoute !== undefined + ? ( + router.routesById[ + resolveModuleRouteId(router, opts._fromRoute, opts._nearestRoute) + ] as AnyRoute | undefined + )?.fullPath + : localize(opts.from), + mask: opts.mask && { + ...opts.mask, + to: localize(opts.mask.to), + from: localize(opts.mask.from), + }, + } +} + +/** + * Mounts a route module's root under a host route. + * + * Generated route trees call this for every installed module. The module's + * routes keep their qualified ids; their paths become the mount path followed + * by their module-local paths. A module installed several times is mounted + * once per installation (`as`): each installation gets its own copies of the + * module's routes, and the module's route objects stay templates with their + * module-local ids and paths. + * + * @experimental Route modules are experimental and may change in any release. + */ +export function mountRouteModule< + TRoot extends AnyRoute, + TParent extends AnyRoute, + const TAt extends string = '/', +>(root: TRoot, options: MountRouteModuleOptions): TRoot { + const moduleId = root.options._module + if (moduleId === undefined) { + if (process.env.NODE_ENV !== 'production') { + throw new Error( + 'Invariant failed: mountRouteModule() expects the root route of a route module, created with createModuleRoot().', + ) + } + invariant() + } + // A module is installed once, or several times under names; mixing both + // would resolve module-local ids ambiguously. Generated trees never mix: + // the generator rejects it. + const mountedUnder = root.options.getParentRoute?.() + if ( + mountedUnder !== undefined && + (mountedUnder === templateHost) !== (options.as !== undefined) + ) { + if (process.env.NODE_ENV !== 'production') { + throw new Error( + `Invariant failed: Route module "${moduleId}" is installed several times. Name every installation with "as".`, + ) + } + invariant() + } + const at = options.at + const mount = { + getParentRoute: options.parent, + path: at && at !== '/' ? at : undefined, + _uses: options.uses, + } + installRouteModules() + if (options.as === undefined) { + root.update(mount as any) + ;(root as { isRoot: boolean }).isRoot = false + return root + } + if (root.id === undefined) { + initTemplates(root, () => templateHost) + } + return copyRoute(root, { + ...mount, + _module: `${moduleId}#${options.as}`, + }) as TRoot +} + +/** + * The stand-in parent of an unmounted module root: module code addresses the + * module's routes by their module-local ids and paths. + */ +const templateHost = { id: rootRouteId, fullPath: '/' } as AnyRoute + +function initTemplates(route: AnyRoute, getParentRoute: () => AnyRoute) { + route.update({ getParentRoute } as any) + route.init(0) + route.children?.forEach((child: AnyRoute) => + initTemplates(child, () => route), + ) +} + +/** + * Copies a module route and its subtree for one installation. Copies share + * the template's options, so components, loaders and code-split chunks are + * the same for every installation; `lazyFn` loads into each copy. + */ +function copyRoute(template: AnyRoute, options: object): AnyRoute { + const copy = new (template.constructor as new () => AnyRoute)() + copy.options = { ...template.options, ...options } + ;(copy as { isRoot: boolean }).isRoot = false + copy.lazyFn = template.lazyFn + ;(copy as { _template?: AnyRoute })._template = template + copy.children = template.children?.map((child: AnyRoute) => + copyRoute(child, { getParentRoute: () => copy }), + ) + return copy +} + +function assertRouteScope( + compatible: boolean, + incoming: string, + moduleId: string, +) { + if (!compatible) { + if (process.env.NODE_ENV !== 'production') { + throw new Error( + `Cannot use route scope "${incoming}" options in route scope "${moduleId}".`, + ) + } + invariant() + } +} + +function resolveRouteScopeConstraint( + router: AnyRouter, + scope: { receiver: string; target: string }, + nearestRouteId?: string, +): string { + assertRouteScope( + resolveModuleRouteId(router, `${scope.receiver}:`, nearestRouteId) === + `${scope.target}:`, + scope.target, + scope.receiver, + ) + return scope.target +} + +function scopeTarget(scope: RouteModuleScope): string { + return typeof scope === 'object' ? scope.target : scope +} + +/** + * Internal generated/framework wiring: the scope of options an API of + * `moduleId` receives. The options' own scope (`scope`) must be compatible + * with it, and an installation chosen by either is kept. + */ +export function resolveRouteScope( + moduleId: string, + scope: RouteModuleScope | undefined, + router?: AnyRouter, + nearestRouteId?: string, +): RouteModuleScope { + if (typeof scope === 'object' && router) { + const target = resolveRouteScopeConstraint( + router, + scope, + moduleId.includes('#') ? `${moduleId}:` : nearestRouteId, + ) + // The deferred receiver is already this API's scope, so the resolved + // constraint has also established its installation ownership. + if (scope.receiver === moduleId) { + return target + } + scope = target + } + const incoming = typeof scope === 'object' ? scope.target : scope + if (incoming && incoming !== moduleId) { + const incomingInstallation = incoming.indexOf('#') + const installation = moduleId.indexOf('#') + assertRouteScope( + incomingInstallation < 0 + ? moduleId.startsWith(`${incoming}#`) + : installation < 0 && incoming.startsWith(`${moduleId}#`), + incoming, + moduleId, + ) + if (incomingInstallation >= 0) { + scope = { receiver: moduleId, target: incoming } + if (router) { + scope = resolveRouteScopeConstraint(router, scope, nearestRouteId) + } + } + } + return typeof scope === 'object' + ? scope + : incoming?.includes('#') + ? incoming + : moduleId +} + +/** Internal generated/framework wiring: Bind options without silently replacing an incompatible scope. */ +export function bindRouteScopeOptions( + moduleId: string, + options: T, + router?: AnyRouter, + nearestRouteId?: string, +): Omit & { _module: RouteModuleScope } { + if (options._module === moduleId) { + // Already bound to this scope. + return options as any + } + return { + ...options, + _module: resolveRouteScope( + moduleId, + options._module, + router, + nearestRouteId, + ), + } +} + +/** + * Internal generated/framework wiring: binds an id-based API (`getRouteApi`, + * `useMatch`, `notFound`, ...) to one installation of a module installed + * several times. The module-local ids it receives, as its argument or as the + * `key` of its options, map to the installation's. Any other scope uses the + * API itself. + */ +export function bindRouteScopeIdApi) => any>( + moduleId: string, + api: TApi, + key?: 'from' | 'routeId', +): TApi { + const toInstallation = getInstallationRouteIdMapper(moduleId) + if (!toInstallation) { + return api + } + if (key === undefined) { + return ((id: unknown) => api(toInstallation(id))) as TApi + } + return ((options?: Record) => + api( + options?.[key] === undefined + ? options + : { ...options, [key]: toInstallation(options[key]) }, + )) as TApi +} + +/** + * Creates the `redirect` of a route module: absolute destinations are local to + * the module, wherever it is mounted. + */ +export function createScopedRedirect( + moduleId: string, +): RedirectFn<{ router: TRouter }> { + return (opts) => redirect(bindRouteScopeOptions(moduleId, opts) as any) as any +} + +/** + * The router as seen from a route module: `navigate` and `buildLocation` take + * the module's local paths and are typed against the module router + * (`TRouter`). `preloadRoute` and `matchRoute` are already typed by the route + * tree of `TRouter`. + */ +export type ScopedRouterView = Omit< + TRouter, + 'navigate' | 'buildLocation' | 'routeTree' | 'routesById' | 'routesByPath' +> & { + navigate: NavigateFn<{ router: TRouter }> + buildLocation: BuildLocationFn<{ router: TRouter }> + /** Raw application routes retain their final installed IDs and paths. */ + routeTree: AnyRoute + routesById: Record + routesByPath: Record +} + +const scopedRouterViews = new WeakMap>() + +/** + * Returns a view of `router` whose path-based navigation methods address the + * routes of a route module in module-local coordinates. Everything else is + * read from the router itself. A module installed several times is addressed + * in the installation of the caller's nearest match (`nearestRouteId`). + */ +export function getScopedRouterView( + router: AnyRouter, + moduleId: string, + nearestRouteId?: string, +): ScopedRouterView { + const namespace = resolveModuleRouteId( + router, + `${moduleId}:`, + nearestRouteId, + ).slice(0, -1) + let views = scopedRouterViews.get(router) + if (!views) { + views = Object.create(null) as Record + scopedRouterViews.set(router, views) + } + return (views[namespace] ??= createScopedRouterView(router, namespace)) as any +} + +function createScopedRouterView( + router: AnyRouter, + moduleId: string, +): AnyRouter { + const view: AnyRouter = Object.create(router) + view.navigate = (opts: any) => + router.navigate(bindRouteScopeOptions(moduleId, opts, router)) + view.buildLocation = (opts: any) => + router.buildLocation(bindRouteScopeOptions(moduleId, opts, router)) + view.preloadRoute = (opts: any) => + router.preloadRoute(bindRouteScopeOptions(moduleId, opts, router) as any) + view.matchRoute = (location: any, opts: any) => + router.matchRoute(bindRouteScopeOptions(moduleId, location, router), opts) + return view +} diff --git a/packages/router-core/src/route.ts b/packages/router-core/src/route.ts index 089369b454..59621a2565 100644 --- a/packages/router-core/src/route.ts +++ b/packages/router-core/src/route.ts @@ -3,6 +3,7 @@ import { cleanPath, trimPathLeft, trimPathRight } from './path' import { notFound } from './not-found' import { redirect } from './redirect' import { rootRouteId } from './root' +import { routeModules } from './route-module-hooks' import type { LazyRoute } from './fileRoute' import type { RouteInterpolation } from './path' import type { NotFoundError } from './not-found' @@ -506,7 +507,17 @@ export type ResolveFullPath< TPrefixed = RoutePrefix, > = TPrefixed extends RootRouteId ? '/' : TPrefixed -export interface RouteExtensions { +/** + * Framework adapters augment this interface with route-bound hooks and + * components. `TRegister` is the route's scope: `RegisteredRouterOf` + * is the router those APIs are typed against (the registered router for + * application routes, the route module's router for module routes). + */ +export interface RouteExtensions< + in out TId, + in out TFullPath, + in out TRegister, +> { id: TId fullPath: TFullPath } @@ -658,7 +669,7 @@ export interface Route< in out TSSR, in out TServerMiddlewares, in out THandlers, -> extends RouteExtensions { +> extends RouteExtensions { path: TPath parentRoute: TParentRoute children?: TChildren @@ -834,7 +845,7 @@ export interface Route< * @returns A redirect Response that can be thrown from loaders/beforeLoad * @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction */ - redirect: RedirectFnRoute + redirect: RedirectFnRoute } export type AnyRoute = Route< @@ -1267,6 +1278,18 @@ export interface UpdatableRouteOptions< in out TBeforeLoadFn, > extends UpdatableStaticRouteOption, UpdatableRouteOptionsExtensions { + /** + * Internal: the id of the route module whose root this route is. Set by + * `createModuleRoot`; do not set it manually. The root of an installation + * of a module installed several times has `#`. + */ + _module?: string + /** + * Internal: the installations that this module root's module uses of + * modules installed several times, keyed by module id. Set by + * `mountRouteModule`. + */ + _uses?: Record /** * If true, this route will be matched as case-sensitive * @@ -1797,7 +1820,10 @@ export class BaseRoute< RoutePathOptionsIntersection) | undefined - const isRoot = !options?.path && !options?.id + // A route module's root is never the tree root: it is mounted under a + // host route, and its id qualifies the ids of its subtree. + const moduleRootId = routeModules?.rootId(options) + const isRoot = !moduleRootId && !options?.path && !options?.id this.parentRoute = this.options.getParentRoute?.() @@ -1825,11 +1851,12 @@ export class BaseRoute< // Strip the parentId prefix from the first level of children const id = isRoot ? rootRouteId - : cleanPath( + : (moduleRootId ?? + cleanPath( (this.parentRoute.id === rootRouteId ? '' : this.parentRoute.id) + '/' + (customId ?? ''), - ) + )) if (path === rootRouteId) { path = '/' @@ -2011,8 +2038,12 @@ export class BaseRoute< * @returns A redirect Response that can be thrown from loaders/beforeLoad * @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction */ - redirect: RedirectFnRoute = (opts) => - redirect({ from: this.fullPath, ...opts } as any) + redirect: RedirectFnRoute = (opts) => + redirect({ + from: this.fullPath, + ...routeModules?.navigationScope(this.id), + ...opts, + } as any) } export class BaseRouteApi { @@ -2033,9 +2064,15 @@ export class BaseRouteApi { * @returns A redirect Response that can be thrown from loaders/beforeLoad * @link https://tanstack.com/router/latest/docs/framework/react/api/router/redirectFunction */ - redirect: RedirectFnRoute['fullPath']> = ( - opts, - ) => redirect({ from: this.id as string, ...opts } as any) + redirect: RedirectFnRoute< + RouteTypesById['fullPath'], + { router: TRouter } + > = (opts) => + redirect({ + from: this.id as string, + ...routeModules?.navigationScope(this.id as string), + ...opts, + } as any) } export interface RootRoute< diff --git a/packages/router-core/src/router.ts b/packages/router-core/src/router.ts index ecf443168d..990748d84a 100644 --- a/packages/router-core/src/router.ts +++ b/packages/router-core/src/router.ts @@ -39,6 +39,7 @@ import { } from './path' import { createSieveCache } from './sieve-cache' import { isNotFound } from './not-found' +import { routeModules } from './route-module-hooks' import { setupScrollRestoration } from './scroll-restoration' import { defaultParseSearch, defaultStringifySearch } from './searchParams' import { rootRouteId } from './root' @@ -106,7 +107,6 @@ import type { } from './routeInfo' import type { AnyRouteMatch, - MakeRouteMatch, MakeRouteMatchUnion, MatchRouteOptions, } from './Matches' @@ -127,6 +127,7 @@ import type { InitialHydrationScriptTags, } from './ssr/hydrationScripts' import type { GetStoreConfig, RouterStores } from './stores' +import type { RouteModuleScope, RouteScopeMarker } from './route-module' function isExternalUrl(url: URL, origin: string) { return ( @@ -574,13 +575,23 @@ export type LocationRewriteFunction = ({ export interface RouterState< in out TRouteTree extends AnyRoute = AnyRoute, - in out TRouteMatch = MakeRouteMatchUnion, + in out TRouteMatch = TRouteTree extends RouteScopeMarker + ? MakeRouteMatchUnion> + : MakeRouteMatchUnion, > { status: 'pending' | 'idle' isLoading: boolean matches: Array - location: ParsedLocation> - resolvedLocation?: ParsedLocation> + location: ParsedLocation< + TRouteTree extends RouteScopeMarker + ? Record + : FullSearchSchema + > + resolvedLocation?: ParsedLocation< + TRouteTree extends RouteScopeMarker + ? Record + : FullSearchSchema + > } export interface BuildNextOptions { @@ -600,6 +611,9 @@ export interface BuildNextOptions { from?: string href?: string _fromLocation?: ParsedLocation + _module?: RouteModuleScope + _fromRoute?: string + _nearestRoute?: string unsafeRelative?: 'path' _isNavigate?: boolean } @@ -1366,7 +1380,10 @@ export class RouterCore< if (this.latestLocation) { const config = this.getStoreConfig(this) this.batch = config.batch - this.stores = createRouterStores(this.latestLocation, config) + this.stores = createRouterStores( + this.latestLocation, + config, + ) if (!(isServer ?? this.isServer)) { setupScrollRestoration(this) @@ -1758,6 +1775,18 @@ export class RouterCore< staticData: route.options.staticData || {}, fullPath: route.fullPath, } + // The behavior is installed only by route-module composition, so an + // application without modules can eliminate this identity work. + if (routeModules && route.id[0] !== '/') { + const separator = route.id.indexOf(':') + if (separator > 0) { + const installation = route.id.indexOf('#') + match.localRouteId = + installation > 0 && installation < separator + ? route.id.slice(0, installation) + route.id.slice(separator) + : route.id + } + } } // If we have a global not found, mark the right match as global not found @@ -2179,6 +2208,32 @@ export class RouterCore< } } + // Route-module APIs pass module-local destinations (`_fromRoute` always + // comes with `_module`); translate them once so the destination, its mask + // and route masks all see final paths. Module roots and mounts install the + // translation before the router is created. The caller's options stay + // the cache key. + // Every read of the scope stays behind the binding, so an application + // without route modules drops these branches entirely. + let cacheKey: typeof opts | undefined + if ( + routeModules && + (opts._module !== undefined || opts.mask?._module !== undefined) + ) { + cacheKey = opts + opts = routeModules.scopeLocation(this, opts) + } else if ( + process.env.NODE_ENV !== 'production' && + (opts._module !== undefined || opts.mask?._module !== undefined) + ) { + // Nothing installed the behavior: no module root was created or mounted + // in this process, so the option comes from a module that is not + // installed. Production has no check, which would cost every application. + const scope = opts._module ?? opts.mask!._module! + throw new Error( + `Invariant failed: Route module "${typeof scope === 'object' ? scope.target : scope}" is not installed in this router. Mount it with mountRouteModule() in the route tree of the app.`, + ) + } const next = build(opts) if (opts.mask) { @@ -2211,7 +2266,7 @@ export class RouterCore< // `usedCurrent`. Route masks belong to the route tree and options, whose // updates replace the cache. if (!(isServer ?? this.isServer) && !usedCurrent && opts._fromLocation) { - this.staticLocations!.set(opts, next) + this.staticLocations!.set(cacheKey ?? opts, next) } return next @@ -2521,7 +2576,7 @@ export class RouterCore< abort.push(controller) } } - const invalidate = (d: MakeRouteMatch) => { + const invalidate = (d: AnyRouteMatch) => { if (invalidIds.has(d.id)) { const route = this.routesById[d.routeId] as AnyRoute const next = { diff --git a/packages/router-core/src/stores.ts b/packages/router-core/src/stores.ts index 8c2beeb2e7..59012159dc 100644 --- a/packages/router-core/src/stores.ts +++ b/packages/router-core/src/stores.ts @@ -176,5 +176,7 @@ export function createRouterStores( }) } - return store + // Internally every lane stores the same runtime match shape; the public + // router view projects the route-tree-specific match union over those values. + return store as unknown as RouterStores } diff --git a/packages/router-core/src/useNavigate.ts b/packages/router-core/src/useNavigate.ts index ca0282bcce..b56ac5dd80 100644 --- a/packages/router-core/src/useNavigate.ts +++ b/packages/router-core/src/useNavigate.ts @@ -1,9 +1,15 @@ import type { NavigateOptions } from './link' -import type { RegisteredRouter } from './router' +import type { AnyRouter, Register } from './router' +import type { RegisteredRouterOf } from './route-module' -export type UseNavigateResult = < - TRouter extends RegisteredRouter, - TTo extends string | undefined, +export type UseNavigateResult< + TDefaultFrom extends string, + TDefaultRegister = Register, +> = < + TRouter extends AnyRouter = RegisteredRouterOf, + // A default equal to the constraint keeps the inference of a destination-less + // call unchanged while allowing the router type to have a default. + TTo extends string | undefined = string | undefined, TFrom extends string = TDefaultFrom, TMaskFrom extends string = TFrom, TMaskTo extends string = '', diff --git a/packages/router-core/tests/route-module-unmounted.test.ts b/packages/router-core/tests/route-module-unmounted.test.ts new file mode 100644 index 0000000000..07640f0830 --- /dev/null +++ b/packages/router-core/tests/route-module-unmounted.test.ts @@ -0,0 +1,29 @@ +import { expect, test } from 'vitest' +import { createMemoryHistory } from '@tanstack/history' +import { BaseRootRoute, BaseRoute } from '../src' +import { getScopedRouterView } from '../src/route-module-internal' +import { createTestRouter } from './routerTestUtils' + +// Its own file: nothing in this module graph has created or mounted a module +// root, so the route-module behavior is not installed and the router names +// the module in development. +test('navigating into a route module without any mounted module fails', () => { + const rootRoute = new BaseRootRoute({}) + const indexRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/', + }) + const router = createTestRouter({ + routeTree: rootRoute.addChildren([indexRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + expect(() => + getScopedRouterView(router, '@acme/products').buildLocation({ + to: '/', + } as any), + ).toThrow( + 'Route module "@acme/products" is not installed in this router. Mount it with mountRouteModule() in the route tree of the app.', + ) + expect(router.buildLocation({ to: '/' }).pathname).toBe('/') +}) diff --git a/packages/router-core/tests/route-module.test.ts b/packages/router-core/tests/route-module.test.ts new file mode 100644 index 0000000000..c903ab6416 --- /dev/null +++ b/packages/router-core/tests/route-module.test.ts @@ -0,0 +1,942 @@ +import { describe, expect, test } from 'vitest' +import { createMemoryHistory } from '@tanstack/history' +import { BaseRootRoute, BaseRoute, notFound } from '../src' +import { + createScopedRedirect, + getRouteModuleId, + getScopedRouterView, + installRouteModules, + mountRouteModule, + routeModules, +} from '../src/route-module-internal' +import { createTestRouter, loadServerResponse } from './routerTestUtils' +import type { AnyRoute } from '../src' + +function createModuleRoot(moduleId: string, options: object = {}) { + return new BaseRoute({ ...options, _module: moduleId } as any) as AnyRoute +} + +/** + * root + * ├── / (app index) + * └── /shop (app layout) + * └── @acme/products (module root, mounted at /products) + * ├── / (module index) + * ├── /$productId + * └── /_layout (pathless) + * └── /reviews + */ +function setup(initialEntry = '/', routerOptions: object = {}) { + const rootRoute = new BaseRootRoute({}) + const indexRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/', + }) + const shopRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/shop', + }) + + const productsRoot = createModuleRoot('@acme/products') + const productsIndex = new BaseRoute({ + getParentRoute: () => productsRoot, + path: '/', + }) + const productRoute = new BaseRoute({ + getParentRoute: () => productsRoot, + path: '/$productId', + }) + const layoutRoute = new BaseRoute({ + getParentRoute: () => productsRoot, + id: '/_layout', + }) + const reviewsRoute = new BaseRoute({ + getParentRoute: () => layoutRoute, + path: '/reviews', + }) + productsRoot.addChildren([ + productsIndex, + productRoute, + layoutRoute.addChildren([reviewsRoute]), + ]) + + mountRouteModule(productsRoot, { + parent: () => shopRoute as AnyRoute, + at: '/products', + } as any) + + const routeTree = rootRoute.addChildren([ + indexRoute, + shopRoute.addChildren([productsRoot]), + ]) + const router = createTestRouter({ + routeTree, + history: createMemoryHistory({ initialEntries: [initialEntry] }), + ...routerOptions, + }) + return { router, productsRoot, productRoute, reviewsRoute } +} + +describe('route module ids and paths', () => { + test('module routes get qualified ids and mounted full paths', () => { + const { router } = setup() + + expect( + Object.fromEntries( + Object.values(router.routesById).map((route: AnyRoute) => [ + route.id, + route.fullPath, + ]), + ), + ).toEqual({ + __root__: '/', + '/': '/', + '/shop': '/shop', + '@acme/products:': '/shop/products', + '@acme/products:/': '/shop/products/', + '@acme/products:/$productId': '/shop/products/$productId', + '@acme/products:/_layout': '/shop/products', + '@acme/products:/_layout/reviews': '/shop/products/reviews', + }) + }) + + test('mounted module routes match by their final paths', () => { + const { router } = setup() + + expect( + router.matchRoutes('/shop/products/42').map((match) => match.routeId), + ).toEqual([ + '__root__', + '/shop', + '@acme/products:', + '@acme/products:/$productId', + ]) + expect( + router.matchRoutes('/shop/products').map((match) => match.routeId), + ).toEqual(['__root__', '/shop', '@acme/products:', '@acme/products:/']) + }) + + test('a module mounted without a path adds no path segment', () => { + const rootRoute = new BaseRootRoute({}) + const moduleRoot = createModuleRoot('account') + const settingsRoute = new BaseRoute({ + getParentRoute: () => moduleRoot, + path: '/settings', + }) + moduleRoot.addChildren([settingsRoute]) + mountRouteModule(moduleRoot, { parent: () => rootRoute } as any) + const router = createTestRouter({ + routeTree: rootRoute.addChildren([moduleRoot]), + history: createMemoryHistory(), + }) + + expect(router.routesById['account:']!.fullPath).toBe('/') + expect(router.routesById['account:/settings']!.fullPath).toBe('/settings') + expect( + router.matchRoutes('/settings').map((match) => match.routeId), + ).toEqual(['__root__', 'account:', 'account:/settings']) + }) + + test('nested modules keep their own qualified ids', () => { + const rootRoute = new BaseRootRoute({}) + const storefrontRoot = createModuleRoot('@acme/storefront') + const cartRoute = new BaseRoute({ + getParentRoute: () => storefrontRoot, + path: '/cart', + }) + const productsRoot = createModuleRoot('@acme/products') + const productRoute = new BaseRoute({ + getParentRoute: () => productsRoot, + path: '/$productId', + }) + productsRoot.addChildren([productRoute]) + mountRouteModule(productsRoot, { + parent: () => storefrontRoot, + at: '/products', + } as any) + storefrontRoot.addChildren([cartRoute, productsRoot]) + mountRouteModule(storefrontRoot, { + parent: () => rootRoute, + at: '/shop', + } as any) + const router = createTestRouter({ + routeTree: rootRoute.addChildren([storefrontRoot]), + history: createMemoryHistory(), + }) + + expect(router.routesById['@acme/storefront:/cart']!.fullPath).toBe( + '/shop/cart', + ) + expect(router.routesById['@acme/products:/$productId']!.fullPath).toBe( + '/shop/products/$productId', + ) + }) + + test('mountRouteModule rejects a route that is not a module root', () => { + const rootRoute = new BaseRootRoute({}) + const route = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/x', + }) + expect(() => + mountRouteModule(route as AnyRoute, { parent: () => rootRoute } as any), + ).toThrow(/createModuleRoot/) + }) +}) + +describe('getRouteModuleId', () => { + const cases = [ + ['@acme/products:/$productId', '@acme/products'], + ['@acme/products:', '@acme/products'], + ['account:/settings', 'account'], + ['/posts', undefined], + ['/a:b', undefined], + [':/x', undefined], + ['__root__', undefined], + ['404', undefined], + ] as const + + test.each(cases)('%s -> %s', (routeId, moduleId) => { + expect(getRouteModuleId(routeId)).toBe(moduleId) + }) + + test.each(cases)( + 'the installed navigation scope agrees for %s', + (routeId, moduleId) => { + installRouteModules() + expect(routeModules?.navigationScope(routeId)).toEqual( + moduleId === undefined + ? undefined + : { from: undefined, _module: moduleId, _fromRoute: routeId }, + ) + }, + ) +}) + +describe('application route ids', () => { + // Application ids always start with `/`, even when a custom id or a path + // contains `:`, so route-bound APIs never treat them as module routes. + test('ids with ":" stay application routes', () => { + const rootRoute = new BaseRootRoute({}) + const customIdRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + id: 'foo:bar', + }) + const downloadRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: 'files/{$id}:download', + }) + createTestRouter({ + routeTree: rootRoute.addChildren([customIdRoute, downloadRoute]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + expect(customIdRoute.id).toBe('/foo:bar') + expect(downloadRoute.id).toBe('/files/{$id}:download') + for (const route of [customIdRoute, downloadRoute]) { + const { options } = route.redirect({ to: './x' } as any) as any + expect(options.from).toBe(route.fullPath) + expect(options._module).toBeUndefined() + } + }) +}) + +describe('module-local navigation', () => { + test('absolute destinations resolve inside the module', () => { + const { router } = setup() + + expect( + router.buildLocation({ + _module: '@acme/products', + to: '/$productId', + params: { productId: '42' }, + } as any).pathname, + ).toBe('/shop/products/42') + expect( + router.buildLocation({ _module: '@acme/products', to: '/' } as any) + .pathname, + ).toBe('/shop/products') + expect( + router.buildLocation({ + _module: '@acme/products', + to: '/reviews', + } as any).pathname, + ).toBe('/shop/products/reviews') + }) + + test('application destinations are unchanged', () => { + const { router } = setup() + + expect(router.buildLocation({ to: '/shop' } as any).pathname).toBe('/shop') + }) + + test('a module-local from resolves relative destinations', () => { + const { router } = setup('/shop/products/42') + + expect( + router.buildLocation({ + _module: '@acme/products', + from: '/$productId', + to: '..', + } as any).pathname, + ).toBe('/shop/products') + }) + + test('_fromRoute resolves from the route full path unless from is given', () => { + const { router } = setup('/shop/products/42') + + expect( + router.buildLocation({ + _module: '@acme/products', + _fromRoute: '@acme/products:/$productId', + to: './', + params: { productId: '7' }, + } as any).pathname, + ).toBe('/shop/products/7') + expect( + router.buildLocation({ + _module: '@acme/products', + _fromRoute: '@acme/products:/$productId', + from: '/reviews', + to: '..', + } as any).pathname, + ).toBe('/shop/products') + }) + + test('masks are module-local too', () => { + const { router } = setup() + + const location = router.buildLocation({ + _module: '@acme/products', + to: '/$productId', + params: { productId: '42' }, + mask: { to: '/' }, + } as any) + expect(location.pathname).toBe('/shop/products/42') + expect(location.maskedLocation?.pathname).toBe('/shop/products') + }) + + test('a mask is built in the scope of its destination', () => { + const { router } = setup() + + expect(() => + router.buildLocation({ + to: '/shop', + mask: { _module: '@acme/products', to: '/$productId' }, + } as any), + ).toThrow( + 'The mask of an application destination cannot come from route module "@acme/products". Build the destination and its mask in the same scope.', + ) + expect(() => + router.buildLocation({ + _module: '@acme/products', + to: '/', + mask: { _module: '@acme/other', to: '/' }, + } as any), + ).toThrow( + 'Cannot use route scope "@acme/other" options in route scope "@acme/products".', + ) + }) + + test('navigating to a module that is not installed fails', () => { + const { router } = setup() + + expect(() => + router.buildLocation({ _module: '@acme/unknown', to: '/' } as any), + ).toThrow(/@acme\/unknown/) + }) + + test('the scoped router view navigates in module coordinates', async () => { + const { router } = setup() + await router.load() + const view = getScopedRouterView(router, '@acme/products') + + expect(getScopedRouterView(router, '@acme/products')).toBe(view) + expect(view.state.location.pathname).toBe('/') + + await view.navigate({ + to: '/$productId', + params: { productId: '3' }, + } as any) + expect(router.state.location.pathname).toBe('/shop/products/3') + expect(view.buildLocation({ to: '/' } as any).pathname).toBe( + '/shop/products', + ) + }) +}) + +describe('module-local redirects', () => { + test('the scoped redirect resolves inside the module', async () => { + const { router, reviewsRoute } = setup('/shop/products/reviews') + const redirect = createScopedRedirect('@acme/products') + reviewsRoute.update({ + beforeLoad: () => { + throw redirect({ to: '/$productId', params: { productId: '9' } } as any) + }, + } as any) + + await router.load() + expect(router.state.location.pathname).toBe('/shop/products/9') + }) + + test('Route.redirect resolves absolute and relative destinations', async () => { + const { router, productRoute, reviewsRoute } = setup( + '/shop/products/reviews', + ) + reviewsRoute.update({ + beforeLoad: () => { + throw reviewsRoute.redirect({ to: '/' } as any) + }, + } as any) + await router.load() + expect(router.state.location.pathname).toBe('/shop/products') + + productRoute.update({ + beforeLoad: ({ params }: any) => { + if (params.productId === 'old') { + throw productRoute.redirect({ + to: '.', + params: { productId: 'new' }, + } as any) + } + }, + } as any) + await router.navigate({ to: '/shop/products/old' } as any) + expect(router.state.location.pathname).toBe('/shop/products/new') + }) +}) + +describe('module navigation paths', () => { + test('the scoped view preloads module routes', async () => { + const { router } = setup() + await router.load() + const view = getScopedRouterView(router, '@acme/products') + + const matches = await view.preloadRoute({ + to: '/$productId', + params: { productId: '9' }, + } as any) + expect(matches?.map((match) => match.routeId).at(-1)).toBe( + '@acme/products:/$productId', + ) + expect(matches?.at(-1)?.params).toEqual({ productId: '9' }) + }) + + test('matchRoute of the scoped view takes module-local paths', async () => { + const { router } = setup('/shop/products/3') + await router.load() + const view = getScopedRouterView(router, '@acme/products') + + expect(view.matchRoute({ to: '/$productId' } as any)).toEqual({ + productId: '3', + }) + expect(router.matchRoute({ to: '/$productId' } as any)).toBe(false) + }) + + test('a scoped redirect resolves to the final path without changing it', () => { + const { router } = setup() + const thrown = createScopedRedirect('@acme/products')({ + to: '/$productId', + params: { productId: '9' }, + } as any) + + const resolved = router.resolveRedirect(thrown) + expect(resolved.options.href).toBe('/shop/products/9') + expect(thrown.options.to).toBe('/$productId') + }) + + test('route masks apply to module destinations', () => { + const { router } = setup('/', { + routeMasks: [{ from: '/shop/products/$productId', to: '/shop' }], + }) + + const location = router.buildLocation({ + _module: '@acme/products', + to: '/$productId', + params: { productId: '42' }, + } as any) + expect(location.pathname).toBe('/shop/products/42') + expect(location.maskedLocation?.pathname).toBe('/shop') + }) + + test('routers in one process navigate to their own mount of a module', () => { + const { router } = setup() + const rootRoute = new BaseRootRoute({}) + const productsRoot = createModuleRoot('@acme/products') + productsRoot.addChildren([ + new BaseRoute({ + getParentRoute: () => productsRoot, + path: '/$productId', + }), + ]) + mountRouteModule(productsRoot, { + parent: () => rootRoute as AnyRoute, + at: '/catalog', + } as any) + const other = createTestRouter({ + routeTree: rootRoute.addChildren([productsRoot]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + const build = (target: typeof router | typeof other) => + target.buildLocation({ + _module: '@acme/products', + to: '/$productId', + params: { productId: '42' }, + } as any).pathname + expect(build(router)).toBe('/shop/products/42') + expect(build(other)).toBe('/catalog/42') + }) +}) + +/** + * root + * ├── / + * └── /orgs/$orgId + * └── @acme/settings (module root, mounted at /settings) + * ├── / + * ├── /profile + * └── /members/$memberId + */ +function setupUnderParams(initialEntry = '/') { + const rootRoute = new BaseRootRoute({}) + const indexRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/', + }) + const orgRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/orgs/$orgId', + }) + const settingsRoot = createModuleRoot('@acme/settings') + settingsRoot.addChildren([ + new BaseRoute({ getParentRoute: () => settingsRoot, path: '/' }), + new BaseRoute({ getParentRoute: () => settingsRoot, path: '/profile' }), + new BaseRoute({ + getParentRoute: () => settingsRoot, + path: '/members/$memberId', + }), + ]) + mountRouteModule(settingsRoot, { + parent: () => orgRoute as AnyRoute, + at: '/settings', + } as any) + const routeTree = rootRoute.addChildren([ + indexRoute, + orgRoute.addChildren([settingsRoot]), + ]) + const router = createTestRouter({ + routeTree, + history: createMemoryHistory({ initialEntries: [initialEntry] }), + }) + return { router } +} + +describe('a module mounted under path params', () => { + test('module routes match with the host params', () => { + const { router } = setupUnderParams() + + const matches = router.matchRoutes('/orgs/7/settings/members/3', {}) + const leaf = matches[matches.length - 1]! + expect(leaf.routeId).toBe('@acme/settings:/members/$memberId') + expect(leaf.params).toEqual({ orgId: '7', memberId: '3' }) + }) + + test('module-local destinations keep the host params of the location', async () => { + const { router } = setupUnderParams('/orgs/7/settings') + await router.load() + + expect( + router.buildLocation({ _module: '@acme/settings', to: '/profile' } as any) + .pathname, + ).toBe('/orgs/7/settings/profile') + expect( + router.buildLocation({ + _module: '@acme/settings', + to: '/members/$memberId', + params: { memberId: '3' }, + } as any).pathname, + ).toBe('/orgs/7/settings/members/3') + }) + + test('destinations from outside the installation pass the host params', async () => { + const { router } = setupUnderParams('/') + await router.load() + + expect( + router.buildLocation({ + _module: '@acme/settings', + to: '/members/$memberId', + params: { orgId: '9', memberId: '3' }, + } as any).pathname, + ).toBe('/orgs/9/settings/members/3') + }) +}) + +/** + * root + * ├── /orgs/$orgId + * │ ├── @acme/settings#orgSettings (mounted at /settings) + * │ └── @acme/billing (mounted at /billing, uses orgSettings) + * └── /users/$userId + * └── @acme/settings#userSettings (mounted at /settings) + * + * @acme/settings: /, /profile, /members/$memberId + */ +function setupInstallations( + initialEntry = '/', + settingsOptions: { + members?: object + root?: object + } = {}, + routerOptions: object = {}, +) { + const rootRoute = new BaseRootRoute({}) + const orgRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/orgs/$orgId', + }) + const userRoute = new BaseRoute({ + getParentRoute: () => rootRoute, + path: '/users/$userId', + }) + + const settingsRoot = createModuleRoot('@acme/settings', settingsOptions.root) + const settingsIndex = new BaseRoute({ + getParentRoute: () => settingsRoot, + path: '/', + }) + const profileRoute = new BaseRoute({ + getParentRoute: () => settingsRoot, + path: '/profile', + loader: () => 'profile', + }) + const membersRoute = new BaseRoute({ + getParentRoute: () => settingsRoot, + path: '/members/$memberId', + ...settingsOptions.members, + }) + settingsRoot.addChildren([settingsIndex, profileRoute, membersRoute]) + + const billingRoot = createModuleRoot('@acme/billing') + billingRoot.addChildren([ + new BaseRoute({ getParentRoute: () => billingRoot, path: '/' }), + ]) + + const orgSettings = mountRouteModule(settingsRoot, { + parent: () => orgRoute as AnyRoute, + at: '/settings', + as: 'orgSettings', + } as any) + const userSettings = mountRouteModule(settingsRoot, { + parent: () => userRoute as AnyRoute, + at: '/settings', + as: 'userSettings', + } as any) + mountRouteModule(billingRoot, { + parent: () => orgRoute as AnyRoute, + at: '/billing', + uses: { '@acme/settings': '@acme/settings#orgSettings' }, + } as any) + + const routeTree = rootRoute.addChildren([ + orgRoute.addChildren([orgSettings, billingRoot]), + userRoute.addChildren([userSettings]), + ]) + const router = createTestRouter({ + routeTree, + history: createMemoryHistory({ initialEntries: [initialEntry] }), + ...routerOptions, + }) + return { router, settingsRoot, profileRoute, membersRoute } +} + +describe('a module installed several times', () => { + test('each installation has its own routes', () => { + const { router } = setupInstallations() + + expect( + Object.fromEntries( + Object.values(router.routesById) + .filter((route: AnyRoute) => route.id.startsWith('@acme/settings')) + .map((route: AnyRoute) => [route.id, route.fullPath]), + ), + ).toEqual({ + '@acme/settings#orgSettings:': '/orgs/$orgId/settings', + '@acme/settings#orgSettings:/': '/orgs/$orgId/settings/', + '@acme/settings#orgSettings:/profile': '/orgs/$orgId/settings/profile', + '@acme/settings#orgSettings:/members/$memberId': + '/orgs/$orgId/settings/members/$memberId', + '@acme/settings#userSettings:': '/users/$userId/settings', + '@acme/settings#userSettings:/': '/users/$userId/settings/', + '@acme/settings#userSettings:/profile': '/users/$userId/settings/profile', + '@acme/settings#userSettings:/members/$memberId': + '/users/$userId/settings/members/$memberId', + }) + expect( + router.matchRoutes('/users/u1/settings/profile').map((m) => m.routeId), + ).toEqual([ + '__root__', + '/users/$userId', + '@acme/settings#userSettings:', + '@acme/settings#userSettings:/profile', + ]) + }) + + test('a module is installed once or several times under names, not both', () => { + const host = new BaseRootRoute({}) + const moduleRoot = () => { + const root = createModuleRoot('@acme/settings') + root.addChildren([ + new BaseRoute({ getParentRoute: () => root, path: '/' }), + ]) + return root + } + const mount = (root: AnyRoute, at: string, as?: string) => + mountRouteModule(root, { parent: () => host as AnyRoute, at, as } as any) + + const unnamedFirst = moduleRoot() + mount(unnamedFirst, '/a') + expect(() => mount(unnamedFirst, '/b', 'second')).toThrow( + 'Route module "@acme/settings" is installed several times. Name every installation with "as".', + ) + const namedFirst = moduleRoot() + mount(namedFirst, '/a', 'first') + expect(() => mount(namedFirst, '/b')).toThrow('installed several times') + // Mounting the same installation again, as hot updates do, is allowed. + expect(() => mount(unnamedFirst, '/a')).not.toThrow() + }) + + test("the module's routes stay templates with module-local ids and paths", () => { + const { router, settingsRoot, profileRoute } = setupInstallations() + + expect([settingsRoot.id, settingsRoot.fullPath]).toEqual([ + '@acme/settings:', + '/', + ]) + expect([profileRoute.id, profileRoute.fullPath]).toEqual([ + '@acme/settings:/profile', + '/profile', + ]) + const copy = router.routesById['@acme/settings#orgSettings:/profile'] + expect(copy).not.toBe(profileRoute) + expect(copy!.options.loader).toBe(profileRoute.options.loader) + expect(router.routesById['@acme/settings:/profile']).toBeUndefined() + }) + + test('module ids resolve to the installation of the nearest match', () => { + const { router } = setupInstallations() + + expect( + routeModules!.resolveRouteId( + router, + '@acme/settings:/profile', + '@acme/settings#userSettings:/', + ), + ).toBe('@acme/settings#userSettings:/profile') + expect( + routeModules!.resolveRouteId( + router, + '@acme/settings:/profile', + '@acme/billing:/', + ), + ).toBe('@acme/settings#orgSettings:/profile') + expect( + routeModules!.resolveRouteId( + router, + '@acme/settings:/profile', + '/orgs/$orgId', + ), + ).toBe('@acme/settings:/profile') + expect( + routeModules!.resolveRouteId(router, '/orgs/$orgId', '@acme/billing:/'), + ).toBe('/orgs/$orgId') + }) + + test('module-local destinations stay in the installation of the caller', async () => { + const { router } = setupInstallations('/users/u1/settings/profile') + await router.load() + + const build = (options: object) => + router.buildLocation({ _module: '@acme/settings', ...options } as any) + .pathname + expect( + build({ to: '/profile', _nearestRoute: '@acme/settings#userSettings:/' }), + ).toBe('/users/u1/settings/profile') + // Route-bound APIs resolve from their route in the caller's installation. + expect( + build({ + to: '.', + params: { memberId: '4' }, + _fromRoute: '@acme/settings:/members/$memberId', + _nearestRoute: '@acme/settings#userSettings:/members/$memberId', + }), + ).toBe('/users/u1/settings/members/4') + }) + + test('a module that uses the module links to the installation it uses', async () => { + const { router } = setupInstallations('/orgs/7/billing') + await router.load() + + expect( + router.buildLocation({ + _module: '@acme/settings', + to: '/profile', + _nearestRoute: '@acme/billing:/', + } as any).pathname, + ).toBe('/orgs/7/settings/profile') + }) + + test('code outside the module addresses one installation', async () => { + const { router } = setupInstallations('/') + await router.load() + + expect( + router.buildLocation({ + _module: '@acme/settings#userSettings', + to: '/profile', + params: { userId: 'u2' }, + } as any).pathname, + ).toBe('/users/u2/settings/profile') + expect(() => + router.buildLocation({ + _module: '@acme/settings', + to: '/profile', + } as any), + ).toThrow( + 'Route module "@acme/settings" is installed several times in this router (as "orgSettings", "userSettings"). Address one installation through its namespace.', + ) + }) + + test('a single named installation is named when addressed by module id', () => { + const rootRoute = new BaseRootRoute({}) + const settingsRoot = createModuleRoot('@acme/settings') + settingsRoot.addChildren([ + new BaseRoute({ getParentRoute: () => settingsRoot, path: '/profile' }), + ]) + const only = mountRouteModule(settingsRoot, { + parent: () => rootRoute as AnyRoute, + at: '/settings', + as: 'only', + } as any) + const router = createTestRouter({ + routeTree: rootRoute.addChildren([only]), + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + + expect( + router.buildLocation({ + _module: '@acme/settings#only', + to: '/profile', + } as any).pathname, + ).toBe('/settings/profile') + expect(() => + router.buildLocation({ + _module: '@acme/settings', + to: '/profile', + } as any), + ).toThrow( + 'Route module "@acme/settings" is installed as "only" in this router. Address it through its namespace.', + ) + }) + + test('redirects resolve in the installation of the route that threw', async () => { + const redirect = createScopedRedirect('@acme/settings') + const { router } = setupInstallations('/users/u1/settings/members/3', { + members: { + beforeLoad: () => { + throw redirect({ to: '/profile' } as any) + }, + }, + }) + + await router.load() + expect(router.state.location.pathname).toBe('/users/u1/settings/profile') + + await router.navigate({ to: '/orgs/7/settings/members/3' } as any) + expect(router.state.location.pathname).toBe('/orgs/7/settings/profile') + }) + + test('not-found errors target the installation of the route that threw', async () => { + const { router } = setupInstallations('/orgs/7/settings/members/3', { + root: { notFoundComponent: () => null }, + members: { + loader: () => { + throw notFound({ routeId: '@acme/settings:' as never }) + }, + }, + }) + + await router.load() + expect( + router.state.matches.find((match) => match.status === 'notFound') + ?.routeId, + ).toBe('@acme/settings#orgSettings:') + }) + + test('not-found errors with an application route id ignore installations', async () => { + const { router } = setupInstallations('/users/u1/settings/members/3', { + members: { + loader: () => { + throw notFound({ routeId: '/users/$userId' as never }) + }, + }, + }) + + await router.load() + expect( + router.state.matches.find((match) => match.status === 'notFound') + ?.routeId, + ).toBe('/users/$userId') + }) + + test.each([ + ['/users/u1/settings/members/3', '/users/u1/settings/profile'], + ['/orgs/7/settings/members/3', '/orgs/7/settings/profile'], + ])( + 'server redirects from %s resolve in its installation', + async (path, location) => { + const redirect = createScopedRedirect('@acme/settings') + const { router } = setupInstallations( + '/', + { + members: { + loader: () => { + throw redirect({ to: '/profile' } as any) + }, + }, + }, + { isServer: true }, + ) + + const response = await loadServerResponse(router, path) + expect(response.status).toBe(307) + expect(response.headers.get('Location')).toBe(location) + }, + ) + + test('server not-found errors target the installation of the route that threw', async () => { + const { router } = setupInstallations( + '/', + { + root: { notFoundComponent: () => null }, + members: { + beforeLoad: () => { + throw notFound({ routeId: '@acme/settings:' as never }) + }, + }, + }, + { isServer: true }, + ) + + const response = await loadServerResponse( + router, + '/users/u1/settings/members/3', + ) + expect(response.status).toBe(404) + expect( + router.state.matches.find((match) => match.status === 'notFound') + ?.routeId, + ).toBe('@acme/settings#userSettings:') + }) +}) diff --git a/packages/router-core/tests/route-modules.bench.ts b/packages/router-core/tests/route-modules.bench.ts new file mode 100644 index 0000000000..7744d8343d --- /dev/null +++ b/packages/router-core/tests/route-modules.bench.ts @@ -0,0 +1,342 @@ +import { createRequire } from 'node:module' +import { describe, expect, test } from 'vitest' +import type { AnyRoute, AnyRouter, GetStoreConfig } from '../src' + +// Keep this file identical in baseline/candidate checkouts. Nx must build each +// revision first. Native modules avoid Vitest's instrumented export getters +// inside the timed routing code. The build paths also predate _internal exports. +const require = createRequire(import.meta.url) +const { + BaseRootRoute, + BaseRoute, + RouterCore, + createNonReactiveMutableStore, + createNonReactiveReadonlyStore, +} = require('../dist/cjs/index.cjs') as typeof import('../src') +const moduleWiring = + require('../dist/cjs/route-module.cjs') as typeof import('../src/route-module') +const { createMemoryHistory } = + require('@tanstack/history') as typeof import('@tanstack/history') + +const getStoreConfig: GetStoreConfig = () => ({ + createMutableStore: createNonReactiveMutableStore, + createReadonlyStore: createNonReactiveReadonlyStore, + batch: (fn) => fn(), +}) + +const BATCH = 64 +const MODULE = '@bench/catalog' + +type LocationOptions = { + to: string + params: Record + _module?: string + _nearestRoute?: string +} + +function createModuleTree() { + // This is the core half of generated createModuleRoot: the namespace enters + // through construction options, never by mutating initialized route metadata. + const root = new BaseRoute({ _module: MODULE } as any) as AnyRoute + return root.addChildren([ + new BaseRoute({ getParentRoute: () => root, path: '/$itemId' }), + ]) as AnyRoute +} + +function createRouter(kind: 'ordinary' | 'singleton' | 'repeated') { + const root = new BaseRootRoute({}) + const org = new BaseRoute({ + getParentRoute: () => root, + path: '/orgs/$orgId', + }) + const user = new BaseRoute({ + getParentRoute: () => root, + path: '/users/$userId', + }) + let children: Array + if (kind === 'ordinary') { + children = [ + org.addChildren([ + new BaseRoute({ getParentRoute: () => org, path: '/catalog/$itemId' }), + ]), + ] + } else { + const module = createModuleTree() + const orgCatalog = moduleWiring.mountRouteModule(module, { + parent: () => org, + at: '/catalog', + ...(kind === 'repeated' ? { as: 'orgCatalog' } : {}), + } as any) + children = [org.addChildren([orgCatalog])] + if (kind === 'repeated') { + children.push( + user.addChildren([ + moduleWiring.mountRouteModule(module, { + parent: () => user, + at: '/catalog', + as: 'userCatalog', + } as any), + ]), + ) + } + } + const history = createMemoryHistory({ + initialEntries: ['/orgs/acme/catalog/0'], + }) + const router = new RouterCore( + { + routeTree: root.addChildren(children), + history, + scrollRestoration: false, + isServer: true, + }, + getStoreConfig, + ) + history.destroy() + return router +} + +const ordinary = createRouter('ordinary') +const singleton = createRouter('singleton') +const repeated = createRouter('repeated') +const orgView = moduleWiring.getScopedRouterView( + repeated, + `${MODULE}#orgCatalog`, +) +const userView = moduleWiring.getScopedRouterView( + repeated, + `${MODULE}#userCatalog`, +) + +const ordinaryOptions: Array = Array.from( + { length: BATCH }, + (_, index) => ({ + to: '/orgs/$orgId/catalog/$itemId', + params: { orgId: 'acme', itemId: String(index) }, + }), +) +const singletonOptions = ordinaryOptions.map((options) => ({ + ...options, + to: '/$itemId', + _module: MODULE, +})) +const repeatedOptions = singletonOptions.map((options, index) => ({ + ...options, + params: { orgId: 'acme', userId: 'alex', itemId: String(index) }, + _nearestRoute: `${MODULE}#${index % 2 ? 'userCatalog' : 'orgCatalog'}:/$itemId`, +})) +const reusableOptions = repeatedOptions.map((options, index) => ({ + ...options, + _module: `${MODULE}#${index % 2 ? 'userCatalog' : 'orgCatalog'}`, +})) + +// Use the same factories that back generated redirect exports on both +// revisions. The nested call creates the candidate's deferred constraint; +// no private constraint object is constructed or injected by the benchmark. +const moduleRedirect = moduleWiring.createScopedRedirect(MODULE) +const installationRedirects = [ + moduleWiring.createScopedRedirect(`${MODULE}#orgCatalog`), + moduleWiring.createScopedRedirect(`${MODULE}#userCatalog`), +] +const deferredRedirectOptions = repeatedOptions.map( + (options, index) => + moduleRedirect( + installationRedirects[index % 2]!({ + to: '/$itemId', + params: options.params, + } as any).options as any, + ).options, +) + +// Route.redirect supplies its authored origin itself. Resolve these actual +// redirect options through buildLocation, as a router does for navigation. +const routeBoundRedirectOptions = repeatedOptions.map((options, index) => { + const installation = index % 2 ? 'userCatalog' : 'orgCatalog' + const route = repeated.routesById[ + `${MODULE}#${installation}:/$itemId` + ] as AnyRoute + return route.redirect({ to: '.', params: options.params } as any).options +}) + +const orgHref = (index: number) => `/orgs/acme/catalog/${index}` +const repeatedHref = (index: number) => + index % 2 ? `/users/alex/catalog/${index}` : orgHref(index) + +function defineCase( + name: string, + operation: (index: number) => string, + expected: (index: number) => string, +) { + let expectedChecksum = 0 + for (let index = 0; index < BATCH; index++) { + expect(operation(index)).toBe(expected(index)) + expectedChecksum += expected(index).length + } + let checksum = 0 + test(name, async ({ bench }) => { + await bench( + name, + { + afterAll: () => { + expect(checksum).toBe(expectedChecksum) + }, + }, + () => { + checksum = 0 + for (let index = 0; index < BATCH; index++) { + checksum += operation(index).length + } + }, + ).run({ time: 1500, warmupTime: 500, throws: true }) + }) +} + +// This accepted bug fix deliberately differs from the baseline. Validate it +// outside timing when that implementation is present; all measured operations +// below are identical valid public API workloads on both revisions. +if ('bindRouteScopeOptions' in moduleWiring) { + expect(() => orgView.buildLocation(reusableOptions[1] as any)).toThrow() +} + +const build = (router: Pick, options: object) => + router.buildLocation(options as any).href + +describe(`route-module location resolution (${BATCH} calls)`, () => { + defineCase( + 'ordinary application destinations', + (index) => build(ordinary, ordinaryOptions[index]!), + orgHref, + ) + defineCase( + 'singleton module-local destinations', + (index) => build(singleton, singletonOptions[index]!), + orgHref, + ) + defineCase( + 'repeated module-local destinations from alternating callers', + (index) => build(repeated, repeatedOptions[index]!), + repeatedHref, + ) + defineCase( + 'same-scope reusable options through explicit router views', + (index) => build(index % 2 ? userView : orgView, reusableOptions[index]!), + repeatedHref, + ) + defineCase( + 'deferred redirect scope constraints through explicit router views', + (index) => + build(index % 2 ? userView : orgView, deferredRedirectOptions[index]!), + repeatedHref, + ) + defineCase( + 'route-bound redirect origin rebinding', + (index) => build(repeated, routeBoundRedirectOptions[index]!), + repeatedHref, + ) + defineCase( + 'mixed ordinary, singleton, repeated, and reusable destinations', + (index) => { + switch (index % 4) { + case 0: + return build(ordinary, ordinaryOptions[index]!) + case 1: + return build(singleton, singletonOptions[index]!) + case 2: + return build(repeated, repeatedOptions[index]!) + default: + return build(userView, reusableOptions[index]!) + } + }, + (index) => (index % 4 === 3 ? repeatedHref(index) : orgHref(index)), + ) + defineCase( + 'mixed application, scoped, deferred, and route-bound destinations', + (index) => { + switch (index % 6) { + case 0: + return build(ordinary, ordinaryOptions[index]!) + case 1: + return build(singleton, singletonOptions[index]!) + case 2: + return build(repeated, repeatedOptions[index]!) + case 3: + return build(userView, reusableOptions[index]!) + case 4: + return build(orgView, deferredRedirectOptions[index]!) + default: + return build(repeated, routeBoundRedirectOptions[index]!) + } + }, + (index) => (index % 6 >= 2 ? repeatedHref(index) : orgHref(index)), + ) +}) + +describe(`route-module match construction (${BATCH} calls)`, () => { + defineCase( + 'ordinary application matches', + (index) => ordinary.matchRoutes(orgHref(index)).at(-1)!.routeId, + () => '/orgs/$orgId/catalog/$itemId', + ) + defineCase( + 'repeated installation matches', + (index) => repeated.matchRoutes(repeatedHref(index)).at(-1)!.routeId, + (index) => `${MODULE}#${index % 2 ? 'userCatalog' : 'orgCatalog'}:/$itemId`, + ) +}) + +// These focused cases compare the accepted implementation with an optional +// optimization. The original baseline has no binder, so retain the ten shared +// workloads above and omit this group there. +if ('bindRouteScopeOptions' in moduleWiring) { + const bind = moduleWiring.bindRouteScopeOptions as ( + moduleId: string, + options: object, + router: AnyRouter, + nearestRouteId: string, + ) => { _module: unknown } + const installation = (index: number) => + `${MODULE}#${index % 2 ? 'userCatalog' : 'orgCatalog'}` + // Resolve callers from actual matches, as the framework bindings do. Keep + // match construction outside timing to isolate the binding operation. + const nearestRouteIds = Array.from({ length: BATCH }, (_, index) => { + const routeId = repeated.matchRoutes(repeatedHref(index)).at(-1)!.routeId + expect(routeId).toBe(`${installation(index)}:/$itemId`) + return routeId + }) + const localOptions = repeatedOptions.map(({ params }) => ({ + to: '/$itemId', + params, + })) + const installedRedirectOptions = localOptions.map( + (options, index) => + installationRedirects[index % 2]!(options as any).options, + ) + const bindScope = (moduleId: string, options: object, index: number) => + bind(moduleId, options, repeated, nearestRouteIds[index]!)._module as string + + describe(`route-module scope binding (${BATCH} calls, candidate only)`, () => { + // defineCase asserts each concrete returned installation before timing, + // then checksums the same returned value during every timed batch. + defineCase( + 'deferred redirect constraints through module receivers', + (index) => bindScope(MODULE, deferredRedirectOptions[index]!, index), + installation, + ) + defineCase( + 'deferred redirect constraints through named receivers', + (index) => + bindScope(installation(index), deferredRedirectOptions[index]!, index), + installation, + ) + defineCase( + 'installed redirect options through module receivers', + (index) => bindScope(MODULE, installedRedirectOptions[index]!, index), + installation, + ) + defineCase( + 'module-local options through module receivers', + (index) => bindScope(MODULE, localOptions[index]!, index), + () => MODULE, + ) + }) +} diff --git a/packages/router-core/vite.config.ts b/packages/router-core/vite.config.ts index 97859dda97..a76be3c7de 100644 --- a/packages/router-core/vite.config.ts +++ b/packages/router-core/vite.config.ts @@ -42,6 +42,8 @@ export default mergeConfig( tanstackViteConfig({ entry: [ './src/index.ts', + './src/route-module-internal.ts', + './src/extensions.ts', './src/ssr/client.ts', './src/ssr/server.ts', './src/scroll-restoration-script/client.ts', diff --git a/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx b/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx index 7efcaffca2..5646f4bac7 100644 --- a/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx +++ b/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.tsx @@ -7,6 +7,7 @@ import { rootRouteId, trimPath, } from '@tanstack/router-core' +import { getRouteModuleId } from '@tanstack/router-core/_internal/route-module' import { For, Match, @@ -27,6 +28,14 @@ import { AgeTicker } from './AgeTicker' // import type { DevtoolsPanelOptions } from './TanStackRouterDevtoolsPanel' import { NavigateButton } from './NavigateButton' +import { + getModuleIds, + getModuleLocalPath, + getModuleRoot, + getModuleRootId, + getModuleRoutes, + getParentModuleId, +} from './routeModules' import type { AnyContext, AnyRoute, @@ -106,6 +115,33 @@ function NavigateLink(props: { ) } +/** How the panel shows route modules: collapsed groups and module details. */ +interface ModuleControls { + isCollapsed: (moduleId: string) => boolean + toggle: (moduleId: string) => void + open: (moduleId: string) => void +} + +function ModuleBadge(props: { + moduleId: string + open: (moduleId: string) => void +}) { + const styles = useStyles() + return ( + + ) +} + function RouteComp({ routerState, pendingMatches, @@ -114,6 +150,7 @@ function RouteComp({ isRoot, activeId, setActiveId, + modules, }: { routerState: Accessor< RouterState< @@ -146,8 +183,13 @@ function RouteComp({ isRoot?: boolean activeId: Accessor setActiveId: (id: string) => void + modules: ModuleControls }) { const styles = useStyles() + // A route module's root heads a collapsible group of the module's routes. + const moduleId = getModuleRootId(route) + const collapsed = () => + moduleId !== undefined && modules.isCollapsed(moduleId) const matches = createMemo(() => pendingMatches().length ? pendingMatches() : routerState().matches, ) @@ -197,7 +239,12 @@ function RouteComp({ }) return ( -
+
} > + + {(id) => ( + + )} + {isRoot ? rootRouteId : route.path || trimPath(route.id)}{' '} {param()} + + {(id) => } +
- {route.children?.length ? ( -
+ {route.children?.length && !collapsed() ? ( +
{[...(route.children as Array)] .sort((a, b) => { return a.rank - b.rank @@ -244,6 +315,7 @@ function RouteComp({ route={r} activeId={activeId} setActiveId={setActiveId} + modules={modules} /> ))}
@@ -281,6 +353,46 @@ export const BaseTanStackRouterDevtoolsPanel = '', ) + // Route modules: collapsed groups, the module shown in the details pane, + // and the module the route tree is narrowed to. + const [collapsedModules, setCollapsedModules] = useLocalStorage< + Array + >('tanstackRouterDevtoolsCollapsedModules', []) + const [activeModuleId, setActiveModuleId] = useLocalStorage( + 'tanstackRouterDevtoolsActiveModuleId', + '', + ) + const [moduleFilter, setModuleFilter] = createSignal('') + const moduleIds = createMemo(() => getModuleIds(router())) + const selectMatch = (id: string) => { + setActiveModuleId('') + setActiveId(id) + } + const modules: ModuleControls = { + isCollapsed: (moduleId) => (collapsedModules() ?? []).includes(moduleId), + toggle: (moduleId) => + setCollapsedModules((previous = []) => + previous.includes(moduleId) + ? previous.filter((id) => id !== moduleId) + : [...previous, moduleId], + ), + open: (moduleId) => { + setActiveId('') + setActiveModuleId(moduleId) + }, + } + const activeModule = createMemo(() => { + const moduleId = activeModuleId() + return moduleId && getModuleRoot(router(), moduleId) + ? moduleId + : undefined + }) + const routeTreeRoot = createMemo( + () => + (moduleFilter() && getModuleRoot(router(), moduleFilter())) || + router().routeTree, + ) + const [history, setHistory] = createSignal>([]) const [hasHistoryOverflowed, setHasHistoryOverflowed] = createSignal(false) @@ -397,6 +509,12 @@ export const BaseTanStackRouterDevtoolsPanel = ), ), ) + const activeMatchModuleRoute = createMemo(() => { + const routeId = activeMatch()?.routeId + return routeId !== undefined && getRouteModuleId(routeId) !== undefined + ? (router().routesById[routeId] as AnyRoute | undefined) + : undefined + }) const activeMatchLoaderData = createMemo(() => activeMatch()?.loaderData) const activeMatchValue = createMemo(() => activeMatch()) const locationSearchValue = createMemo(() => routerState().location.search) @@ -544,15 +662,36 @@ export const BaseTanStackRouterDevtoolsPanel =
- + +
+ +
+
+ + {(route) => ( + + )} +
@@ -565,7 +704,7 @@ export const BaseTanStackRouterDevtoolsPanel = role="button" aria-label={`Open match details for ${match.id}`} onClick={() => - setActiveId(activeId() === match.id ? '' : match.id) + selectMatch(activeId() === match.id ? '' : match.id) } class={cx(styles().matchRow(match === activeMatch()))} > @@ -588,6 +727,14 @@ export const BaseTanStackRouterDevtoolsPanel = {`${match.routeId === rootRouteId ? rootRouteId : match.pathname}`} + + {(moduleId) => ( + + )} +
) @@ -658,7 +805,7 @@ export const BaseTanStackRouterDevtoolsPanel = role="button" aria-label={`Open match details for ${match.id}`} onClick={() => - setActiveId(activeId() === match.id ? '' : match.id) + selectMatch(activeId() === match.id ? '' : match.id) } class={cx(styles().matchRow(match === activeMatch()))} > @@ -687,7 +834,15 @@ export const BaseTanStackRouterDevtoolsPanel =
) : null}
- {activeMatch() && activeMatch()?.status ? ( + {activeModule() ? ( + + ) : activeMatch() && activeMatch()?.status ? (
Match Details
@@ -711,6 +866,33 @@ export const BaseTanStackRouterDevtoolsPanel = {activeMatch()?.id}
+ + {(route) => ( + <> +
+
Module:
+
+ +
+
+
+
Local path:
+
+ {getModuleLocalPath(router(), route())} +
+
+
+
Path:
+
+ {route().fullPath} +
+
+ + )} +
State:
@@ -789,6 +971,82 @@ export const BaseTanStackRouterDevtoolsPanel = ) } +function ModuleDetails(props: { + moduleId: string + router: Accessor + routerState: Accessor + open: (moduleId: string) => void + selectMatch: (id: string) => void +}) { + const styles = useStyles() + const root = () => getModuleRoot(props.router(), props.moduleId)! + const parentModuleId = () => getParentModuleId(props.router(), props.moduleId) + const routes = () => getModuleRoutes(props.router(), props.moduleId) + const matches = createMemo(() => + (props.routerState().matches as Array).filter( + (match) => getRouteModuleId(match.routeId) === props.moduleId, + ), + ) + return ( +
+
Module Details
+
+
+
Module:
+
+ {props.moduleId} +
+
+
+
Mount path:
+
+ {root().fullPath} +
+
+
+
Parent module:
+
+ + {(id) => } + +
+
+
+
Routes (local / final path)
+ + {(route) => ( +
+ {getModuleLocalPath(props.router(), route)} + {route.fullPath} +
+ )} +
+
Active Matches
+ None
} + > + + {(match) => ( +
props.selectMatch(match.id)} + > + {match.pathname} +
+ )} +
+ +
+ ) +} + function CopyButton({ getValue }: { getValue: () => string }) { const [copied, setCopied] = createSignal(false) diff --git a/packages/router-devtools-core/src/routeModules.ts b/packages/router-devtools-core/src/routeModules.ts new file mode 100644 index 0000000000..eee8cb3535 --- /dev/null +++ b/packages/router-devtools-core/src/routeModules.ts @@ -0,0 +1,79 @@ +import { getRouteModuleId } from '@tanstack/router-core/_internal/route-module' +import type { AnyRoute, AnyRouter } from '@tanstack/router-core' + +/** The module id when `route` is the root route of a mounted route module. */ +export function getModuleRootId(route: AnyRoute): string | undefined { + const moduleId = getRouteModuleId(route.id) + return moduleId !== undefined && route.id === `${moduleId}:` + ? moduleId + : undefined +} + +export function getModuleRoot( + router: AnyRouter, + moduleId: string, +): AnyRoute | undefined { + return router.routesById[`${moduleId}:`] as AnyRoute | undefined +} + +/** The ids of the route modules mounted in the router, in tree order. */ +export function getModuleIds(router: AnyRouter): Array { + const ids: Array = [] + for (const route of Object.values(router.routesById) as Array) { + const moduleId = getModuleRootId(route) + if (moduleId !== undefined) { + ids.push(moduleId) + } + } + return ids +} + +/** The module that mounts `moduleId`, or `undefined` for the application. */ +export function getParentModuleId( + router: AnyRouter, + moduleId: string, +): string | undefined { + let route = getModuleRoot(router, moduleId)?.parentRoute as + | AnyRoute + | undefined + while (route) { + const parentModuleId = getRouteModuleId(route.id) + if (parentModuleId !== undefined) { + return parentModuleId + } + route = route.parentRoute as AnyRoute | undefined + } + return undefined +} + +/** + * The routes a module owns, without its root (shown as the mount path) and + * without the routes of modules it mounts. + */ +export function getModuleRoutes( + router: AnyRouter, + moduleId: string, +): Array { + return (Object.values(router.routesById) as Array).filter( + (route) => + route.id !== `${moduleId}:` && getRouteModuleId(route.id) === moduleId, + ) +} + +/** + * The path module code uses for a module route: its full path below the + * module root, wherever the module is mounted. + */ +export function getModuleLocalPath( + router: AnyRouter, + route: AnyRoute, +): string | undefined { + const moduleId = getRouteModuleId(route.id) + const root = + moduleId === undefined ? undefined : getModuleRoot(router, moduleId) + if (!root) { + return undefined + } + const base = root.fullPath.replace(/\/$/, '') + return route.fullPath.slice(base.length) || '/' +} diff --git a/packages/router-devtools-core/src/useStyles.tsx b/packages/router-devtools-core/src/useStyles.tsx index 32908c524d..e2478b9ffa 100644 --- a/packages/router-devtools-core/src/useStyles.tsx +++ b/packages/router-devtools-core/src/useStyles.tsx @@ -381,6 +381,54 @@ const stylesFactory = (shadowDOMTarget?: ShadowRoot) => { font-size: ${fontSize.xs}; line-height: ${lineHeight['xs']}; `, + moduleBadge: css` + background: ${colors.purple[900]}${alpha[70]}; + color: ${colors.purple[300]}; + display: inline-block; + padding: 0 ${tokens.size[1.5]}; + margin-left: ${size[1]}; + border-radius: ${border.radius.full}; + border: 1px solid ${colors.purple[400]}; + font-size: ${font.size.xs}; + line-height: ${lineHeight['xs']}; + white-space: nowrap; + cursor: pointer; + `, + moduleToggle: css` + background: none; + border: none; + padding: 0; + margin-right: ${size[1]}; + color: ${colors.gray[400]}; + font-size: ${font.size.xs}; + cursor: pointer; + `, + moduleChildren: css` + border-left-color: ${colors.purple[700]}; + `, + moduleFilter: css` + display: flex; + padding: ${size[1]} ${size[2]}; + border-bottom: 1px solid ${colors.darkGray[400]}; + & > select { + background: ${colors.darkGray[700]}; + color: ${colors.gray[300]}; + border: 1px solid ${colors.gray[700]}; + border-radius: ${border.radius.sm}; + font-size: ${font.size.xs}; + } + `, + moduleRouteRow: css` + display: flex; + justify-content: space-between; + gap: ${size[2]}; + padding: ${size[1]} ${size[2]}; + border-bottom: 1px solid ${colors.darkGray[400]}; + font-size: ${font.size.xs}; + & > code:last-child { + color: ${colors.gray[400]}; + } + `, nestedRouteRow: (isRoot: boolean) => { const base = css` margin-left: ${isRoot ? 0 : size[3.5]}; diff --git a/packages/router-devtools-core/tests/route-modules.test.ts b/packages/router-devtools-core/tests/route-modules.test.ts new file mode 100644 index 0000000000..9450d94f64 --- /dev/null +++ b/packages/router-devtools-core/tests/route-modules.test.ts @@ -0,0 +1,282 @@ +import { afterEach, beforeAll, expect, test, vi } from 'vitest' +import { + BaseRootRoute, + BaseRoute, + RouterCore, + createNonReactiveMutableStore, + createNonReactiveReadonlyStore, +} from '@tanstack/router-core' +import { mountRouteModule } from '@tanstack/router-core/_internal/route-module' +import { TanStackRouterDevtoolsPanelCore } from '../src/TanStackRouterDevtoolsPanelCore' +import type { AnyRoute } from '@tanstack/router-core' + +beforeAll(async () => { + // Browsers expose elements with an id as window properties, and goober + // finds its style sheet as `window._goober`. jsdom does not, so without + // this every style rule adds a style element and later tests slow down. + Object.defineProperty(window, '_goober', { + configurable: true, + get: () => document.getElementById('_goober'), + }) + await import('../src/BaseTanStackRouterDevtoolsPanel') +}, 30_000) + +const panels: Array = [] + +afterEach(() => { + // Unmounting stops the panel's timers and reactive roots. + panels.splice(0).forEach((panel) => panel.unmount()) + document.body.innerHTML = '' + localStorage.clear() +}) + +function createModuleRoot(moduleId: string) { + return new BaseRoute({ _module: moduleId } as any) as AnyRoute +} + +/** + * root + * └── /shop + * └── @acme/products (mounted at /products) + * ├── / + * ├── /$productId + * └── @acme/reviews (mounted at /reviews) + * └── / + */ +function setup(pathname: string) { + const root = new BaseRootRoute({}) + const shop = new BaseRoute({ getParentRoute: () => root, path: '/shop' }) + const products = createModuleRoot('@acme/products') + const reviews = createModuleRoot('@acme/reviews') + reviews.addChildren([ + new BaseRoute({ getParentRoute: () => reviews, path: '/' }), + ]) + products.addChildren([ + new BaseRoute({ getParentRoute: () => products, path: '/' }), + new BaseRoute({ getParentRoute: () => products, path: '/$productId' }), + reviews, + ]) + mountRouteModule(reviews, { parent: () => products, at: '/reviews' } as any) + mountRouteModule(products, { + parent: () => shop as AnyRoute, + at: '/products', + } as any) + const routeTree = root.addChildren([shop.addChildren([products])]) + const router = new RouterCore({ routeTree, isServer: false }, () => ({ + createMutableStore: createNonReactiveMutableStore, + createReadonlyStore: createNonReactiveReadonlyStore, + batch: (fn) => fn(), + })) + const panel = new TanStackRouterDevtoolsPanelCore({ + router, + routerState: { ...router.state, matches: router.matchRoutes(pathname, {}) }, + }) + const container = document.createElement('div') + document.body.append(container) + panel.mount(container) + panels.push(panel) + return container +} + +/** + * root + * ├── /orgs/$orgId + * │ └── @acme/settings#org (mounted at /settings) + * └── /people/$personId + * └── @acme/settings#person (mounted at /settings) + */ +function setupNamed(pathname: string) { + const root = new BaseRootRoute({}) + const orgs = new BaseRoute({ + getParentRoute: () => root, + path: '/orgs/$orgId', + }) + const people = new BaseRoute({ + getParentRoute: () => root, + path: '/people/$personId', + }) + const settings = createModuleRoot('@acme/settings') + settings.addChildren([ + new BaseRoute({ getParentRoute: () => settings, path: '/' }), + new BaseRoute({ getParentRoute: () => settings, path: '/profile' }), + ]) + const mount = (parent: AnyRoute, as: string) => + mountRouteModule(settings, { + parent: () => parent, + at: '/settings', + as, + } as any) + const routeTree = root.addChildren([ + orgs.addChildren([mount(orgs, 'org')]), + people.addChildren([mount(people, 'person')]), + ]) + const router = new RouterCore({ routeTree, isServer: false }, () => ({ + createMutableStore: createNonReactiveMutableStore, + createReadonlyStore: createNonReactiveReadonlyStore, + batch: (fn) => fn(), + })) + const panel = new TanStackRouterDevtoolsPanelCore({ + router, + routerState: { ...router.state, matches: router.matchRoutes(pathname, {}) }, + }) + const container = document.createElement('div') + document.body.append(container) + panel.mount(container) + panels.push(panel) + return container +} + +function find(container: HTMLElement, label: string) { + return container.querySelector(`[aria-label="${label}"]`) +} + +async function waitFor(container: HTMLElement, label: string) { + await vi.waitFor(() => expect(find(container, label)).not.toBeNull()) + return find(container, label)! +} + +/** The element whose own text is `text` (tab buttons, section headers). */ +async function waitForText(container: HTMLElement, text: string) { + const lookup = () => + [...container.querySelectorAll('*')].find( + (element) => + element.childElementCount === 0 && element.textContent === text, + ) + await vi.waitFor(() => expect(lookup()).toBeDefined()) + return lookup()! +} + +test('groups module routes, nested where their module is mounted', async () => { + const container = setup('/shop/products/7') + const products = await waitFor(container, 'Route module @acme/products') + + expect( + products.querySelector('[aria-label="Route module @acme/reviews"]'), + ).not.toBeNull() + expect( + products.querySelector( + '[aria-label="Open match details for @acme/products:/$productId"]', + ), + ).not.toBeNull() +}) + +test('collapses a module group and remembers it', async () => { + const container = setup('/shop/products/7') + ;(await waitFor(container, 'Collapse @acme/products')).click() + + await vi.waitFor(() => + expect( + find(container, 'Open match details for @acme/products:/$productId'), + ).toBeNull(), + ) + expect( + JSON.parse(localStorage.getItem('tanstackRouterDevtoolsCollapsedModules')!), + ).toEqual(['@acme/products']) + ;(await waitFor(container, 'Expand @acme/products')).click() + await waitFor(container, 'Open match details for @acme/products:/$productId') +}) + +test('filters the route tree to one module', async () => { + const container = setup('/shop/products/7') + const filter = (await waitFor( + container, + 'Show routes of', + )) as HTMLSelectElement + filter.value = '@acme/reviews' + filter.dispatchEvent(new Event('change')) + + await vi.waitFor(() => + expect( + find(container, 'Open match details for @acme/products:/$productId'), + ).toBeNull(), + ) + expect(find(container, 'Route module @acme/reviews')).not.toBeNull() + expect( + find(container, 'Open match details for @acme/reviews:/'), + ).not.toBeNull() +}) + +test('shows a module with its mount, parent module, routes and matches', async () => { + const container = setup('/shop/products/reviews') + ;(await waitFor(container, 'Open module details for @acme/reviews')).click() + + const details = await waitFor(container, 'Module details') + const text = details.textContent + expect(text).toContain('@acme/reviews') + expect(text).toContain('Mount path:/shop/products/reviews') + expect(text).toContain('Parent module:@acme/products') + // The module's own routes, with the local and the final path. The root is + // the mount path, not a route row. + expect( + [...details.querySelectorAll('[title^="@acme/reviews:"]')].map((row) => + row.getAttribute('title'), + ), + ).toEqual(['@acme/reviews:/']) + const route = details.querySelector('[title="@acme/reviews:/"]')! + expect( + [...route.querySelectorAll('code')].map((code) => code.textContent), + ).toEqual(['/', '/shop/products/reviews/']) + expect(text).not.toContain('/$productId') + expect( + details.querySelector( + '[aria-label^="Open match details for @acme/reviews:/"]', + ), + ).not.toBeNull() +}) + +test('badges matches with their module and shows local and final paths', async () => { + const container = setup('/shop/products/7') + ;(await waitForText(container, 'Matches')).click() + await vi.waitFor(() => + expect( + container.querySelector( + '[aria-label^="Open match details for @acme/products:/$productId"] [aria-label="Open module details for @acme/products"]', + ), + ).not.toBeNull(), + ) + ;(await waitForText(container, 'Routes')).click() + ;( + await waitFor( + container, + 'Open match details for @acme/products:/$productId', + ) + ).click() + const details = (await waitForText(container, 'Match Details')).parentElement! + expect(details.textContent).toContain('Local path:/$productId') + expect(details.textContent).toContain('Path:/shop/products/$productId') + expect( + details.querySelector( + '[aria-label="Open module details for @acme/products"]', + ), + ).not.toBeNull() +}) + +test('shows every installation of a module installed several times', async () => { + const container = setupNamed('/orgs/acme/settings/profile') + await waitFor(container, 'Route module @acme/settings#org') + expect(find(container, 'Route module @acme/settings#person')).not.toBeNull() + const filter = (await waitFor( + container, + 'Show routes of', + )) as HTMLSelectElement + expect([...filter.options].map((option) => option.value)).toEqual([ + '', + '@acme/settings#org', + '@acme/settings#person', + ]) + ;( + await waitFor(container, 'Open module details for @acme/settings#org') + ).click() + const details = await waitFor(container, 'Module details') + expect(details.textContent).toContain('Mount path:/orgs/$orgId/settings') + expect( + [...details.querySelectorAll('[title^="@acme/settings"]')].map((row) => + row.getAttribute('title'), + ), + ).toEqual(['@acme/settings#org:/', '@acme/settings#org:/profile']) + expect( + details.querySelector( + '[aria-label^="Open match details for @acme/settings#org:/profile"]', + ), + ).not.toBeNull() +}) diff --git a/packages/router-generator/src/config.ts b/packages/router-generator/src/config.ts index 5c719183db..828a394548 100644 --- a/packages/router-generator/src/config.ts +++ b/packages/router-generator/src/config.ts @@ -2,7 +2,15 @@ import path from 'node:path' import { existsSync, readFileSync } from 'node:fs' import { z } from 'zod' import { virtualRootRouteSchema } from './filesystem/virtual/config' +import { routeModulesOptionSchema } from './route-module/declaration' import type { GeneratorPlugin } from './plugin/types' +import type { RouteScopeNamespaceFile } from './route-module/emit' + +export const DEFAULT_ROUTE_TREE_FILE_HEADER = [ + '/* eslint-disable */', + '// @ts-nocheck', + '// noinspection JSUnusedGlobalSymbols', +] as const const tokenJsonRegexSchema = z.object({ regex: z.string(), @@ -32,11 +40,7 @@ export const baseConfigSchema = z.object({ routeTreeFileHeader: z .array(z.string()) .optional() - .default([ - '/* eslint-disable */', - '// @ts-nocheck', - '// noinspection JSUnusedGlobalSymbols', - ]), + .default([...DEFAULT_ROUTE_TREE_FILE_HEADER]), indexToken: tokenMatcherSchema.optional().default('index'), routeToken: tokenMatcherSchema.optional().default('route'), pathParamsAllowedCharacters: z @@ -79,6 +83,28 @@ export const configSchema = baseConfigSchema.extend({ plugins: z.array(z.custom()).optional(), tmpDir: z.string().optional().default(''), importRoutesUsingAbsolutePaths: z.boolean().optional().default(false), + /** + * Route modules this application installs (`includes`) or references + * (`uses`). Route modules themselves declare these in their package.json + * (`tanstack.router.module`). + */ + routeModules: routeModulesOptionSchema.optional(), + /** + * Where the generated files of route-module namespaces (`products.Link`) + * live, next to the generated route tree: + * - `'indexed'` (default): `routeScope.gen.namespace.ts`; + * - `'named'`: `routeScope.gen..ts`; + * - `'folder'`: `routeScope.gen/.ts`; + * - a function returning the path relative to the generated route tree's + * directory, without extension. + */ + routeScopeNamespaceFiles: z + .union([ + z.enum(['indexed', 'named', 'folder']), + z.custom((value) => typeof value === 'function'), + ]) + .optional() + .default('indexed'), }) export type Config = z.infer diff --git a/packages/router-generator/src/generated-names.ts b/packages/router-generator/src/generated-names.ts new file mode 100644 index 0000000000..82431dc744 --- /dev/null +++ b/packages/router-generator/src/generated-names.ts @@ -0,0 +1,120 @@ +/** A binding family emitted from one canonical route/package identity. */ +export interface GeneratedName { + key: string + preferred: string + suffixes: ReadonlyArray +} + +/** + * Allocate complete binding families together. Sorting canonical identities + * makes allocations independent of directory order, checkout paths and caches. + */ +export function allocateGeneratedNames( + entries: ReadonlyArray, + reserved: Iterable, +): Map { + const occupied = new Set(reserved) + const names = new Map() + for (const entry of [...entries].sort((a, b) => + a.key < b.key ? -1 : a.key > b.key ? 1 : 0, + )) { + if (names.has(entry.key)) { + continue + } + let candidate = entry.preferred + let index = 1 + while (entry.suffixes.some((suffix) => occupied.has(candidate + suffix))) { + candidate = `${entry.preferred}_${++index}` + } + for (const suffix of entry.suffixes) { + occupied.add(candidate + suffix) + } + names.set(entry.key, candidate) + } + return names +} + +export const routeBindingSuffixes = [ + 'RouteImport', + 'Route', + 'RouteChildren', + 'RouteWithChildren', +] as const + +export const moduleBindingSuffixes = [ + 'Router', + 'InstalledRouters', + 'InstalledRoutesById', + 'InstalledHostParams', + 'HostedRouter', + 'RouteModule', + 'StartModules', + ...routeBindingSuffixes.map((suffix) => `Module${suffix}`), +] as const + +export const generatedPublicNames = [ + 'Link', + 'createLink', + 'linkOptions', + 'Navigate', + 'useNavigate', + 'redirect', + 'MatchRoute', + 'useMatchRoute', + 'useRouter', + 'getRouteApi', + 'useMatch', + 'useMatches', + 'useParentMatches', + 'useChildMatches', + 'useLoaderData', + 'useLoaderDeps', + 'useSearch', + 'useParams', + 'useRouteContext', + 'useLocation', + 'useRouterState', + 'useLinkProps', + 'useBlocker', + 'notFound', + 'isScopedMatch', + 'createFileRoute', + 'createModuleRoot', + 'createServerFn', + 'createMiddleware', + 'createStartModule', + 'ValidateLinkOptions', + 'ValidateLinkOptionsArray', + 'ValidateNavigateOptions', + 'ValidateNavigateOptionsArray', + 'ValidateRedirectOptions', + 'ValidateRedirectOptionsArray', + 'ValidateFromPath', + 'ValidateToPath', + 'ValidateSearch', + 'ValidateParams', + 'ValidateId', + 'ValidateUseSearchOptions', + 'ValidateUseParamsOptions', + 'RouteModuleRouter', + 'RouteModuleRegister', + 'rootRouteImport', + 'routeTree', + 'FileRoutesByPath', + 'FileRoutesByFullPath', + 'FileRoutesByTo', + 'FileRoutesById', + 'FileRouteTypes', + 'RootRouteChildren', + 'rootRouteChildren', + 'MountedModuleHostParams', + 'RouteModuleRoutesById', + 'mountRouteModule', + 'lazyFn', + 'lazyRouteComponent', + 'InstallationRoutesById', + 'ScopeRouter', + 'ScopedRouter', + 'RouteScope', + 'HostedRouter', +] as const diff --git a/packages/router-generator/src/generator.ts b/packages/router-generator/src/generator.ts index 91f87dadda..4692c49234 100644 --- a/packages/router-generator/src/generator.ts +++ b/packages/router-generator/src/generator.ts @@ -1,8 +1,12 @@ import path from 'node:path' import * as fsp from 'node:fs/promises' -import { existsSync, mkdirSync } from 'node:fs' +import { existsSync, mkdirSync, realpathSync } from 'node:fs' import crypto from 'node:crypto' import { rootRouteId } from '@tanstack/router-core' +import { + getParamNames, + parseSegments, +} from '@tanstack/router-core/_internal/route-module' import { logging } from './logger' import { isVirtualConfigFile, @@ -29,6 +33,7 @@ import { getImportForRouteNode, getResolvedRouteNodeVariableName, hasParentRoute, + inferFullPath, isSegmentPathless, mergeImportDeclarations, multiSortBy, @@ -42,8 +47,51 @@ import { trimPathLeft, } from './utils' import { fillTemplate, getTargetTemplate } from './template' +import { + getHostPath, + getInstallationRouteId, + resolveRouteModuleContext, +} from './route-module/context' +import { + ROUTE_CONTRACT_FILE, + ROUTE_MODULE_FILE, + ROUTE_SCOPE_FILE, + START_MODULES_FILE, + buildRouteContractSource, + buildRouteModuleSource, + buildRouteNamespaceSource, + buildRouteScopeSource, + buildRouteTypeStubsSource, + buildStartModulesSource, + getClientRouteTreeFile, + getModuleIdentifier, + getMountVariableName, + getRouteNamespaceFiles, + getRouteTypeStubsPath, +} from './route-module/emit' +import { + ROUTE_MODULE_MANIFEST_VERSION, + computeTopologyToken, + getManifestPath, +} from './route-module/manifest' +import { findPackageRoot } from './route-module/declaration' +import { pruneServerOnlySubtrees } from './pruneServerOnlySubtrees' +import { isPrerenderableRoute } from './routeClassification' import { transform } from './transform/transform' import { validateRouteParams } from './validate-route-params' +import { + allocateGeneratedNames, + generatedPublicNames, + moduleBindingSuffixes, + routeBindingSuffixes, +} from './generated-names' +import { DEFAULT_ROUTE_TREE_FILE_HEADER } from './config' +import type { ResolvedMount, RouteModuleContext } from './route-module/context' +import type { + ManifestInstalledModule, + ManifestRoute, + RouteModuleManifest, +} from './route-module/manifest' import type { GeneratorPlugin } from './plugin/types' import type { TargetTemplate } from './template' import type { @@ -182,6 +230,15 @@ interface RouteNodeCacheEntry extends GeneratorCacheEntry { type GeneratorRouteNodeCache = Map +/** Where a mounted module sits in this package's route tree. */ +interface MountPlacement { + mount: ResolvedMount + /** The file-less node of the module root. */ + node: RouteNode + /** The prefix of the module's full paths: the host route's path and `at`. */ + prefix: string +} + interface CrawlingResult { rootRouteNode: RouteNode routeFileResult: Array @@ -219,6 +276,21 @@ export class Generator { private plugins: Array = [] private static routeGroupPatternRegex = /\(.+\)/ private physicalDirectories: Array = [] + /** Route-module role of this package, refreshed on every run. */ + private routeModuleContext: RouteModuleContext | undefined + private originalRouteNames = new WeakMap() + /** Files that change the route-module context (package.json, manifests). */ + private routeModuleFiles = new Set() + /** + * The generated route-module files of the last run with their content: + * events on them regenerate, files not generated anymore are removed. + * `undefined` until the first run, which finds the files on disk. + */ + private generatedRouteModuleFiles: + | Map + | undefined + /** Formatted route-module sources of the last run; they rarely change. */ + private formattedRouteModuleFiles = new Map() /** * Token regexes are pre-compiled once here and reused throughout route processing. @@ -295,13 +367,137 @@ export class Generator { : path.resolve(this.root, this.config.routesDirectory) } + /** + * The route files of the route tree by path, with their route ids: the + * package's own files and the files of the route modules it mounts. Paths + * use forward slashes on every platform. + */ public getRoutesByFileMap(): GetRoutesByFileMapResult { - return new Map( + const moduleId = + this.routeModuleContext?.declaration.mode === 'module' + ? this.routeModuleContext.declaration.moduleId + : undefined + const map: GetRoutesByFileMapResult = new Map( [...this.routeNodeCache.entries()].map(([filePath, cacheEntry]) => [ filePath, - { routeId: cacheEntry.routeId }, + { + routeId: + moduleId === undefined + ? cacheEntry.routeId + : cacheEntry.routeId === `/${rootPathId}` + ? `${moduleId}:` + : `${moduleId}:${cacheEntry.routeId}`, + }, ]), ) + for (const mount of this.routeModuleContext?.mounts ?? []) { + for (const { file, routeId } of mount.routeFiles) { + map.set(replaceBackslash(file), { routeId }) + } + } + return map + } + + /** + * The routes of the route modules mounted by this package, with their files + * and parent ids in this package's route tree (for integrations that index + * routes by id, such as Start's asset manifest). + */ + public getMountedRouteModuleRoutes(): Array<{ + id: string + parent: string + filePath: string | undefined + fullPath: string + prerender?: boolean + }> { + const context = this.routeModuleContext + const crawlingResult = this.crawlingResult + if (!context || !crawlingResult) { + return [] + } + const ownModuleId = + context.declaration.mode === 'module' + ? context.declaration.moduleId + : undefined + const hostId = (node: RouteNode | undefined) => + ownModuleId === undefined + ? (node?.routePath ?? rootRouteId) + : node + ? `${ownModuleId}:${node.routePath ?? ''}` + : `${ownModuleId}:` + const routes: Array<{ + id: string + parent: string + filePath: string | undefined + fullPath: string + prerender?: boolean + }> = [] + for (const { mount, node, prefix } of this.getMountPlacements( + crawlingResult.acc, + )) { + const files = new Map( + mount.routeFiles.map(({ file, routeId }) => [routeId, file]), + ) + for (const route of mount.manifest.routes) { + routes.push({ + id: getInstallationRouteId(mount, route.id), + parent: route.parent + ? getInstallationRouteId(mount, route.parent) + : hostId(node.parent), + filePath: files.get(route.id), + fullPath: `${prefix}${route.fullPath}`, + prerender: route.prerender, + }) + } + } + return routes + } + + /** Current provider tree paths used by client-only bundler resolution. */ + public getRouteModuleClientTrees(): Array<{ + filePath: string + clientFilePath: string + }> { + return [ + ...new Map( + (this.routeModuleContext?.mounts ?? []).flatMap((mount) => + mount.clientTrees.map((entry) => [entry.filePath, entry] as const), + ), + ).values(), + ] + } + + /** Same page predicate for ordinary routes and installed module routes. */ + public getPrerenderableRoutePaths(): Array { + const own = + this.crawlingResult?.acc.routeNodes + .filter(isPrerenderableRoute) + .map(inferFullPath) ?? [] + const mounted = this.getMountedRouteModuleRoutes() + .filter((route) => route.prerender) + .map((route) => route.fullPath) + return [ + ...new Set( + [...own, ...mounted].filter((fullPath) => !fullPath.includes('$')), + ), + ] + } + + private getClientRouteTreePath() { + const parsed = path.parse(this.generatedRouteTreePath) + return path.join( + parsed.dir, + `${getClientRouteTreeFile(parsed.name)}${parsed.ext}`, + ) + } + + /** + * Files outside the routes directory that change the generated route tree: + * the package.json and the manifests of mounted and used route modules. + * Bundler integrations add them to their watchers. + */ + public getRouteModuleWatchFiles(): Array { + return [...this.routeModuleFiles] } public async run(event?: GeneratorEvent): Promise { @@ -336,7 +532,9 @@ export class Generator { } else { // we only check the routeNodeCache here // if the file's state is only up-to-date in the shadow cache we need to re-run - cacheEntry = this.routeNodeCache.get(e.path) + cacheEntry = + this.routeNodeCache.get(e.path) ?? + this.generatedRouteModuleFiles?.get(e.path) } const change = await this.didFileChangeComparedToCache( { path: e.path }, @@ -385,6 +583,34 @@ export class Generator { private async generatorInternal() { let writeRouteTreeFile: boolean | 'force' = false + // The route-module context depends on package.json and on the manifests + // of other packages: a change there regenerates the outputs even when no + // route file changed. + const previousRouteModuleHash = this.routeModuleContext?.hash + const packageRoot = findPackageRoot(this.root) + // Files reported before a failing resolution stay watched, so that fixing + // them (e.g. generating a missing manifest) reruns the generator. + this.routeModuleFiles = new Set( + packageRoot ? [path.join(packageRoot, 'package.json')] : [], + ) + this.routeModuleContext = resolveRouteModuleContext({ + root: this.root, + routeModules: this.config.routeModules, + onWatchFile: (file) => this.routeModuleFiles.add(file), + start: { + package: `@tanstack/${this.config.target}-start`, + generatedDirectory: path.dirname(this.generatedRouteTreePath), + }, + }) + if (this.routeModuleContext && this.config.disableTypes) { + throw new Error( + `[route modules] ${this.routeModuleContext.declaration.packageName}: route modules require TypeScript; "disableTypes" is not supported.`, + ) + } + if (this.routeModuleContext?.hash !== previousRouteModuleHash) { + writeRouteTreeFile = true + } + let getRouteNodesResult: GetRouteNodesResult if (this.config.virtualRouteConfig) { @@ -485,6 +711,9 @@ export class Generator { Generator.handleNode(node, acc, prefixMap, this.config) } + this.addRouteModuleMounts(acc) + this.checkRouteModuleMounts(acc) + this.crawlingResult = { rootRouteNode, routeFileResult, acc } // this is the first time the generator runs, so read in the route tree file if it exists yet @@ -533,6 +762,20 @@ export class Generator { } } + if (!writeRouteTreeFile) { + // A generated route-module file changed or was removed from outside. + for (const [file, entry] of this.generatedRouteModuleFiles ?? []) { + const change = await this.didFileChangeComparedToCache( + { path: file }, + entry, + ) + if (change.result !== false) { + writeRouteTreeFile = true + break + } + } + } + if (!writeRouteTreeFile) { this.swapCaches() return @@ -585,6 +828,8 @@ export class Generator { } } + await this.writeRouteModuleFiles(rootRouteNode, acc) + this.plugins.map((plugin) => { return plugin.onRouteTreeChanged?.({ routeTree: buildResult.routeTree, @@ -596,6 +841,390 @@ export class Generator { this.swapCaches() } + /** + * Writes the generated files of route modules (scope, namespaces, contract, + * runtime entry, client view, manifest, contract stand-ins) and of + * applications that mount them (scope, namespaces, Start fragments), and + * removes generated files that are not generated anymore. + */ + private async writeRouteModuleFiles( + rootRouteNode: RouteNode, + acc: HandleNodeAccumulator, + ) { + const context = this.routeModuleContext + if (!context) { + await this.syncRouteModuleFiles(new Map()) + return + } + const header = this.getGeneratedFileHeader(this.config) + const importFrom = (from: string, baseName: string) => + this.getRouteModuleImport(this.getRouteModuleFilePath(from), baseName) + const routeTreeImport = replaceBackslash( + removeExt( + `./${path.basename(this.generatedRouteTreePath)}`, + this.config.addExtensions, + ), + ) + + // Generated files live next to the Start file. + const startImport = replaceBackslash( + removeExt( + `./${path.basename(context.start?.file ?? 'start.ts')}`, + this.config.addExtensions, + ), + ) + + const namespaceFiles = getRouteNamespaceFiles( + context, + this.config.routeScopeNamespaceFiles, + removeExt(path.basename(this.generatedRouteTreePath), false), + ) + const routeTreeImportFrom = (baseName: string) => { + const relative = replaceBackslash( + removeExt( + path.relative( + path.dirname(this.getRouteModuleFilePath(baseName)), + this.generatedRouteTreePath, + ), + this.config.addExtensions, + ), + ) + return relative.startsWith('.') ? relative : `./${relative}` + } + + /** Sources by absolute path; formatted like the route tree. */ + const sources = new Map() + sources.set( + this.getRouteModuleFilePath(ROUTE_SCOPE_FILE), + buildRouteScopeSource({ + context, + frameworkPackage: this.targetTemplate.fullPkg, + routeTreeImport, + contractImport: importFrom(ROUTE_SCOPE_FILE, ROUTE_CONTRACT_FILE), + header, + matchRoots: + context.declaration.mode === 'module' + ? [ + `${context.declaration.moduleId}:`, + ...context.mounts.flatMap((mount) => + mount.installed.map((installed) => `${installed.key}:`), + ), + ] + : [], + namespaceImport: (module) => + importFrom(ROUTE_SCOPE_FILE, namespaceFiles.get(module.key)!), + }), + ) + for (const module of context.scope) { + const file = namespaceFiles.get(module.key)! + sources.set( + this.getRouteModuleFilePath(file), + buildRouteNamespaceSource({ + context, + module, + frameworkPackage: this.targetTemplate.fullPkg, + routeTreeImport: routeTreeImportFrom(file), + header, + }), + ) + } + if (context.declaration.mode === 'module') { + sources.set( + this.getRouteModuleFilePath(ROUTE_CONTRACT_FILE), + buildRouteContractSource({ + context, + frameworkPackage: this.targetTemplate.fullPkg, + routeTreeImport, + startImport, + header, + }), + ) + sources.set( + this.getRouteModuleFilePath(ROUTE_MODULE_FILE), + buildRouteModuleSource({ + context, + routeTreeImport, + startImport, + header, + }), + ) + const pruned = pruneServerOnlySubtrees({ rootRouteNode, acc }) + const client = this.buildRouteTree({ + rootRouteNode, + routeFileResult: this.crawlingResult!.routeFileResult, + acc: { ...acc, ...pruned }, + config: { ...this.config, disableTypes: true }, + // This runtime view omits the full tree's declarations and assertions. + // Keep it in ordinary TypeScript builds so they emit its JavaScript. + header: [ + ...new Set([...this.config.routeTreeFileHeader, '// @ts-nocheck']), + ], + }) + const clientPath = this.getClientRouteTreePath() + // This runtime-only view has no public route contract. Give its incidental + // declaration a portable name instead of inferring dependency internals. + sources.set( + clientPath, + /\.(?:[cm]?ts|tsx)$/.test(clientPath) + ? client.routeTreeContent.replace( + /^export const routeTree = /m, + `export const routeTree: import('${this.targetTemplate.fullPkg}').AnyRoute = `, + ) + : client.routeTreeContent, + ) + } else if (context.start && context.mounts.length > 0) { + sources.set( + this.getRouteModuleFilePath(START_MODULES_FILE), + buildStartModulesSource({ context, startImport, header }), + ) + } + + const routesDirectory = this.routesDirectoryPath + for (const file of sources.keys()) { + if (file.startsWith(routesDirectory + path.sep)) { + throw new Error( + `[route modules] The generated file "${file}" is inside the routes directory, where it would be read as a route.`, + ) + } + } + + const formatted = new Map() + const expected = new Map() + for (const [file, source] of sources) { + let content = source + if (this.config.enableRouteTreeFormatting) { + content = + this.formattedRouteModuleFiles.get(source) ?? + (await format(source, this.config)) + formatted.set(source, content) + } + expected.set(file, content) + } + this.formattedRouteModuleFiles = formatted + if (context.declaration.mode === 'module') { + // Build artifacts beside each other: nothing lints or formats them. + const packageRoot = context.declaration.packageRoot + expected.set( + getManifestPath(packageRoot), + `${JSON.stringify( + this.buildRouteModuleManifest(context, rootRouteNode, acc), + null, + 2, + )}\n`, + ) + expected.set( + getRouteTypeStubsPath(packageRoot), + buildRouteTypeStubsSource({ + context, + frameworkPackage: this.targetTemplate.fullPkg, + header, + }), + ) + } + await this.syncRouteModuleFiles(expected) + } + + /** + * Brings the generated route-module files on disk to `expected` (content by + * absolute path): writes the files whose content changed and removes the + * files of the previous generation that are not generated anymore, with the + * folders a layout emptied. + */ + private async syncRouteModuleFiles(expected: Map) { + const previous = this.generatedRouteModuleFiles + ? [...this.generatedRouteModuleFiles.keys()] + : await this.findGeneratedRouteModuleFiles() + const directory = path.dirname(this.generatedRouteTreePath) + for (const file of previous) { + if (expected.has(file)) { + continue + } + await fsp.rm(file, { force: true }) + for ( + let folder = path.dirname(file); + folder !== directory && folder.startsWith(directory + path.sep); + folder = path.dirname(folder) + ) { + if ((await fsp.readdir(folder)).length > 0) { + break + } + await fsp.rmdir(folder) + } + } + this.generatedRouteModuleFiles = new Map() + for (const [file, content] of expected) { + await this.writeGeneratedFile(file, content) + } + } + + /** + * The generated route-module files of an earlier generation that exist on + * disk: the fixed names, the namespace files the previous scope file lists + * (whatever their layout) and the indexed names of earlier versions. + */ + private async findGeneratedRouteModuleFiles(): Promise> { + const directory = path.dirname(this.generatedRouteTreePath) + const packageRoot = findPackageRoot(this.root) + const candidates = new Set([ + ...[ + ROUTE_SCOPE_FILE, + ROUTE_CONTRACT_FILE, + ROUTE_MODULE_FILE, + START_MODULES_FILE, + ].map((file) => this.getRouteModuleFilePath(file)), + this.getClientRouteTreePath(), + ...(packageRoot + ? [getManifestPath(packageRoot), getRouteTypeStubsPath(packageRoot)] + : []), + ]) + const scopeFile = this.getRouteModuleFilePath(ROUTE_SCOPE_FILE) + const scope = await this.fs.readFile(scopeFile) + if (scope !== 'file-not-existing') { + for (const [, specifier] of scope.fileContent.matchAll( + /^export \* as \w+ from ['"]([^'"]+)['"]/gm, + )) { + const file = path.resolve( + path.dirname(scopeFile), + `${specifier!.replace(/\.[cm]?[jt]sx?$/, '')}.ts`, + ) + if (file.startsWith(directory + path.sep)) { + candidates.add(file) + } + } + } + if (existsSync(directory)) { + for (const entry of await fsp.readdir(directory)) { + if (/^routeScope\.gen\.namespace\d+\.ts$/.test(entry)) { + candidates.add(path.join(directory, entry)) + } + } + } + return [...candidates].filter((file) => existsSync(file)) + } + + /** Writes a generated route-module file when its content changed. */ + private async writeGeneratedFile(filePath: string, content: string) { + const existing = await this.fs.readFile(filePath) + let mtimeMs: bigint + if (existing !== 'file-not-existing' && existing.fileContent === content) { + mtimeMs = existing.stat.mtimeMs + } else { + await fsp.mkdir(path.dirname(filePath), { recursive: true }) + const stat = await this.safeFileWrite({ + filePath, + newContent: content, + strategy: + existing === 'file-not-existing' + ? { type: 'new-file' } + : { type: 'mtime', expectedMtimeMs: existing.stat.mtimeMs }, + }) + mtimeMs = stat.mtimeMs + } + this.generatedRouteModuleFiles!.set(filePath, { + fileContent: content, + mtimeMs, + }) + } + + private buildRouteModuleManifest( + context: RouteModuleContext, + rootRouteNode: RouteNode, + acc: HandleNodeAccumulator, + ): RouteModuleManifest { + const { declaration } = context + const moduleId = declaration.moduleId! + const routeId = (node: RouteNode | undefined) => + node ? `${moduleId}:${node.routePath ?? ''}` : `${moduleId}:` + const routes: Array = [ + { id: `${moduleId}:`, parent: null, fullPath: '/', leaf: false }, + ...acc.routeNodes.map((node) => ({ + id: routeId(node), + parent: routeId(node.parent), + fullPath: inferFullPath(node), + leaf: !node.children?.length, + ...(isPrerenderableRoute(node) ? { prerender: true } : {}), + })), + ] + const routeFiles = [rootRouteNode, ...acc.routeNodes] + .filter((node) => node.fullPath && !node.isVirtual) + .map((node) => ({ + owner: [] as Array, + file: replaceBackslash( + path.relative(declaration.packageRoot, realpathSync(node.fullPath)), + ), + routeId: + node === rootRouteNode + ? `${moduleId}:` + : `${moduleId}:${node.routePath ?? ''}`, + })) + const modules: Array = [ + { + id: moduleId, + key: moduleId, + uses: context.usedContracts, + mountPath: '/', + includedBy: null, + }, + ] + + for (const { mount, node, prefix } of this.getMountPlacements(acc)) { + routes.push( + ...mount.manifest.routes.map((route) => ({ + ...route, + id: getInstallationRouteId(mount, route.id), + parent: route.parent + ? getInstallationRouteId(mount, route.parent) + : routeId(node.parent), + fullPath: `${prefix}${route.fullPath}`, + })), + ) + routeFiles.push( + ...mount.manifest.routeFiles.map((entry) => ({ + ...entry, + owner: [mount.moduleId, ...entry.owner], + routeId: getInstallationRouteId(mount, entry.routeId), + })), + ) + modules.push( + ...mount.installed.map((installed) => ({ + ...installed, + mountPath: `${prefix}${installed.mountPath}`, + })), + ) + } + + const topology: Omit = { + version: ROUTE_MODULE_MANIFEST_VERSION, + id: moduleId, + packageName: declaration.packageName, + routes, + routeFiles, + clientTrees: [ + { + owner: [], + file: replaceBackslash( + path.relative(declaration.packageRoot, this.generatedRouteTreePath), + ), + clientFile: replaceBackslash( + path.relative( + declaration.packageRoot, + this.getClientRouteTreePath(), + ), + ), + }, + ...context.mounts.flatMap((mount) => + mount.manifest.clientTrees.map((entry) => ({ + ...entry, + owner: [mount.moduleId, ...entry.owner], + })), + ), + ], + modules, + startModules: context.exportsStartModules, + } + return { ...topology, topologyToken: computeTopologyToken(topology) } + } + private swapCaches() { this.routeNodeCache = this.routeNodeShadowCache this.routeNodeShadowCache = new Map() @@ -606,10 +1235,73 @@ export class Generator { acc: HandleNodeAccumulator routeFileResult: Array config?: Partial + /** Replaces the header derived from `config`. */ + header?: Array }) { const config = { ...this.config, ...(opts.config || {}) } - const { rootRouteNode, acc } = opts + const { rootRouteNode } = opts + // Mounted module roots only appear as children; integrations that rebuild + // the node list from the tree (e.g. Start's server-only pruning) may + // collect them, so they never count as route nodes of this package. + const acc: HandleNodeAccumulator = { + ...opts.acc, + routeNodes: opts.acc.routeNodes.filter((node) => !node._routeModuleMount), + } + + // Reserve names from the complete crawl even when Start rebuilds a pruned + // client tree. Repeated builds must not rename the surviving routes. + const namingNodes = this.crawlingResult?.acc.routeNodes ?? acc.routeNodes + const context = this.routeModuleContext + const moduleIds = new Set([ + ...(context?.includedContracts ?? []), + ...(context?.mounts.flatMap((mount) => [mount.moduleId, mount.key]) ?? + []), + ...(context?.scope.flatMap((module) => [ + module.key, + module.contractPackage, + ...(module.hostedThrough ? [module.hostedThrough] : []), + ]) ?? []), + ]) + const nodeKey = (node: RouteNode) => + `route:${node.routePath ?? ''}:${node.filePath}:${node._fsRouteType}` + const names = allocateGeneratedNames( + [ + ...namingNodes.map((node) => { + let preferred = this.originalRouteNames.get(node) + if (preferred === undefined) { + preferred = node.variableName + this.originalRouteNames.set(node, preferred) + } + return { + key: nodeKey(node), + preferred, + suffixes: routeBindingSuffixes, + } + }), + ...[...moduleIds].map((id) => ({ + key: `module:${id}`, + preferred: getModuleIdentifier(id), + suffixes: moduleBindingSuffixes, + })), + ], + [ + ...generatedPublicNames, + ...(context?.scope.map((module) => module.namespace) ?? []), + ], + ) + for (const node of namingNodes) { + node.variableName = names.get(nodeKey(node))! + } + const placements = this.getMountPlacements(acc) + if (context) { + context.identifiers = new Map( + [...moduleIds].map((id) => [id, names.get(`module:${id}`)!]), + ) + for (const { mount, node } of placements) { + node.variableName = getMountVariableName(mount.key, context.identifiers) + } + } // Use pre-compiled regex if config hasn't been overridden, otherwise create new one const indexTokenSegmentRegex = @@ -622,13 +1314,23 @@ export class Generator { indexTokenSegmentRegex, ) + const routeModule = this.routeModuleContext + const moduleId = + routeModule?.declaration.mode === 'module' + ? routeModule.declaration.moduleId! + : undefined + // Route modules qualify their route ids with the module id. + const qualifyId = (id: string) => + moduleId === undefined ? id : `${moduleId}:${id}` + const rootId = moduleId === undefined ? rootRouteId : `${moduleId}:` + const routeImports: Array = [] const virtualRouteNodes: Array = [] for (const node of sortedRouteNodes) { if (node.isVirtual) { virtualRouteNodes.push( - `const ${node.variableName}RouteImport = createFileRoute('${node.routePath}')()`, + `const ${node.variableName}RouteImport = createFileRoute('${qualifyId(node.routePath ?? '')}')()`, ) } else { routeImports.push( @@ -646,9 +1348,89 @@ export class Generator { if (virtualRouteNodes.length > 0) { imports.push({ specifiers: [{ imported: 'createFileRoute' }], - source: this.targetTemplate.fullPkg, + source: + moduleId === undefined + ? this.targetTemplate.fullPkg + : this.getRouteModuleImport( + this.generatedRouteTreePath, + ROUTE_SCOPE_FILE, + ), }) } + const mountStatements: Array = [] + const mountHostParams: Array = [] + if (routeModule && placements.length > 0) { + imports.push({ + specifiers: [{ imported: 'mountRouteModule' }], + source: `${this.targetTemplate.fullPkg}/_internal/route-module`, + }) + const moduleUses = this.getRouteModuleUses(placements) + const importedModules = new Set() + for (const { mount, node } of placements) { + const importName = `${getModuleIdentifier(mount.moduleId, routeModule.identifiers)}RouteModule` + if (!importedModules.has(mount.moduleId)) { + importedModules.add(mount.moduleId) + imports.push({ + specifiers: [{ imported: 'routeModule', local: importName }], + source: `${mount.moduleId}/route-module`, + }) + } + const parentVariable = node.parent + ? `${node.parent.variableName}Route` + : 'rootRouteImport' + const uses = moduleUses.get(mount.key) + mountStatements.push( + `const ${getMountVariableName(mount.key, routeModule.identifiers)}Route${config.disableTypes ? '' : `: typeof ${importName}`} = mountRouteModule(${importName}, { + parent: () => ${parentVariable},${mount.at === undefined ? '' : `\n at: '${mount.at}',`}${mount.as === undefined ? '' : `\n as: '${mount.as}',`}${ + uses + ? `\n uses: { ${Object.entries(uses) + .map(([used, installation]) => `'${used}': '${installation}'`) + .join(', ')} },` + : '' + } +})`, + ) + mountHostParams.push( + ` '${mount.key}': (typeof ${parentVariable})['types']['allParams']`, + ) + } + if (!config.disableTypes) { + mountStatements.push( + `/** The path params of the routes above each mounted route module. */ +export interface MountedModuleHostParams { +${mountHostParams.join('\n')} +}`, + ) + } + } + if (routeModule && !config.disableTypes) { + if (routeModule.includedContracts.length > 0) { + imports.push({ + specifiers: [{ imported: 'MountedRoutesById' }], + source: this.targetTemplate.fullPkg, + importKind: 'type', + }) + } + if (routeModule.mounts.some((mount) => mount.as !== undefined)) { + imports.push({ + specifiers: [{ imported: 'InstallationRoutesById' }], + source: this.targetTemplate.fullPkg, + importKind: 'type', + }) + } + for (const contractPackage of routeModule.includedContracts) { + imports.push({ + specifiers: [ + { + imported: 'InstalledRoutesById', + local: `${getModuleIdentifier(contractPackage, routeModule.identifiers)}InstalledRoutesById`, + }, + ], + source: `${contractPackage}/route-types`, + importKind: 'type', + }) + } + } // Add lazyRouteComponent import if there are component pieces let hasComponentPieces = false let hasLoaderPieces = false @@ -884,11 +1666,36 @@ ${[...routeNodesByTo.entries()] })} }`, `export interface FileRoutesById { -'${rootRouteId}': typeof rootRouteImport, +'${rootId}': typeof rootRouteImport, ${[...routeNodesById.entries()].map(([id, routeNode]) => { - return `'${id}': typeof ${getResolvedRouteNodeVariableName(routeNode)}` + return `'${qualifyId(id)}': typeof ${getResolvedRouteNodeVariableName(routeNode)}` })} }`, + // Route modules see the routes of the modules in their scope by id; + // the interface references their declarations instead of copying them. + ...(routeModule + ? [ + `interface RouteModuleRoutesById extends FileRoutesById${routeModule.includedContracts + .flatMap((contractPackage) => { + const installedRoutes = `${getModuleIdentifier(contractPackage, routeModule.identifiers)}InstalledRoutesById` + // A module installed several times has the routes of each + // installation, by `#:/…` ids. + return routeModule.mounts.some( + (mount) => + mount.moduleId === contractPackage && + mount.as !== undefined, + ) + ? routeModule.mounts + .filter((mount) => mount.moduleId === contractPackage) + .map( + (mount) => + `, MountedRoutesById>`, + ) + : [`, MountedRoutesById<${installedRoutes}>`] + }) + .join('')} {}`, + ] + : []), `export interface FileRouteTypes { fileRoutesByFullPath: FileRoutesByFullPath fullPaths: ${ @@ -908,8 +1715,15 @@ to: ${ .join('|') : 'never' } -id: ${[`'${rootRouteId}'`, ...[...routeNodesById.keys()].map((id) => `'${id}'`)].join('|')} -fileRoutesById: FileRoutesById +id: ${ + routeModule + ? 'keyof RouteModuleRoutesById' + : [ + `'${rootRouteId}'`, + ...[...routeNodesById.keys()].map((id) => `'${id}'`), + ].join('|') + } +fileRoutesById: ${routeModule ? 'RouteModuleRoutesById' : 'FileRoutesById'} }`, `export interface RootRouteChildren { ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolvedRouteNodeVariableName(child)}`).join(',')} @@ -917,10 +1731,13 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved ].join('\n') fileRoutesByPathInterface = buildFileRoutesByPathInterface({ - module: this.targetTemplate.fullPkg, + // Route modules keep their file routes local: no global augmentation. + module: + moduleId === undefined ? this.targetTemplate.fullPkg : undefined, interfaceName: 'FileRoutesByPath', routeNodes: sortedRouteNodes, config, + qualifyId, }) } @@ -972,7 +1789,15 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved } } const routeTreeContent = [ - ...config.routeTreeFileHeader, + ...(opts.header ?? this.getGeneratedFileHeader(config)), + ...(routeModule?.declaration.mode === 'host' && + routeModule.start && + routeModule.mounts.length > 0 && + !config.disableTypes + ? [ + `export type { StartModulesCheck } from '${this.getRouteModuleImport(this.generatedRouteTreePath, START_MODULES_FILE)}'`, + ] + : []), `// This file was automatically generated by TanStack Router. // You should NOT make any changes in this file as it will be overwritten. // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.`, @@ -980,6 +1805,7 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved mergeImportDeclarations(routeImports).map(buildImportString).join('\n'), virtualRouteNodes.join('\n'), createUpdateRoutes.join('\n'), + mountStatements.join('\n\n'), fileRoutesByFullPath, fileRoutesByPathInterface, routeTreeConfig.join('\n'), @@ -1028,7 +1854,15 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved node, } - const escapedRoutePath = node.routePath?.replaceAll('$', '$$') ?? '' + const routeModule = this.getRouteFileModuleScope(node) + if (routeModule && node._fsRouteType === 'lazy') { + throw new Error( + `[route modules] ${node.fullPath}: lazy route files (".lazy" files and createLazyFileRoute) are not supported in route modules. Use automatic code splitting instead.`, + ) + } + const escapedRoutePath = routeModule + ? routeModule.routeId + : (node.routePath?.replaceAll('$', '$$') ?? '') let shouldWriteRouteFile = false let shouldWriteTree = false @@ -1075,7 +1909,9 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved this.config.customScaffolding?.routeTemplate ?? tRouteTemplate.template(), { - tsrImports: tRouteTemplate.imports.tsrImports(), + tsrImports: routeModule + ? `import { createFileRoute } from '${routeModule.importSource}';` + : tRouteTemplate.imports.tsrImports(), tsrPath: escapedRoutePath.replaceAll(/\{(.+?)\}/gm, '$1'), tsrExportStart: tRouteTemplate.imports.tsrExportStart(escapedRoutePath), @@ -1100,6 +1936,7 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved target: this.config.target, routeId: escapedRoutePath, lazy: node._fsRouteType === 'lazy', + routeImportSource: routeModule?.importSource, }, node, }) @@ -1134,6 +1971,14 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved } } + const previousProps = previousCacheEntry?.node.createFileRouteProps + const props = node.createFileRouteProps + if ( + previousProps?.size !== props?.size || + [...(props ?? [])].some((prop) => !previousProps?.has(prop)) + ) { + shouldWriteTree = true + } for (const plugin of this.plugins) { plugin.afterTransform?.({ node, prevNode: previousCacheEntry?.node }) } @@ -1370,15 +2215,25 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved // scaffold the root route if (!rootNodeFile.fileContent) { const rootTemplate = this.targetTemplate.rootRoute + const routeModule = this.getRouteFileModuleScope(node) const rootRouteContent = await fillTemplate( this.config, rootTemplate.template(), - { - tsrImports: rootTemplate.imports.tsrImports(), - tsrPath: rootPathId, - tsrExportStart: rootTemplate.imports.tsrExportStart(), - tsrExportEnd: rootTemplate.imports.tsrExportEnd(), - }, + routeModule + ? { + // A route module's root declares the router context it + // requires: `createModuleRoot<{ queryClient: QueryClient }>()`. + tsrImports: `import { Outlet } from '${this.targetTemplate.fullPkg}';\nimport { createModuleRoot } from '${routeModule.importSource}';`, + tsrPath: routeModule.routeId, + tsrExportStart: 'export const Route = createModuleRoot()(', + tsrExportEnd: rootTemplate.imports.tsrExportEnd(), + } + : { + tsrImports: rootTemplate.imports.tsrImports(), + tsrPath: rootPathId, + tsrExportStart: rootTemplate.imports.tsrExportStart(), + tsrExportEnd: rootTemplate.imports.tsrExportEnd(), + }, ) this.logger.log(`🟡 Creating ${node.fullPath}`) @@ -1398,6 +2253,319 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved this.routeNodeShadowCache.set(node.fullPath, updatedCacheEntry) } + /** + * Adds the roots of mounted route modules as children of their host routes. + * They appear only in the children of the route tree; their routes are + * described by the modules' own declarations. + */ + private addRouteModuleMounts(acc: HandleNodeAccumulator) { + const context = this.routeModuleContext + if (!context) { + return + } + const moduleId = context.declaration.moduleId + for (const mount of context.mounts) { + let parentId = mount.include.parent + if (moduleId && parentId?.startsWith(`${moduleId}:`)) { + parentId = parentId.slice(moduleId.length + 1) + } + const parent = + parentId === undefined || parentId === rootRouteId + ? undefined + : acc.routeNodesByPath.get(parentId) + if (parentId !== undefined && parentId !== rootRouteId && !parent) { + throw new Error( + `[route modules] ${context.declaration.packageName}: the parent route "${mount.include.parent}" of "${mount.moduleId}" does not exist.`, + ) + } + const mountNode: RouteNode = { + filePath: '', + fullPath: '', + variableName: getMountVariableName(mount.key), + _fsRouteType: 'static', + parent, + _routeModuleMount: { + moduleId: mount.moduleId, + installation: mount.key, + at: mount.at, + }, + } + if (parent) { + parent.children = parent.children ?? [] + parent.children.push(mountNode) + } else { + acc.routeTree.push(mountNode) + } + } + } + + /** + * Where each mounted module sits in this route tree. Mount nodes only appear + * in the children of their host routes. + */ + private getMountPlacements( + acc: HandleNodeAccumulator, + ): Array { + const nodes = new Map() + const visit = (list: Array) => { + for (const node of list) { + if (node._routeModuleMount) { + nodes.set(node._routeModuleMount.installation, node) + } + if (node.children) { + visit(node.children) + } + } + } + visit(acc.routeTree) + return (this.routeModuleContext?.mounts ?? []).map((mount) => { + const node = nodes.get(mount.key)! + const hostPath = node.parent + ? inferFullPath(node.parent).replace(/\/$/, '') + : '' + return { mount, node, prefix: `${hostPath}${mount.at ?? ''}` } + }) + } + + /** + * Rejects mounted modules whose routes collide with routes of this package + * or of other mounted modules, whose path params repeat a host param, or + * that link into a module whose host params they cannot fill: a module that + * uses another one without mounting it links into it through a namespace + * typed without the path params above it, filled from the current location. + * That always works only when the routes declaring them are above the using + * module too. Runs before the mounts are emitted: the installations used + * modules link into assume valid host params. + */ + private checkRouteModuleMounts(acc: HandleNodeAccumulator) { + const context = this.routeModuleContext + const placements = this.getMountPlacements(acc) + if (!context || placements.length === 0) { + return + } + const owners = new Map() + const claim = (fullPath: string, owner: string) => { + const key = fullPath === '/' ? '/' : fullPath.replace(/\/$/, '') + const previous = owners.get(key) + if (previous !== undefined && previous !== owner) { + throw new Error( + `[route modules] ${context.declaration.packageName}: the full path "${fullPath}" is used by both ${previous} and ${owner}. Mount the module at another path.`, + ) + } + owners.set(key, owner) + } + for (const node of acc.routeNodes) { + if (!node.children?.length && node._fsRouteType !== 'lazy') { + claim(inferFullPath(node), `"${node.filePath}"`) + } + } + for (const { mount, prefix } of placements) { + for (const route of mount.manifest.routes) { + if (route.leaf) { + claim( + `${prefix}${route.fullPath}`, + `"${getInstallationRouteId(mount, route.id)}" (module "${mount.key}")`, + ) + } + } + } + + const mountPaths = this.getRouteModuleMountPaths(placements) + for (const { mount, node } of placements) { + const host = node.parent + const hostParams = new Set( + getParamNames( + parseSegments(false, { from: host ? inferFullPath(host) : '' }, 0), + ), + ) + for (const route of mount.manifest.routes) { + const overlap = getParamNames( + parseSegments(false, { from: route.fullPath }, 0), + ).find((param) => hostParams.has(param)) + if (overlap) { + throw new Error( + `[route modules] ${context.declaration.packageName}: parameter "${overlap}" appears both above "${mount.key}" and in its route "${route.id}". Choose distinct host and module parameter names.`, + ) + } + } + for (const installed of mount.installed) { + const own = mountPaths.get(installed.key)! + for (const used of installed.uses) { + const named = this.describeNamedInstallations(used) + if (named !== undefined) { + // Links into a named installation: see `getRouteModuleUses`. + if (installed.id !== mount.moduleId) { + throw new Error( + `[route modules] ${context.declaration.packageName}: "${installed.id}" links into "${used}", which this application installs ${named}, but "${installed.id}" is installed by "${mount.moduleId}", which cannot choose an installation. Install "${installed.id}" in this application.`, + ) + } + continue + } + const target = mountPaths.get(used) + if (target === undefined) { + continue + } + const hostPath = getHostPath(target) + if (hostPath === undefined) { + continue + } + if (own !== hostPath && !own.startsWith(`${hostPath}/`)) { + throw new Error( + `[route modules] ${context.declaration.packageName}: "${installed.id}" links into "${used}", which is mounted below "${hostPath}", but "${installed.id}" is mounted at "${own}" and cannot fill those path params. Mount "${installed.id}" below "${hostPath}", or link into "${used}" from the package that mounts it.`, + ) + } + } + } + } + } + + /** + * How this application installs a module it installs with names: `several + * times`, or `as ""` for one named installation. `undefined` when it + * is not installed with a name. Only a direct mount can link into a named + * installation: the runtime reads the choice from the mount. + */ + private describeNamedInstallations(moduleId: string): string | undefined { + const named = (this.routeModuleContext?.mounts ?? []).filter( + (mount) => mount.moduleId === moduleId && mount.as !== undefined, + ) + return named.length === 0 + ? undefined + : named.length > 1 + ? 'several times' + : `as "${named[0]!.as}"` + } + + /** + * Full paths of every installed module root in this route tree, by + * installation key, without trailing slash. + */ + private getRouteModuleMountPaths(placements: Array) { + const mountPaths = new Map() + for (const { mount, prefix } of placements) { + for (const installed of mount.installed) { + mountPaths.set( + installed.key, + `${prefix}${installed.mountPath.replace(/\/$/, '')}` || '/', + ) + } + } + return mountPaths + } + + /** + * The installation a mounted module links into for every module it uses + * that this application installs with names: the one whose host routes are + * above the module, so that links fill their path params from the current + * location. None or several such installations are errors. + */ + private getRouteModuleUses(placements: Array) { + const context = this.routeModuleContext + const uses = new Map>() + if (!context || !context.mounts.some((mount) => mount.as !== undefined)) { + return uses + } + const mountPaths = this.getRouteModuleMountPaths(placements) + for (const { mount } of placements) { + const own = mountPaths.get(mount.key)! + const root = mount.installed.find( + (installed) => installed.id === mount.moduleId, + ) + for (const used of root?.uses ?? []) { + const named = this.describeNamedInstallations(used) + if (named === undefined) { + continue + } + const installations = context.mounts.filter((candidate) => { + if (candidate.moduleId !== used) { + return false + } + const host = getHostPath(mountPaths.get(candidate.key)!) + return ( + host === undefined || own === host || own.startsWith(`${host}/`) + ) + }) + if (installations.length !== 1) { + const problem = + installations.length > 1 + ? `the installations ${installations.map((installation) => `"${installation.as}"`).join(' and ')} can take path params from "${own}"` + : named === 'several times' + ? `no installation can take path params from "${own}"` + : `it cannot take path params from "${own}"` + throw new Error( + `[route modules] ${context.declaration.packageName}: "${mount.key}" links into "${used}", which is installed ${named}, but ${problem}. Mount "${mount.key}" below the routes with the path params of ${named === 'several times' ? 'exactly one' : 'that'} installation.`, + ) + } + uses.set(mount.key, { + ...uses.get(mount.key), + [used]: installations[0]!.key, + }) + } + } + return uses + } + + /** + * Generated files of route modules and of applications that mount them are + * type-checked (mount assertions, declaration emit), so the default header + * leaves out `@ts-nocheck`. A custom header is used as is. + */ + private getGeneratedFileHeader(config: Config): Array { + const header = config.routeTreeFileHeader + if ( + !this.routeModuleContext || + config.disableTypes || + header.length !== DEFAULT_ROUTE_TREE_FILE_HEADER.length || + header.some((line, i) => line !== DEFAULT_ROUTE_TREE_FILE_HEADER[i]) + ) { + return header + } + return header.filter((line) => line !== '// @ts-nocheck') + } + + /** Path of a generated route-module file next to the route tree. */ + private getRouteModuleFilePath(baseName: string) { + return path.join( + path.dirname(this.generatedRouteTreePath), + `${baseName}.ts`, + ) + } + + /** Import specifier of a generated route-module file from `fromFile`. */ + private getRouteModuleImport(fromFile: string, baseName: string) { + const relative = replaceBackslash( + removeExt( + path.relative( + path.dirname(fromFile), + this.getRouteModuleFilePath(baseName), + ), + this.config.addExtensions, + ), + ) + return relative.startsWith('.') ? relative : `./${relative}` + } + + /** + * In a route module, route files get qualified ids and import their route + * factories from the module's scope. + */ + private getRouteFileModuleScope( + node: RouteNode, + ): { routeId: string; importSource: string } | undefined { + const context = this.routeModuleContext + if (context?.declaration.mode !== 'module') { + return undefined + } + const moduleId = context.declaration.moduleId! + return { + routeId: + node._fsRouteType === '__root' + ? `${moduleId}:` + : `${moduleId}:${node.routePath ?? ''}`, + importSource: this.getRouteModuleImport(node.fullPath, ROUTE_SCOPE_FILE), + } + } + public async getCrawlingResult(): Promise { await this.runPromise return this.crawlingResult @@ -1635,6 +2803,15 @@ ${acc.routeTree.map((child) => `${child.variableName}Route: typeof ${getResolved return true } + // package.json and the manifests of route modules this package mounts or + // uses, which change the generated route-module files, and those files + if ( + this.routeModuleFiles.has(filePath) || + this.generatedRouteModuleFiles?.has(filePath) + ) { + return true + } + // the virtual route config file passed into `virtualRouteConfig` if ( typeof this.config.virtualRouteConfig === 'string' && diff --git a/packages/router-generator/src/index.ts b/packages/router-generator/src/index.ts index 9a4f8a17ff..fc58a31f97 100644 --- a/packages/router-generator/src/index.ts +++ b/packages/router-generator/src/index.ts @@ -46,3 +46,37 @@ export { getRouteNodes as virtualGetRouteNodes } from './filesystem/virtual/getR export { rootPathId } from './filesystem/physical/rootPathId' export type { TransformContext, TransformOptions } from './transform/types' + +export { + getManifestPath as getRouteModuleManifestPath, + readManifest as readRouteModuleManifest, +} from './route-module/manifest' +export type { + ManifestInstalledModule, + ManifestRoute, + RouteModuleManifest, +} from './route-module/manifest' +export { + getInstalledRouteModuleDirectories, + resolveRouteModuleContext, +} from './route-module/context' +export type { + ResolvedMount, + RouteModuleContext, + ScopeModule, +} from './route-module/context' +export type { + ModuleDeclaration, + RouteModuleDeclaration, + RouteModulesOption, +} from './route-module/declaration' +export type { + RouteScopeNamespace, + RouteScopeNamespaceFile, + RouteScopeNamespaceFiles, +} from './route-module/emit' + +export { + isServerOnlyNode, + pruneServerOnlySubtrees, +} from './pruneServerOnlySubtrees' diff --git a/packages/start-plugin-core/src/start-router-plugin/pruneServerOnlySubtrees.ts b/packages/router-generator/src/pruneServerOnlySubtrees.ts similarity index 70% rename from packages/start-plugin-core/src/start-router-plugin/pruneServerOnlySubtrees.ts rename to packages/router-generator/src/pruneServerOnlySubtrees.ts index e5b995ede5..74b48bfb7e 100644 --- a/packages/start-plugin-core/src/start-router-plugin/pruneServerOnlySubtrees.ts +++ b/packages/router-generator/src/pruneServerOnlySubtrees.ts @@ -1,8 +1,12 @@ -import { SERVER_PROP } from './constants' -import type { - HandleNodeAccumulator, - RouteNode, -} from '@tanstack/router-generator' +import type { HandleNodeAccumulator, RouteNode } from './types' + +/** A route with a `server` option and nothing else: it has no client part. */ +export function isServerOnlyNode(node: RouteNode | undefined): boolean { + return ( + node?.createFileRouteProps?.has('server') === true && + node.createFileRouteProps.size === 1 + ) +} export function pruneServerOnlySubtrees({ rootRouteNode, @@ -38,10 +42,7 @@ function prune( } } - const allServerOnly = - node.createFileRouteProps?.has(SERVER_PROP) && - node.createFileRouteProps.size === 1 && - allChildrenServerOnly + const allServerOnly = isServerOnlyNode(node) && allChildrenServerOnly // prune this subtree if (allServerOnly) { return null diff --git a/packages/router-generator/src/route-module/context.ts b/packages/router-generator/src/route-module/context.ts new file mode 100644 index 0000000000..a628b8684b --- /dev/null +++ b/packages/router-generator/src/route-module/context.ts @@ -0,0 +1,768 @@ +import crypto from 'node:crypto' +import { existsSync, realpathSync } from 'node:fs' +import path from 'node:path' +import { cleanPath } from '@tanstack/router-core' +import { generatedPublicNames } from '../generated-names' +import { getManifestPath, readManifest } from './manifest' +import { + findPackageRoot, + getDefaultNamespace, + getInstallationKey, + readRouteModuleDeclaration, + resolveModulePackageRoot, +} from './declaration' +import type { ManifestInstalledModule, RouteModuleManifest } from './manifest' +import type { + ModuleInclude, + RouteModuleDeclaration, + RouteModulesOption, +} from './declaration' + +export interface ScopeModule { + moduleId: string + /** + * What the namespace addresses: the module id, or `#` for one + * installation of a module installed several times. + */ + key: string + namespace: string + /** + * Package whose contract (`/route-types`) provides the types: the + * module itself (`Router`) or the module that installs it + * (`InstalledRouters[key]`). + */ + contractPackage: string + /** + * Root ids whose matches the namespace's match guard accepts: the module's + * own root and the roots of the modules installed below it. + */ + matchRoots: Array + /** + * Set when path params lie above the module in this package's route tree: + * the module this package mounts on the way to it (itself when mounted + * directly). Links through its namespace then pass those params. + */ + hostedThrough?: string +} + +/** + * A module installed in another module's subtree, as `manifest.modules` lists + * it. Used modules are described from their package.json files, which know + * no mount paths. + */ +export type DeclaredInstallation = Pick< + ManifestInstalledModule, + 'id' | 'key' | 'includedBy' +> + +export interface ResolvedMount { + include: ModuleInclude + moduleId: string + /** The module id, or `#` when it is installed several times. */ + key: string + /** The installation name of a module installed several times. */ + as: string | undefined + packageRoot: string + manifest: RouteModuleManifest + /** + * `manifest.modules` as this package installs them: the mounted module + * itself under its installation key, included by this package. + */ + installed: Array + /** Current real paths resolved through the provider dependency graph. */ + routeFiles: Array<{ file: string; routeId: string }> + clientTrees: Array<{ filePath: string; clientFilePath: string }> + /** Static mount path relative to the parent (`undefined`: pathless). */ + at: string | undefined +} + +/** TanStack Start usage of a package. */ +export interface RouteModuleStart { + /** The framework's Start package (`@tanstack/react-start`). */ + package: string + /** + * The Start file next to the route tree, if any: a module's fragment + * (`export const start`) or an application's `startInstance`. + */ + file: string | undefined +} + +export interface RouteModuleContext { + declaration: RouteModuleDeclaration + /** Allocated private binding families shared by this generation. */ + identifiers: Map + mounts: Array + /** Set when the package depends on the framework's Start package. */ + start: RouteModuleStart | undefined + /** Mounted modules whose runtime entry exports Start fragments. */ + startMounts: Array + /** + * Whether this module's runtime entry exports `startModules`: it has a + * fragment or mounts modules that export fragments. + */ + exportsStartModules: boolean + /** Mounted modules, whose installed routes are visible by id. */ + includedContracts: Array + /** Modules this package uses without mounting them: they get stand-ins in the declaration build. */ + usedContracts: Array + /** Modules with a generated namespace. */ + scope: Array + /** Changes whenever the generated output may change. */ + hash: string +} + +function fail(declaration: RouteModuleDeclaration, message: string): never { + throw new Error(`[route modules] ${declaration.packageName}: ${message}`) +} + +function memoize( + cache: Map, + key: TKey, + compute: () => TValue, +): TValue { + if (!cache.has(key)) { + cache.set(key, compute()) + } + return cache.get(key) as TValue +} + +/** + * Resolves the packages and files one generation needs, each once: the + * includes of every used module are walked from the same files the mounts are + * read from. An invalid declaration throws, naming its file. + */ +function createDeclarationReader() { + const roots = new Map() + const declarations = new Map() + const realpaths = new Map() + return { + realpath: (file: string) => + memoize(realpaths, file, () => realpathSync(file)), + /** The package root of `moduleId` as seen from `fromPackageRoot`. */ + resolve: (moduleId: string, fromPackageRoot: string) => + memoize(roots, `${fromPackageRoot}\0${moduleId}`, () => + resolveModulePackageRoot(moduleId, fromPackageRoot), + ), + /** The module declaration at `packageRoot`; `undefined` for other packages. */ + read: (packageRoot: string) => + memoize(declarations, packageRoot, () => { + const declaration = readRouteModuleDeclaration(packageRoot, undefined) + return declaration?.mode === 'module' ? declaration : undefined + }), + } +} + +type DeclarationReader = ReturnType + +/** Resolves and validates a module this package declares in `includes` or `uses`. */ +function resolveDeclaredModule( + declaration: RouteModuleDeclaration, + reader: DeclarationReader, + moduleId: string, + relation: 'includes' | 'uses', + onFile: ((file: string) => void) | undefined, +): RouteModuleDeclaration { + if (moduleId === declaration.moduleId) { + fail( + declaration, + `a module cannot ${relation === 'includes' ? 'include' : 'use'} itself.`, + ) + } + // A mounted module runs in the package: it must be a runtime dependency. A + // used module only needs to be resolvable for its types. + const declared = + relation === 'includes' + ? declaration.dependencies + : [...declaration.dependencies, ...declaration.devDependencies] + if (!declared.includes(moduleId)) { + fail( + declaration, + `"${moduleId}" is listed in "${relation}" but is not a dependency. Add it to ${ + relation === 'includes' + ? '"dependencies" (or "peerDependencies")' + : '"dependencies", "devDependencies" or "peerDependencies"' + } in package.json.`, + ) + } + const packageRoot = reader.resolve(moduleId, declaration.packageRoot) + if (!packageRoot) { + fail( + declaration, + `cannot resolve "${moduleId}" from "${declaration.packageRoot}". Install the workspace dependencies.`, + ) + } + onFile?.(path.join(packageRoot, 'package.json')) + const resolved = reader.read(packageRoot) + if (!resolved) { + fail( + declaration, + `"${moduleId}" is not a route module: its package.json has no "tanstack.router.module".`, + ) + } + return resolved +} + +/** + * Walks `includes` from `root` through package.json files and reports every + * installed module as `manifest.modules` lists it. Include cycles have no + * generation order and are rejected here, before any manifest is read; + * otherwise they would surface as the missing manifest of whichever module + * generates first. Unresolvable includes are left to their includer's own + * generation. + */ +function walkIncludes( + declaration: RouteModuleDeclaration, + root: RouteModuleDeclaration, + reader: DeclarationReader, + onInclude: ( + installed: DeclaredInstallation, + packageRoot: string | undefined, + ) => void, +) { + const visit = (current: RouteModuleDeclaration, chain: Array) => { + for (const include of current.includes) { + if (include.moduleId === current.moduleId) { + // Self-includes get their own diagnostic. + continue + } + const start = chain.indexOf(include.moduleId) + if (start !== -1) { + const cycle = [...chain.slice(start), include.moduleId] + fail( + declaration, + `${cycle + .map((id, index) => + index === 0 + ? `"${id}" includes` + : index === cycle.length - 1 + ? `"${id}"` + : `"${id}", which includes`, + ) + .join( + ' ', + )}. Route modules cannot include each other; link into another module's routes with "uses".`, + ) + } + const packageRoot = reader.resolve(include.moduleId, current.packageRoot) + onInclude( + { + id: include.moduleId, + key: getInstallationKey(include.moduleId, include.as), + includedBy: current.packageName, + }, + packageRoot, + ) + const next = packageRoot && reader.read(packageRoot) + if (next) { + visit(next, [...chain, include.moduleId]) + } + } + } + visit(root, [root.moduleId ?? root.packageName]) +} + +function hasPathParams(path: string) { + return /\$/.test(path) +} + +/** The part of a full path up to its last segment with path params. */ +export function getHostPath(fullPath: string): string | undefined { + return /^.*\$[^/]*/.exec(fullPath)?.[0] +} + +/** + * The id of a module route in the installation of `mount`: + * `#:/…` for `:/…` when the module is installed + * several times. + */ +export function getInstallationRouteId( + mount: ResolvedMount, + routeId: string, +): string { + return mount.as !== undefined && routeId.startsWith(`${mount.moduleId}:`) + ? mount.key + routeId.slice(mount.moduleId.length) + : routeId +} + +/** + * Resolves everything a generator run needs about route modules: the package's + * own declaration, the modules it mounts and the modules visible in its scope. + */ +export function resolveRouteModuleContext(opts: { + root: string + routeModules: RouteModulesOption | undefined + /** Publish candidate watch paths even when a provider is not generated yet. */ + onWatchFile?: (file: string) => void + /** + * The framework's Start package (`@tanstack/react-start`) and the directory + * of the generated route tree, where a Start file lives. Callers that only + * need the mounted modules omit them. + */ + start?: { package: string; generatedDirectory: string } +}): RouteModuleContext | undefined { + const declaration = readRouteModuleDeclaration(opts.root, opts.routeModules) + if (!declaration) { + return undefined + } + const reader = createDeclarationReader() + // Rejects include cycles; the files it reads serve the mounts below. + walkIncludes(declaration, declaration, reader, () => {}) + + const scope = new Map() + const namespaceOwners = new Map() + + /** + * Gives a module a namespace. `installed` lists the modules the contract + * package installs: the namespace's match guard accepts the module's routes + * and those of the modules installed below it. + */ + const addToScope = ( + moduleId: string, + namespace: string, + contractPackage: string, + installed: Array, + hostedThrough?: string, + key = moduleId, + ) => { + if (scope.has(key)) { + return + } + if ( + !/^[A-Za-z_$][\w$]*$/.test(namespace) || + generatedPublicNames.includes(namespace as any) || + [ + 'default', + 'import', + 'export', + 'class', + 'function', + 'const', + 'let', + 'var', + 'new', + 'return', + 'delete', + 'void', + 'typeof', + 'instanceof', + 'in', + 'yield', + 'await', + 'enum', + 'implements', + 'interface', + 'package', + 'private', + 'protected', + 'public', + 'static', + 'null', + 'true', + 'false', + 'this', + 'super', + 'extends', + 'try', + 'catch', + 'finally', + 'throw', + 'if', + 'else', + 'for', + 'while', + 'switch', + 'case', + 'break', + 'continue', + 'do', + 'with', + 'debugger', + ].includes(namespace) + ) { + fail( + declaration, + `the namespace "${namespace}" is not an available JavaScript identifier. Choose a different "as" that does not conflict with generated routing exports.`, + ) + } + const owner = namespaceOwners.get(namespace) + if (owner !== undefined) { + fail( + declaration, + `the modules "${owner}" and "${moduleId}" both get the namespace "${namespace}". Choose another one with "as".`, + ) + } + namespaceOwners.set(namespace, moduleId) + const matchRoots = new Set([`${key}:`]) + const addBelow = (includer: string) => { + for (const entry of installed) { + if (entry.includedBy === includer) { + matchRoots.add(`${entry.key}:`) + addBelow(entry.id) + } + } + } + addBelow(moduleId) + scope.set(key, { + moduleId, + key, + namespace, + contractPackage, + matchRoots: [...matchRoots], + hostedThrough, + }) + } + + /** + * Adds the modules installed by a dependency. `hostedThrough` names the + * installation whose host params links through the namespace must pass. + * The dependency itself and this package (which a used module may include) + * get no entry. + */ + const addInstalledSubtree = ( + contractPackage: string, + installed: Array, + hostedThrough?: (entry: T) => string | undefined, + ) => { + for (const entry of installed) { + if (entry.id === contractPackage || entry.id === declaration.moduleId) { + continue + } + addToScope( + entry.id, + getDefaultNamespace(entry.id), + contractPackage, + installed, + hostedThrough?.(entry), + entry.key, + ) + } + } + + // Modules this package mounts. A module included several times is + // installed once per include, each named with `as`. + const mounts: Array = [] + const installedSeveralTimes = new Set( + declaration.includes + .map((include) => include.moduleId) + .filter((moduleId, index, all) => all.indexOf(moduleId) !== index), + ) + for (const moduleId of installedSeveralTimes) { + if (declaration.mode === 'module') { + fail( + declaration, + `"${moduleId}" is included more than once. Only an application can install a route module several times.`, + ) + } + const names = new Set() + for (const include of declaration.includes) { + if (include.moduleId !== moduleId) { + continue + } + if (include.as !== undefined && names.has(include.as)) { + fail( + declaration, + `two installations of "${moduleId}" are named "${include.as}". Name each installation with its own "as".`, + ) + } + names.add(include.as!) + if (include.as === undefined) { + fail( + declaration, + `"${moduleId}" is included more than once. Name every installation with "as".`, + ) + } + // `as` names the installation's namespace. + if (!/^[A-Za-z_$][\w$]*$/.test(include.as)) { + fail( + declaration, + `the installation "${include.as}" of "${moduleId}" must be named with a JavaScript identifier.`, + ) + } + } + } + for (const include of declaration.includes) { + // A mounted module's manifest describes the subtree this package installs. + const { packageRoot } = resolveDeclaredModule( + declaration, + reader, + include.moduleId, + 'includes', + opts.onWatchFile, + ) + opts.onWatchFile?.(getManifestPath(packageRoot)) + const manifest = readManifest(packageRoot) + if (!manifest) { + fail( + declaration, + `"${include.moduleId}" has no route module manifest at "${getManifestPath(packageRoot)}". Run "tsr generate" in "${packageRoot}" first (for example with a "dependsOn": ["^generate"] task dependency).`, + ) + } + const at = + include.at === undefined + ? undefined + : cleanPath(`/${include.at}`).replace(/\/$/, '') || undefined + if (at !== undefined && hasPathParams(at)) { + fail( + declaration, + `"${include.moduleId}" must be mounted at a static path, but "${at}" has path params.`, + ) + } + const as = include.as + if ( + installedSeveralTimes.has(include.moduleId) && + manifest.modules.length > 1 + ) { + fail( + declaration, + `"${include.moduleId}" installs other route modules, so it can be installed only once.`, + ) + } + const key = getInstallationKey(include.moduleId, as) + const installed = manifest.modules.map((entry) => + entry.id === include.moduleId + ? { ...entry, key, includedBy: declaration.packageName } + : { ...entry, includedBy: entry.includedBy ?? declaration.packageName }, + ) + mounts.push({ + include, + moduleId: include.moduleId, + key, + as, + packageRoot, + manifest, + installed, + routeFiles: manifest.routeFiles.map(({ owner, file, routeId }) => ({ + file: resolveManifestFile(reader, packageRoot, owner, file), + routeId, + })), + clientTrees: manifest.clientTrees.map(({ owner, file, clientFile }) => ({ + filePath: resolveManifestFile(reader, packageRoot, owner, file), + clientFilePath: resolveManifestFile( + reader, + packageRoot, + owner, + clientFile, + ), + })), + at: + at === undefined || at === '/' || at === '' + ? undefined + : `/${at.replace(/^\/+|\/+$/g, '')}`, + }) + // Route ids contain the path params of their own and their parents' paths. + const hostParams = hasPathParams(include.parent ?? '') + addToScope( + include.moduleId, + include.namespace, + include.moduleId, + installed, + hostParams ? key : undefined, + key, + ) + addInstalledSubtree(include.moduleId, installed, (entry) => + hostParams || hasPathParams(entry.mountPath) ? key : undefined, + ) + } + + // A module installed twice in the tree is ambiguous, unless every + // installation is named. + const installedBy = new Map() + for (const mount of mounts) { + for (const entry of mount.installed) { + if (entry.id === mount.moduleId && mount.as !== undefined) { + installedBy.set(mount.key, declaration.packageName) + continue + } + const previous = installedBy.get(entry.id) + if (previous !== undefined) { + fail( + declaration, + `"${entry.id}" is installed twice: by "${previous}" and by "${entry.includedBy}". A route module can be mounted once per route tree.`, + ) + } + installedBy.set(entry.id, entry.includedBy) + } + } + + // Modules this package references without mounting them. They are read + // from package.json files only: their contracts enter the type program + // through the generated namespaces, never the generation itself, so two + // modules can use each other and generate in any order. + const uses = declaration.uses + const usedContracts: Array = [] + for (const use of uses) { + if (mounts.some((mount) => mount.moduleId === use.moduleId)) { + continue + } + const used = resolveDeclaredModule( + declaration, + reader, + use.moduleId, + 'uses', + opts.onWatchFile, + ) + const installed: Array = [] + walkIncludes(declaration, used, reader, (entry, packageRoot) => { + installed.push(entry) + if (packageRoot) { + opts.onWatchFile?.(path.join(packageRoot, 'package.json')) + } + }) + if (installedBy.has(use.moduleId)) { + // Already visible through the module that installs it. + continue + } + usedContracts.push(use.moduleId) + addToScope(use.moduleId, use.namespace, use.moduleId, installed) + addInstalledSubtree(use.moduleId, installed) + } + + // The final application must install every module that is used. + if (declaration.mode === 'host') { + for (const mount of mounts) { + for (const entry of mount.installed) { + for (const used of entry.uses) { + if ( + !installedBy.has(used) && + !mounts.some((mount) => mount.moduleId === used) + ) { + fail( + declaration, + `"${entry.id}" uses routes of "${used}", which is not installed. Add "${used}" to the "includes" of this application or of one of its modules.`, + ) + } + } + } + } + for (const use of uses) { + if ( + !installedBy.has(use.moduleId) && + !mounts.some((mount) => mount.moduleId === use.moduleId) + ) { + fail( + declaration, + `this application uses routes of "${use.moduleId}", which is not installed. Add it to "includes".`, + ) + } + } + } + + // TanStack Start: fragments are composed upward to the application. + const startOptions = opts.start + const startFileCandidates = startOptions + ? ['start.ts', 'start.tsx'].map((file) => + path.join(startOptions.generatedDirectory, file), + ) + : [] + for (const file of startFileCandidates) { + opts.onWatchFile?.(file) + } + const start: RouteModuleStart | undefined = + startOptions && declaration.dependencies.includes(startOptions.package) + ? { + package: startOptions.package, + file: startFileCandidates.find((file) => existsSync(file)), + } + : undefined + const startMounts = [ + ...new Set( + mounts + .filter((mount) => mount.manifest.startModules) + .map((mount) => mount.moduleId), + ), + ] + if (startOptions && declaration.mode === 'host' && startMounts.length > 0) { + if (!start) { + fail( + declaration, + `"${startMounts[0]}" has a TanStack Start fragment. Install it in a TanStack Start application, which depends on "${startOptions.package}".`, + ) + } + if (!start.file) { + fail( + declaration, + `"${startMounts[0]}" has a TanStack Start fragment. Install it in "${startFileCandidates[0]}": export const startInstance = createStart(() => ({ extends: startModules })), with startModules from "./startModules.gen".`, + ) + } + } + const exportsStartModules = + declaration.mode === 'module' && (!!start?.file || startMounts.length > 0) + + const hash = crypto + .createHash('sha256') + .update( + JSON.stringify({ + // Dependency lists only gate diagnostics; they do not shape output. + declaration: { + mode: declaration.mode, + moduleId: declaration.moduleId, + packageName: declaration.packageName, + includes: declaration.includes, + uses: declaration.uses, + }, + mounts: mounts.map((mount) => [ + mount.key, + mount.include.parent, + mount.at, + mount.manifest.topologyToken, + ]), + scope: [...scope.values()], + start, + }), + ) + .digest('hex') + .slice(0, 16) + + return { + declaration, + identifiers: new Map(), + mounts, + start, + startMounts, + exportsStartModules, + includedContracts: [...new Set(mounts.map((mount) => mount.moduleId))], + usedContracts, + scope: [...scope.values()], + hash, + } +} + +/** + * The package roots of every route module installed by a package (directly or + * through other modules): their files are compiled as part of the application. + */ +export function getInstalledRouteModuleDirectories( + context: RouteModuleContext | undefined, +): Array { + const directories = new Set() + for (const mount of context?.mounts ?? []) { + directories.add(mount.packageRoot) + for (const { file } of mount.routeFiles) { + const packageRoot = findPackageRoot(path.dirname(file)) + if (packageRoot) { + directories.add(packageRoot) + } + } + } + return [...directories] +} + +/** Resolve portable paths from each provider's own dependency context. */ +function resolveManifestFile( + reader: DeclarationReader, + packageRoot: string, + owner: Array, + file: string, +) { + let root = packageRoot + for (const packageName of owner) { + const next = reader.resolve(packageName, root) + if (!next) { + throw new Error( + `[route modules] Cannot resolve route source owner "${packageName}" from "${root}". Install the provider dependencies and regenerate its manifest.`, + ) + } + root = next + } + return reader.realpath(path.resolve(root, file)) +} diff --git a/packages/router-generator/src/route-module/declaration.ts b/packages/router-generator/src/route-module/declaration.ts new file mode 100644 index 0000000000..4e18ad58c2 --- /dev/null +++ b/packages/router-generator/src/route-module/declaration.ts @@ -0,0 +1,262 @@ +import path from 'node:path' +import { existsSync, readFileSync, realpathSync } from 'node:fs' +import { createRequire } from 'node:module' +import { z } from 'zod' + +const moduleReferenceSchema = z.union([ + z.string(), + z.object({ + module: z.string(), + /** Name of the generated namespace for this module. */ + as: z.string().optional(), + }), +]) + +const includeSchema = z.union([ + z.string(), + z.object({ + module: z.string(), + /** Id of the host route the module is mounted under (default: the root). */ + parent: z.string().optional(), + /** Static path of the module root relative to `parent`. */ + at: z.string().optional(), + /** + * Name of the generated namespace, and of the installation when the + * module is included more than once. + */ + as: z.string().optional(), + }), +]) + +/** `routeModules` generator option: the modules an application installs. */ +export const routeModulesOptionSchema = z.object({ + includes: z.array(includeSchema).optional(), + uses: z.array(moduleReferenceSchema).optional(), +}) + +/** `tanstack.router.module` in a package's `package.json`. */ +export const moduleDeclarationSchema = z.union([ + z.literal(true), + routeModulesOptionSchema, +]) + +export type RouteModulesOption = z.infer +export type ModuleDeclaration = z.infer + +export interface ModuleReference { + moduleId: string + namespace: string +} + +export interface ModuleInclude extends ModuleReference { + parent?: string + at?: string + /** The `as` of the include, if given. */ + as?: string +} + +/** + * The route-module role of the package a generator runs for: + * - `module`: the package is a route module (`tanstack.router.module`); its + * routes have qualified ids and it publishes a contract. + * - `host`: an application that installs route modules (`routeModules` + * option); its own routes are unchanged. + */ +export interface RouteModuleDeclaration { + mode: 'module' | 'host' + packageRoot: string + packageName: string + /** Module id (module mode). */ + moduleId?: string + includes: Array + /** Modules whose routing APIs this package explicitly consumes. */ + uses: Array + /** `dependencies` and `peerDependencies`: what the package needs at runtime. */ + dependencies: Array + /** `devDependencies`: enough to resolve a module the package only uses. */ + devDependencies: Array +} + +interface PackageJson { + name?: string + dependencies?: Record + peerDependencies?: Record + devDependencies?: Record + tanstack?: { router?: { module?: unknown } } +} + +export function findPackageRoot(start: string): string | undefined { + let dir = path.resolve(start) + for (;;) { + if (existsSync(path.join(dir, 'package.json'))) { + return dir + } + const parent = path.dirname(dir) + if (parent === dir) { + return undefined + } + dir = parent + } +} + +export function readPackageJson(packageRoot: string): PackageJson { + return JSON.parse( + readFileSync(path.join(packageRoot, 'package.json'), 'utf8'), + ) +} + +/** + * The default namespace of a module: the last segment of its package name, + * camel-cased (`@acme/user-account` -> `userAccount`). + */ +export function getDefaultNamespace(moduleId: string): string { + const lastSegment = moduleId.split('/').pop()! + const camel = lastSegment.replace(/[-_.]+([a-zA-Z0-9])/g, (_, c: string) => + c.toUpperCase(), + ) + const identifier = camel.replace(/[^a-zA-Z0-9_$]/g, '') + return /^[0-9]/.test(identifier) ? `_${identifier}` : identifier +} + +function toReference(reference: z.infer) { + const moduleId = typeof reference === 'string' ? reference : reference.module + return { + moduleId, + namespace: + (typeof reference === 'string' ? undefined : reference.as) ?? + getDefaultNamespace(moduleId), + } +} + +function toInclude(include: z.infer): ModuleInclude { + if (typeof include === 'string') { + return toReference(include) + } + return { + ...toReference({ module: include.module, as: include.as }), + parent: include.parent, + at: include.at, + as: include.as, + } +} + +function formatZodError(error: z.ZodError) { + return error.issues + .map((issue) => `${issue.path.join('.') || ''}: ${issue.message}`) + .join('; ') +} + +/** + * Reads the route-module declaration of the package that contains `root`, or + * returns `undefined` for an ordinary application. + */ +export function readRouteModuleDeclaration( + root: string, + inlineOption: RouteModulesOption | undefined, +): RouteModuleDeclaration | undefined { + const packageRoot = findPackageRoot(root) + const packageJson = packageRoot ? readPackageJson(packageRoot) : undefined + const rawDeclaration = packageJson?.tanstack?.router?.module + + if (rawDeclaration === undefined && inlineOption === undefined) { + return undefined + } + + if (!packageRoot || !packageJson) { + throw new Error( + `Route modules require a package.json, but none was found above "${root}".`, + ) + } + const packageName = packageJson.name + if (!packageName) { + throw new Error( + `Route modules require a package name in "${path.join(packageRoot, 'package.json')}".`, + ) + } + + const dependencies = [ + ...Object.keys(packageJson.dependencies ?? {}), + ...Object.keys(packageJson.peerDependencies ?? {}), + ] + const devDependencies = Object.keys(packageJson.devDependencies ?? {}) + + if (rawDeclaration !== undefined) { + if (inlineOption !== undefined) { + throw new Error( + `"${packageName}" declares "tanstack.router.module" in its package.json and also passes "routeModules" to the router generator. Declare its modules in one place: package.json for route modules, the "routeModules" option only for applications.`, + ) + } + const parsed = moduleDeclarationSchema.safeParse(rawDeclaration) + if (!parsed.success) { + throw new Error( + `Invalid "tanstack.router.module" in "${path.join(packageRoot, 'package.json')}": ${formatZodError(parsed.error)}`, + ) + } + const declaration = parsed.data === true ? {} : parsed.data + return { + mode: 'module', + packageRoot, + packageName, + moduleId: packageName, + includes: (declaration.includes ?? []).map(toInclude), + uses: (declaration.uses ?? []).map(toReference), + dependencies, + devDependencies, + } + } + + const parsed = routeModulesOptionSchema.safeParse(inlineOption) + if (!parsed.success) { + throw new Error( + `Invalid "routeModules" option: ${formatZodError(parsed.error)}`, + ) + } + return { + mode: 'host', + packageRoot, + packageName, + includes: (parsed.data.includes ?? []).map(toInclude), + uses: (parsed.data.uses ?? []).map(toReference), + dependencies, + devDependencies, + } +} + +/** + * Resolves the package root of `moduleId` as seen from `fromPackageRoot`, + * following symlinks (pnpm workspace links) to the real directory. + */ +export function resolveModulePackageRoot( + moduleId: string, + fromPackageRoot: string, +): string | undefined { + const require = createRequire(path.join(fromPackageRoot, 'package.json')) + try { + return path.dirname( + realpathSync(require.resolve(`${moduleId}/package.json`)), + ) + } catch { + // Packages without `"./package.json"` in their exports cannot be read + // through the resolver; fall back to the node_modules link. + let dir = fromPackageRoot + for (;;) { + const candidate = path.join(dir, 'node_modules', moduleId, 'package.json') + if (existsSync(candidate)) { + return path.dirname(realpathSync(candidate)) + } + const parent = path.dirname(dir) + if (parent === dir) { + return undefined + } + dir = parent + } + } +} + +/** + * The identity of an installation: the module id, or `#` when + * the include names it. + */ +export function getInstallationKey(moduleId: string, as: string | undefined) { + return as === undefined ? moduleId : `${moduleId}#${as}` +} diff --git a/packages/router-generator/src/route-module/emit.ts b/packages/router-generator/src/route-module/emit.ts new file mode 100644 index 0000000000..66ae0dcef1 --- /dev/null +++ b/packages/router-generator/src/route-module/emit.ts @@ -0,0 +1,653 @@ +import path from 'node:path' +import { replaceBackslash } from '../utils' +import type { RouteModuleContext, ScopeModule } from './context' + +export const ROUTE_SCOPE_FILE = 'routeScope.gen' +export const ROUTE_CONTRACT_FILE = 'routeContract.gen' +export const ROUTE_MODULE_FILE = 'routeModule.gen' +export const START_MODULES_FILE = 'startModules.gen' + +/** `@acme/user-account` -> `AcmeUserAccount` */ +export function getModuleIdentifier( + moduleId: string, + identifiers?: Map, +): string { + const allocated = identifiers?.get(moduleId) + if (allocated) { + return allocated + } + const identifier = moduleId + .split(/[^a-zA-Z0-9]+/) + .filter(Boolean) + .map((part) => part[0]!.toUpperCase() + part.slice(1)) + .join('') + return /^[0-9]/.test(identifier) ? `_${identifier}` : identifier || 'Module' +} + +/** Variable of a mounted module root in a generated route tree. */ +export function getMountVariableName( + moduleId: string, + identifiers?: Map, +) { + return `${getModuleIdentifier(moduleId, identifiers)}Module` +} + +const GENERATED_NOTICE = `// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.` + +function routerTypeOf(module: ScopeModule, identifiers: Map) { + const identifier = getModuleIdentifier(module.contractPackage, identifiers) + return module.contractPackage === module.moduleId + ? `${identifier}Router` + : `${identifier}InstalledRouters['${module.key}']` +} + +/** + * The path params above a hosted module (`ScopeModule.hostedThrough`): those + * of this package's routes above the module it mounts, and the ones inside + * that module's tree for a module it installs. + */ +function hostParamsOf( + module: ScopeModule & { hostedThrough: string }, + identifiers: Map, +) { + const mounted = `MountedModuleHostParams['${module.hostedThrough}']` + return module.hostedThrough === module.key + ? mounted + : `${mounted} & ${getModuleIdentifier(module.contractPackage, identifiers)}InstalledHostParams['${module.key}']` +} + +function contractTypeImports( + scope: Array, + identifiers: Map, +) { + const byPackage = new Map>() + const add = (pkg: string, name: string) => { + const names = byPackage.get(pkg) ?? new Set() + names.add(name) + byPackage.set(pkg, names) + } + for (const module of scope) { + const identifier = getModuleIdentifier(module.contractPackage, identifiers) + add( + module.contractPackage, + module.contractPackage === module.moduleId + ? `Router as ${identifier}Router` + : `InstalledRouters as ${identifier}InstalledRouters`, + ) + if ( + module.hostedThrough !== undefined && + module.hostedThrough !== module.key + ) { + add( + module.contractPackage, + `InstalledHostParams as ${identifier}InstalledHostParams`, + ) + } + } + return [...byPackage.entries()].map( + ([pkg, names]) => + `import type { ${[...names].join(', ')} } from '${pkg}/route-types'`, + ) +} + +const scopeApis = [ + 'Link', + 'createLink', + 'linkOptions', + 'Navigate', + 'useNavigate', + 'redirect', + 'MatchRoute', + 'useMatchRoute', + 'useRouter', + 'getRouteApi', + 'useMatch', + 'useMatches', + 'useParentMatches', + 'useChildMatches', + 'useLoaderData', + 'useLoaderDeps', + 'useSearch', + 'useParams', + 'useRouteContext', + 'useLocation', + 'useRouterState', + 'useLinkProps', + 'useBlocker', + 'notFound', +] as const + +// Scope APIs that are the framework's own APIs, only typed against the +// scope's router. +const frameworkScopeApis = new Set([ + 'useMatches', + 'useParentMatches', + 'useChildMatches', + 'useLocation', + 'useRouterState', + 'useBlocker', +]) + +// Id-based scope APIs. Only the namespace of one installation of a module +// installed several times (`#`) maps the module's route ids to +// that installation; every other scope uses the framework's own APIs. +const idScopeApis = new Set([ + 'getRouteApi', + 'useMatch', + 'useLoaderData', + 'useLoaderDeps', + 'useSearch', + 'useParams', + 'useRouteContext', + 'notFound', +]) + +function scopeBindings( + frameworkPackage: string, + routerType: string, + key: string, +) { + const capitalized = (api: string) => api[0]!.toUpperCase() + api.slice(1) + // Exporting the framework's API itself costs no runtime binding. + const isFrameworkApi = (api: string) => + frameworkScopeApis.has(api) || (idScopeApis.has(api) && !key.includes('#')) + const frameworkApis = scopeApis.filter(isFrameworkApi) + const boundApis = scopeApis.filter((api) => !isFrameworkApi(api)) + return [ + `import { ${boundApis.map((api) => `bindRouteScope${capitalized(api)}`).join(', ')} } from '${frameworkPackage}/_internal/route-module'`, + `import { ${frameworkApis.map((api) => `${api} as framework${capitalized(api)}`).join(', ')} } from '${frameworkPackage}'`, + `import type { RouteScope } from '${frameworkPackage}'`, + ...scopeApis.map( + (api) => + `export const ${api}: RouteScope<${routerType}>['${api}'] = ${ + isFrameworkApi(api) + ? `framework${capitalized(api)} as never` + : `/* @__PURE__ */ bindRouteScope${capitalized(api)}<${routerType}>('${key}')` + }`, + ), + `import type { ValidateLinkOptions as RouterValidateLinkOptions, ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, ValidateNavigateOptions as RouterValidateNavigateOptions, ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, ValidateRedirectOptions as RouterValidateRedirectOptions, ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, ValidateFromPath as RouterValidateFromPath, ValidateToPath as RouterValidateToPath, ValidateSearch as RouterValidateSearch, ValidateParams as RouterValidateParams, ValidateId as RouterValidateId, ValidateUseSearchOptions as RouterValidateUseSearchOptions, ValidateUseParamsOptions as RouterValidateUseParamsOptions } from '${frameworkPackage}'`, + `export type ValidateLinkOptions = RouterValidateLinkOptions<${routerType}, TOptions, TDefaultFrom, TComp>`, + `export type ValidateLinkOptionsArray = ReadonlyArray, TDefaultFrom extends string = string, TComp = 'a'> = RouterValidateLinkOptionsArray<${routerType}, TOptions, TDefaultFrom, TComp>`, + `export type ValidateNavigateOptions = RouterValidateNavigateOptions<${routerType}, TOptions, TDefaultFrom>`, + `export type ValidateNavigateOptionsArray = ReadonlyArray, TDefaultFrom extends string = string> = RouterValidateNavigateOptionsArray<${routerType}, TOptions, TDefaultFrom>`, + `export type ValidateRedirectOptions = RouterValidateRedirectOptions<${routerType}, TOptions, TDefaultFrom>`, + `export type ValidateRedirectOptionsArray = ReadonlyArray, TDefaultFrom extends string = string> = RouterValidateRedirectOptionsArray<${routerType}, TOptions, TDefaultFrom>`, + `export type ValidateFromPath = RouterValidateFromPath<${routerType}, TFrom>`, + `export type ValidateToPath = RouterValidateToPath<${routerType}, TTo, TFrom>`, + `export type ValidateSearch = RouterValidateSearch<${routerType}, TTo, TFrom>`, + `export type ValidateParams = RouterValidateParams<${routerType}, TTo, TFrom>`, + `export type ValidateId = RouterValidateId<${routerType}, TId>`, + `export type ValidateUseSearchOptions = RouterValidateUseSearchOptions`, + `export type ValidateUseParamsOptions = RouterValidateUseParamsOptions`, + ] +} + +function scopeMatchGuard( + frameworkPackage: string, + routerType: string, + matchRoots: Array, +) { + // Every route id of a module starts with its root id, `:` or + // `#:`, and package names contain no colon. Checking + // these prefixes instead of listing every route keeps the guard small and + // accepts routes a module adds after this scope was generated. Explicitly + // named installations check their final identity. Local provider routes + // accept any installation of that provider, using the stable local id. + const local = matchRoots.filter((root) => !root.includes('#')) + const installed = matchRoots.filter((root) => root.includes('#')) + const checks = [ + ...local.map((root) => `localRouteId.startsWith(${JSON.stringify(root)})`), + ...installed.map( + (root) => `match.routeId.startsWith(${JSON.stringify(root)})`, + ), + ] + return [ + `import type { AnyRouteMatch, KnownRouteMatchUnion } from '${frameworkPackage}'`, + `/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch(match: AnyRouteMatch): match is KnownRouteMatchUnion<${routerType}> { + ${local.length ? "const localRouteId = match.localRouteId ?? ''\n " : ''}return ${checks.length ? checks.join(' || ') : 'false'} +}`, + ] +} + +/** One generated namespace, as passed to a `routeScopeNamespaceFiles` function. */ +export interface RouteScopeNamespace { + /** The namespace's identifier in the scope, such as `products`. */ + name: string + /** The id of the module it addresses. */ + moduleId: string + /** The module id, or `#` for one installation of a module. */ + key: string + /** Its position among the scope's namespaces, ordered by key. */ + index: number +} + +/** + * Where the generated files of route-module namespaces live: + * - `'indexed'`: `routeScope.gen.namespace.ts` next to the route tree; + * - `'named'`: `routeScope.gen..ts` next to the route tree; + * - `'folder'`: `routeScope.gen/.ts`; + * - a function returning the path relative to the generated route tree's + * directory, without extension. + */ +export type RouteScopeNamespaceFiles = + | 'indexed' + | 'named' + | 'folder' + | RouteScopeNamespaceFile + +/** Returns the file of a namespace, relative to the generated route tree's directory and without extension. */ +export type RouteScopeNamespaceFile = (namespace: RouteScopeNamespace) => string + +const reservedFiles = [ + ROUTE_SCOPE_FILE, + ROUTE_CONTRACT_FILE, + ROUTE_MODULE_FILE, + START_MODULES_FILE, +] + +/** The client view of the route tree, next to it. */ +export function getClientRouteTreeFile(routeTreeFile: string) { + return `${routeTreeFile}.client` +} + +/** + * The file of each namespace of the scope (by key), relative to the generated + * route tree's directory and without extension. + */ +export function getRouteNamespaceFiles( + context: RouteModuleContext, + layout: RouteScopeNamespaceFiles, + routeTreeFile: string, +): Map { + const keys = context.scope.map((entry) => entry.key).sort() + const files = new Map() + // Namespace files are distinct ignoring case, so they are portable to + // case-insensitive filesystems. + const taken = new Map( + [ + ...reservedFiles, + routeTreeFile, + getClientRouteTreeFile(routeTreeFile), + ].map((file) => [file.toLowerCase(), file]), + ) + for (const module of context.scope) { + const index = keys.indexOf(module.key) + const file = path.posix.normalize( + replaceBackslash( + layout === 'indexed' + ? `${ROUTE_SCOPE_FILE}.namespace${index}` + : layout === 'named' + ? `${ROUTE_SCOPE_FILE}.${module.namespace}` + : layout === 'folder' + ? `${ROUTE_SCOPE_FILE}/${module.namespace}` + : layout({ + name: module.namespace, + moduleId: module.moduleId, + key: module.key, + index, + }), + ), + ) + if ( + !file || + file === '.' || + path.posix.isAbsolute(file) || + path.win32.isAbsolute(file) || + file === '..' || + file.startsWith('../') + ) { + throw new Error( + `[route modules] The file of namespace "${module.namespace}" must be a path inside the directory of the generated route tree, without extension; got "${file}".`, + ) + } + const clash = taken.get(file.toLowerCase()) + if (clash !== undefined) { + throw new Error( + `[route modules] The file of namespace "${module.namespace}" ("${file}") clashes with "${clash}". Generated files must differ in more than letter case; use another "routeScopeNamespaceFiles" layout.`, + ) + } + taken.set(file.toLowerCase(), file) + files.set(module.key, file) + } + return files +} + +/** An ESM namespace preserves products.Link without retaining unused APIs. */ +export function buildRouteNamespaceSource(opts: { + context: RouteModuleContext + module: ScopeModule + frameworkPackage: string + routeTreeImport: string + header: Array +}) { + const { context, module, frameworkPackage } = opts + let router = routerTypeOf(module, context.identifiers) + const hosted = module.hostedThrough !== undefined + const lines = [ + ...opts.header, + GENERATED_NOTICE, + `import type { ScopedRouter${hosted ? ', HostedRouter' : ''} } from '${frameworkPackage}'`, + ...contractTypeImports([module], context.identifiers), + ] + if (module.hostedThrough !== undefined) { + lines.push( + `import type { MountedModuleHostParams } from '${opts.routeTreeImport}'`, + ) + router = `HostedRouter<${router}, ${hostParamsOf(module as ScopeModule & { hostedThrough: string }, context.identifiers)}>` + } + lines.push( + `type Router = ScopedRouter<${router}, '${module.key}'>`, + ...scopeBindings(frameworkPackage, 'Router', module.key), + ...scopeMatchGuard(frameworkPackage, 'Router', module.matchRoots), + ) + return lines.join('\n\n') + '\n' +} + +/** Source of routeScope.gen.ts; each runtime API is an independent ESM export. */ +export function buildRouteScopeSource(opts: { + context: RouteModuleContext + frameworkPackage: string + routeTreeImport: string + /** Import specifier of `routeContract.gen.ts`, which declares the module's register and router. */ + contractImport: string + /** Root ids of the module and of every module it installs. */ + matchRoots: Array + namespaceImport: (module: ScopeModule) => string + header: Array +}): string { + const { context, frameworkPackage } = opts + const { declaration } = context + const lines: Array = [...opts.header, GENERATED_NOTICE] + if (declaration.mode === 'module') { + const moduleId = declaration.moduleId! + const start = context.start + // The register and router types live in the contract, which never + // imports this file: the namespaces re-exported below reach the contracts + // of used modules, and a module's contract must not. + lines.push( + `import { bindCreateModuleRoot } from '${frameworkPackage}/_internal/route-module'`, + `import { createFileRoute as createFrameworkFileRoute } from '${frameworkPackage}'`, + `import type { FileRouteScope } from '${frameworkPackage}'`, + `import type { FileRoutesByPath } from '${opts.routeTreeImport}'`, + `import type { RouteModuleRouter, RouteModuleRegister } from '${opts.contractImport}'`, + `export type { RouteModuleRouter, RouteModuleRegister } from '${opts.contractImport}'`, + ) + if (start) { + lines.push( + `import { createServerFn as createStartServerFn, createMiddleware as createStartMiddleware } from '${start.package}'`, + `import { createStartModule as createStartModuleFor } from '${start.package}/_internal/route-module'`, + `import type { CreateServerFn, CreateMiddlewareFn, StartModuleRegister } from '${start.package}'`, + ) + } + lines.push( + `export const createFileRoute = createFrameworkFileRoute as FileRouteScope['createFileRoute']`, + `export const createModuleRoot = /* @__PURE__ */ bindCreateModuleRoot('${moduleId}')`, + ...scopeBindings(frameworkPackage, 'RouteModuleRouter', moduleId), + ...scopeMatchGuard( + frameworkPackage, + 'RouteModuleRouter', + opts.matchRoots, + ), + ) + if (start) { + lines.push( + `export const createServerFn = createStartServerFn as unknown as CreateServerFn`, + `export const createMiddleware = createStartMiddleware as unknown as CreateMiddlewareFn>`, + `export const createStartModule = /* @__PURE__ */ createStartModuleFor('${moduleId}')`, + ) + } + } + for (const module of context.scope) { + lines.push( + `export * as ${module.namespace} from '${opts.namespaceImport(module)}'`, + ) + } + if (declaration.mode === 'host' && context.scope.length === 0) { + lines.push('export {}') + } + return lines.join('\n\n') + '\n' +} + +/** + * Source of `routeContract.gen.ts`: the public type entry of a module. It + * declares the module's register and router, so the emitted declarations of + * the route files reach this file, the route tree, the framework and the + * contracts of included modules, and nothing of the modules the module uses. + */ +export function buildRouteContractSource(opts: { + context: RouteModuleContext + frameworkPackage: string + routeTreeImport: string + /** Import specifier of the module's Start file. */ + startImport: string + header: Array +}): string { + const { context } = opts + const moduleId = context.declaration.moduleId! + const start = context.start + const mounted = context.mounts.map((mount) => ({ + mount, + identifier: getModuleIdentifier(mount.moduleId, context.identifiers), + })) + const lines: Array = [...opts.header, GENERATED_NOTICE] + lines.push( + [ + `import type { ScopeRouter${ + context.mounts.some((mount) => mount.as !== undefined) + ? ', InstallationRoutesById' + : '' + } } from '${opts.frameworkPackage}'`, + `import type { FileRoutesById, ${mounted.length ? 'MountedModuleHostParams, ' : ''}routeTree } from '${opts.routeTreeImport}'`, + ...(start + ? [ + `import type { StartModuleRegister${start.file ? ', StartModuleConfig' : ''} } from '${start.package}'`, + ...(start.file + ? [`import type { start } from '${opts.startImport}'`] + : []), + ] + : []), + // The host params of a mounted module's own installations are only + // needed when it installs other modules. + ...mounted.map( + ({ mount, identifier }) => + `import type { ${mount.installed.length > 1 ? `InstalledHostParams as ${identifier}InstalledHostParams, ` : ''}InstalledRoutesById as ${identifier}InstalledRoutesById, InstalledRouters as ${identifier}InstalledRouters } from '${mount.moduleId}/route-types'`, + ), + ].join('\n'), + ) + lines.push( + `/** The router of "${moduleId}": module-local paths, qualified ids. */ +export type RouteModuleRouter = ScopeRouter`, + `/** The register of "${moduleId}": the scope its route factories and route-bound APIs are typed against. */ +export interface RouteModuleRegister${start ? ` extends StartModuleRegister<'${moduleId}'>` : ''} { + router: RouteModuleRouter${start ? `\n ssr: true${start.file ? '\n config: StartModuleConfig' : ''}` : ''} +}`, + ) + const hostParams = mounted.flatMap(({ mount, identifier }) => { + const above = `MountedModuleHostParams['${mount.key}']` + return mount.installed.map((installed) => + installed.id === mount.moduleId + ? ` '${mount.key}': ${above}` + : ` '${installed.key}': ${above} & ${identifier}InstalledHostParams['${installed.key}']`, + ) + }) + lines.push( + `/** The route tree of "${moduleId}": its module root with all its routes. */ +export type RouteModuleTree = typeof routeTree`, + `/** The router type of "${moduleId}" (module-local paths, qualified ids). */ +export type Router = RouteModuleRouter`, + `/** The routes of "${moduleId}" by qualified id, without other modules. */ +export type OwnRoutesById = FileRoutesById`, + `/** All routes installed with "${moduleId}", including the modules it mounts. */ +export interface InstalledRoutesById extends FileRoutesById${mounted + .map(({ mount, identifier }) => + mount.as === undefined + ? `, ${identifier}InstalledRoutesById` + : `, InstallationRoutesById<${identifier}InstalledRoutesById, '${mount.moduleId}', '${mount.as}'>`, + ) + .join('')} {}`, + // A named installation is keyed by its installation key, so the mounted + // module's own entry is left out of what its contract contributes. + `/** The routers of "${moduleId}" and of every module it mounts, by module id. */ +export interface InstalledRouters${ + mounted.length + ? ` extends ${mounted + .map(({ mount, identifier }) => + mount.as === undefined + ? `${identifier}InstalledRouters` + : `Omit<${identifier}InstalledRouters, '${mount.moduleId}'>`, + ) + .join(', ')}` + : '' + } { + '${moduleId}': Router +${mounted.map(({ mount, identifier }) => ` '${mount.key}': ${identifier}InstalledRouters['${mount.moduleId}']`).join('\n')} +}`, + `/** + * The path params above every module "${moduleId}" installs, relative to its + * root. Packages that mount "${moduleId}" under path params add their own. + */ +export interface InstalledHostParams {${hostParams.length ? `\n${hostParams.join('\n')}\n` : ''}}`, + ) + return lines.join('\n\n') + '\n' +} + +/** `.tanstack/route-types-stubs.d.ts`: stand-ins for the contracts of used modules. */ +export function getRouteTypeStubsPath(packageRoot: string) { + return path.join(packageRoot, '.tanstack', 'route-types-stubs.d.ts') +} + +/** + * Source of `.tanstack/route-types-stubs.d.ts`: an ambient stand-in for the + * contract of every module this module uses. The declaration build includes + * it and compiles against the stand-ins, so it needs no ordering against the + * modules it links into; the source check does not include it and reads the + * real contracts. An exact-name ambient module replaces the resolved file, so + * a stand-in declares what generated code imports from a used contract + * (`contractTypeImports`): the router, permissive enough for module-local + * links, and the routers of the modules it installs. + */ +export function buildRouteTypeStubsSource(opts: { + context: RouteModuleContext + frameworkPackage: string + header: Array +}): string { + const lines: Array = [ + ...opts.header, + GENERATED_NOTICE, + `// Stand-ins for the contracts of the route modules this module uses. Include +// this file in the declaration build only (tsconfig.route-types.json): there it +// replaces the real contracts, so the build needs no ordering against the modules +// it links into. The source check (tsconfig.json) must not include it.`, + ...opts.context.usedContracts.map( + (id) => `declare module '${id}/route-types' { + import type { AnyRoute, ScopeRouter } from '${opts.frameworkPackage}' + export type Router = ScopeRouter + export interface InstalledRouters { + [key: string]: Router + } +}`, + ), + ] + return lines.join('\n\n') + '\n' +} + +function startModulesImports(context: RouteModuleContext) { + return context.startMounts.map((moduleId) => ({ + identifier: `${getModuleIdentifier(moduleId, context.identifiers)}StartModules`, + statement: `import { startModules as ${getModuleIdentifier(moduleId, context.identifiers)}StartModules } from '${moduleId}/route-module'`, + })) +} + +/** Source of `routeModule.gen.ts`: the runtime entry includers import. */ +export function buildRouteModuleSource(opts: { + context: RouteModuleContext + routeTreeImport: string + /** Import specifier of the module's Start file. */ + startImport: string + header: Array +}): string { + const { context } = opts + const lines: Array = [...opts.header, GENERATED_NOTICE] + const mounted = startModulesImports(context) + const ownFragment = context.exportsStartModules && !!context.start?.file + if (context.exportsStartModules) { + lines.push( + [ + ...(ownFragment ? [`import { start } from '${opts.startImport}'`] : []), + ...mounted.map((entry) => entry.statement), + ].join('\n'), + ) + } + lines.push( + `/** The root route of this module with all its routes. Mount it with \`mountRouteModule\`. */ +export { routeTree as routeModule } from '${opts.routeTreeImport}'`, + ) + if (context.exportsStartModules) { + const entries = [ + ...mounted.map((entry) => `...${entry.identifier}`), + ...(ownFragment ? ['start'] : []), + ] + const types = [ + ...mounted.map((entry) => `...typeof ${entry.identifier}`), + ...(ownFragment ? ['typeof start'] : []), + ] + lines.push( + `/** + * The TanStack Start fragments of this module and of the modules it mounts. + * Applications install them with \`createStart(() => ({ extends: startModules }))\`. + */ +export const startModules: readonly [${types.join(', ')}] = [${entries.join(', ')}]`, + ) + } + return lines.join('\n\n') + '\n' +} + +/** + * Source of an application's `startModules.gen.ts`: the Start fragments of + * every installed route module, and a type check of the application's + * Start instance against them. + */ +export function buildStartModulesSource(opts: { + context: RouteModuleContext + /** Import specifier of the application's Start file. */ + startImport: string + header: Array +}): string { + const { context } = opts + const mounted = startModulesImports(context) + return ( + [ + ...opts.header, + GENERATED_NOTICE, + [ + `import type { AssertStartModules, ValidateStartModules } from '${context.start!.package}'`, + ...(context.start!.file + ? [`import type { startInstance } from '${opts.startImport}'`] + : [`import type { StartInstance } from '${context.start!.package}'`]), + ...mounted.map((entry) => entry.statement), + ].join('\n'), + `/** + * The TanStack Start fragments of every installed route module. Install them + * with \`createStart(() => ({ extends: startModules }))\`. + */ +export const startModules: readonly [${mounted + .map((entry) => `...typeof ${entry.identifier}`) + .join(', ')}] = [${mounted + .map((entry) => `...${entry.identifier}`) + .join(', ')}]`, + ...(!context.start!.file + ? [`type DefaultStartInstance = StartInstance<[], true, [], []>`] + : []), + `/** + * Fails to type-check when \`startInstance\` does not install the fragments or + * does not provide the context they require. + */ +export type StartModulesCheck = AssertStartModules< + ValidateStartModules<${context.start!.file ? 'typeof startInstance' : 'DefaultStartInstance'}, typeof startModules, readonly [${[...new Set(context.mounts.flatMap((mount) => mount.manifest.modules.map((module) => module.id.split('#')[0]!)))].map((id) => `'${id}'`).join(', ')}]> +>`, + ].join('\n\n') + '\n' + ) +} diff --git a/packages/router-generator/src/route-module/manifest.ts b/packages/router-generator/src/route-module/manifest.ts new file mode 100644 index 0000000000..c231bb1bed --- /dev/null +++ b/packages/router-generator/src/route-module/manifest.ts @@ -0,0 +1,105 @@ +import path from 'node:path' +import { existsSync, readFileSync } from 'node:fs' +import crypto from 'node:crypto' + +export const ROUTE_MODULE_MANIFEST_VERSION = 2 + +/** A route of a module subtree, with its path relative to the module root. */ +export interface ManifestRoute { + id: string + /** + * Id of the parent route; `null` for the module root, whose parent is the + * route the module is mounted under. + */ + parent: string | null + /** Full path relative to the module root (module-local for own routes). */ + fullPath: string + /** Whether the route has no children (used for path conflict checks). */ + leaf: boolean + /** Provider-side page eligibility; consumers resolve the final URL. */ + prerender?: boolean +} + +/** A module installed in the subtree of a manifest's module. */ +export interface ManifestInstalledModule { + id: string + /** Runtime installation identity; differs from id for an explicit name. */ + key: string + /** Modules whose routes this module references. */ + uses: Array + /** Full path of the module root relative to the manifest's module root. */ + mountPath: string + /** Package that installs the module (`null` for the manifest's module). */ + includedBy: string | null +} + +/** + * `.tanstack/route-module.json`: the topology of a route module, written by its + * own route generation and read by the packages that install or use it. + */ +export interface RouteModuleManifest { + version: typeof ROUTE_MODULE_MANIFEST_VERSION + id: string + packageName: string + /** All routes of the module's subtree, including installed modules. */ + routes: Array + /** + * Route source paths relative to their provider. `owner` is the dependency + * chain from this package to that provider, resolved in order by consumers. + * Relative physical() paths outside a provider retain their source layout. + */ + routeFiles: Array<{ owner: Array; file: string; routeId: string }> + /** Portable client-only views of provider route trees. */ + clientTrees: Array<{ owner: Array; file: string; clientFile: string }> + /** The module itself and every module installed in its subtree. */ + modules: Array + /** + * Whether the module's runtime entry exports `startModules`: the TanStack + * Start fragments of the module and of the modules it installs. + */ + startModules: boolean + /** Hash of the topology above; changes whenever includers must regenerate. */ + topologyToken: string +} + +export function getManifestPath(packageRoot: string) { + return path.join(packageRoot, '.tanstack', 'route-module.json') +} + +function readVersioned(file: string, what: string): T | undefined { + if (!existsSync(file)) { + return undefined + } + const value = JSON.parse(readFileSync(file, 'utf8')) as { version: number } + if (value.version !== ROUTE_MODULE_MANIFEST_VERSION) { + throw new Error( + `The ${what} "${file}" has version ${value.version}; this generator reads version ${ROUTE_MODULE_MANIFEST_VERSION}. Regenerate it with the same version of @tanstack/router-generator.`, + ) + } + return value as T +} + +export function readManifest( + packageRoot: string, +): RouteModuleManifest | undefined { + return readVersioned(getManifestPath(packageRoot), 'route module manifest') +} + +export function computeTopologyToken( + manifest: Omit, +): string { + return crypto + .createHash('sha256') + .update( + JSON.stringify({ + id: manifest.id, + routes: manifest.routes, + routeFiles: manifest.routeFiles, + clientTrees: manifest.clientTrees, + modules: manifest.modules, + startModules: manifest.startModules, + }), + ) + .digest('hex') + .slice(0, 16) +} diff --git a/packages/router-generator/src/routeClassification.ts b/packages/router-generator/src/routeClassification.ts new file mode 100644 index 0000000000..e662595b5e --- /dev/null +++ b/packages/router-generator/src/routeClassification.ts @@ -0,0 +1,11 @@ +import type { RouteNode } from './types' + +/** Page eligibility before resolving its installation's full URL. */ +export function isPrerenderableRoute(node: RouteNode): boolean { + return Boolean( + node.routePath && + !node.routePath.includes('$') && + !node.isNonPath && + node.createFileRouteProps?.has('component'), + ) +} diff --git a/packages/router-generator/src/transform/transform.ts b/packages/router-generator/src/transform/transform.ts index 9fcad87948..8a0f31bcdc 100644 --- a/packages/router-generator/src/transform/transform.ts +++ b/packages/router-generator/src/transform/transform.ts @@ -119,12 +119,44 @@ export function transform({ routeCall.routeIdArg.start!, routeCall.routeIdArg.end!, ) - const targetModule = `@tanstack/${ctx.target}-router` + const frameworkModule = `@tanstack/${ctx.target}-router` + const targetModule = ctx.routeImportSource ?? frameworkModule const imports = parseTargetImports(ast.program.body, source, targetModule) const s = new MagicString(source) let modified = false + // Route-module files take route constructors from their scope module only: + // the framework package or a stale scope path (a moved file) lose them. + if (targetModule !== frameworkModule) { + for (const declaration of parseTargetImports( + ast.program.body, + source, + (moduleName) => moduleName !== targetModule, + )) { + const named = declaration.named.filter( + (specifier) => !isRouteConstructorName(specifier.imported), + ) + if (named.length === declaration.named.length) { + continue + } + const replacement = renderImportDeclaration({ ...declaration, named }) + if (replacement === null) { + s.remove( + declaration.declaration.start!, + getRemovalEnd(source, declaration.declaration.end!), + ) + } else { + s.update( + declaration.declaration.start!, + declaration.declaration.end!, + replacement, + ) + } + modified = true + } + } + if (routeCall.callee.name !== expectedCallee) { s.update(routeCall.callee.start!, routeCall.callee.end!, expectedCallee) modified = true @@ -351,15 +383,19 @@ function getCreateFileRouteProps( function parseTargetImports( body: Array, source: string, - targetModule: string, + targetModule: string | ((moduleName: string) => boolean), ) { const imports: Array = [] + const isTarget = + typeof targetModule === 'string' + ? (moduleName: string) => moduleName === targetModule + : targetModule for (const statement of body) { if ( !t.isImportDeclaration(statement) || statement.importKind === 'type' || - statement.source.value !== targetModule + !isTarget(statement.source.value) ) { continue } diff --git a/packages/router-generator/src/transform/types.ts b/packages/router-generator/src/transform/types.ts index 4a8fecaada..a9c869d781 100644 --- a/packages/router-generator/src/transform/types.ts +++ b/packages/router-generator/src/transform/types.ts @@ -28,4 +28,9 @@ export interface TransformContext { target: Config['target'] routeId: string lazy: boolean + /** + * Module that route constructors are imported from. Defaults to the + * framework package; route modules import them from their scope module. + */ + routeImportSource?: string } diff --git a/packages/router-generator/src/types.ts b/packages/router-generator/src/types.ts index ec0aa226ce..2ee83bdd3e 100644 --- a/packages/router-generator/src/types.ts +++ b/packages/router-generator/src/types.ts @@ -27,6 +27,16 @@ export type RouteNode = { _virtualParentRoutePath?: string /** Internal routePath segment metadata for escaped or explicit literal syntax. */ _routePathSegmentMetadata?: Array + /** + * Internal: this node is the root of a mounted route module. It has no file + * and only appears in the children of its host route. + */ + _routeModuleMount?: { + moduleId: string + /** The module id, or `#` for one of several installations. */ + installation: string + at: string | undefined + } } export interface GetRouteNodesResult { diff --git a/packages/router-generator/src/utils.ts b/packages/router-generator/src/utils.ts index a3bb4b746c..b3222c99a0 100644 --- a/packages/router-generator/src/utils.ts +++ b/packages/router-generator/src/utils.ts @@ -1253,28 +1253,44 @@ export const findParent = (node: RouteNode | undefined): string => { export function buildFileRoutesByPathInterface(opts: { routeNodes: Array - module: string + /** + * Module to augment. Without it the interface is exported locally (route + * modules), and entries omit `preLoaderRoute`, which only the deprecated + * lazy and loader route APIs read. + */ + module: string | undefined interfaceName: string config?: Pick + /** Maps a route path to the route id (route modules qualify ids). */ + qualifyId?: (id: string) => string }): string { - return `declare module '${opts.module}' { - interface ${opts.interfaceName} { - ${opts.routeNodes - .map((routeNode) => { - const filePathId = routeNode.routePath - const preloaderRoute = `typeof ${routeNode.variableName}RouteImport` + const qualifyId = opts.qualifyId ?? ((id: string) => id) + const entries = opts.routeNodes + .map((routeNode) => { + const filePathId = qualifyId(routeNode.routePath ?? '') + const parent = findParent(routeNode) - const parent = findParent(routeNode) - - return `'${filePathId}': { + return `'${filePathId}': { id: '${filePathId}' path: '${inferPath(routeNode)}' - fullPath: '${inferFullPath(routeNode)}' - preLoaderRoute: ${preloaderRoute} + fullPath: '${inferFullPath(routeNode)}'${ + opts.module === undefined + ? '' + : `\n preLoaderRoute: typeof ${routeNode.variableName}RouteImport` + } parentRoute: typeof ${parent} }` - }) - .join('\n')} + }) + .join('\n') + + if (opts.module === undefined) { + return `export interface ${opts.interfaceName} { + ${entries} +}` + } + return `declare module '${opts.module}' { + interface ${opts.interfaceName} { + ${entries} } }` } diff --git a/packages/router-generator/tests/route-modules.test.ts b/packages/router-generator/tests/route-modules.test.ts new file mode 100644 index 0000000000..0d525fdaa4 --- /dev/null +++ b/packages/router-generator/tests/route-modules.test.ts @@ -0,0 +1,2355 @@ +import fs from 'node:fs/promises' +import { spawnSync } from 'node:child_process' +import { existsSync, readFileSync, realpathSync } from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import { createJiti } from 'jiti' +import { fileURLToPath } from 'node:url' +import { afterEach, beforeEach, describe, expect, it } from 'vitest' + +import { Generator, getConfig, readRouteModuleManifest } from '../src' + +let workspace: string + +beforeEach(async () => { + workspace = realpathSync( + await fs.mkdtemp(path.join(os.tmpdir(), 'tsr-generator-modules-')), + ) +}) + +afterEach(async () => { + await fs.rm(workspace, { recursive: true, force: true }) +}) + +interface PackageSpec { + name: string + packageJson?: Record + files: Record + dependencies?: Array +} + +/** Writes a package into the workspace; dependencies are linked siblings. */ +async function writePackage(spec: PackageSpec) { + const root = path.join(workspace, spec.name.replace('@fixture/', '')) + await fs.mkdir(root, { recursive: true }) + await fs.writeFile( + path.join(root, 'package.json'), + JSON.stringify( + { + name: spec.name, + dependencies: Object.fromEntries( + (spec.dependencies ?? []).map((dependency) => [dependency, '*']), + ), + ...spec.packageJson, + }, + null, + 2, + ), + ) + for (const [file, content] of Object.entries(spec.files)) { + await fs.mkdir(path.dirname(path.join(root, file)), { recursive: true }) + await fs.writeFile(path.join(root, file), content) + } + for (const dependency of spec.dependencies ?? []) { + const link = path.join(root, 'node_modules', dependency) + await fs.mkdir(path.dirname(link), { recursive: true }) + await fs.symlink( + path.join(workspace, dependency.replace('@fixture/', '')), + link, + 'dir', + ) + } + return root +} + +async function generate(root: string, inline: Record = {}) { + const config = getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace, '.tmp'), + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + ...inline, + }, + root, + ) + await new Generator({ config, root }).run() +} + +const read = (root: string, file: string) => + readFileSync(path.join(root, file), 'utf8') + +/** Generated files are formatted: compare their content on one line. */ +const compact = (source: string) => source.replace(/\s+/g, ' ') + +function readNamespace(root: string, namespace: string) { + const entry = [ + ...read(root, 'src/routeScope.gen.ts').matchAll( + /export \* as (\w+) from '([^']+)'/g, + ), + ].find((match) => match[1] === namespace) + if (!entry) { + throw new Error(`Generated namespace ${namespace} was not exported`) + } + return read(root, path.join('src', `${entry[2]}.ts`)) +} + +/** A route file as `getRoutesByFileMap()` keys it: with forward slashes. */ +function routeFile(root: string, file: string) { + return path.join(root, file).replaceAll(path.sep, '/') +} + +async function linkRouter(root: string) { + const target = fileURLToPath(new URL('../../react-router', import.meta.url)) + const link = path.join(root, 'node_modules/@tanstack/react-router') + await fs.mkdir(path.dirname(link), { recursive: true }) + await fs.symlink(target, link, 'dir') +} + +async function checkConsumerTypes( + root: string, + files: Array, + compilerOptions: Record = {}, +) { + await fs.writeFile( + path.join(root, 'tsconfig.json'), + JSON.stringify({ + compilerOptions: { + target: 'ES2022', + module: 'ESNext', + moduleResolution: 'Bundler', + jsx: 'react-jsx', + strict: true, + noUnusedLocals: true, + skipLibCheck: false, + noEmit: true, + types: [], + ...compilerOptions, + }, + files, + }), + ) + const compiler = fileURLToPath( + new URL('../../../node_modules/typescript59/lib/tsc.js', import.meta.url), + ) + const result = spawnSync( + process.execPath, + [compiler, '--pretty', 'false', '-p', root], + { + encoding: 'utf8', + stdio: 'pipe', + }, + ) + if (result.error) { + throw result.error + } + const diagnostics = `${result.stdout ?? ''}${result.stderr ?? ''}` + return result.status === 0 + ? diagnostics + : diagnostics || `TypeScript exited with status ${result.status}` +} + +const moduleRoot = `import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ component: () => }) +` + +const route = ( + id: string, +) => `import { createFileRoute } from '../routeScope.gen' + +export const Route = createFileRoute('${id}')({}) +` + +describe('installed route-module composition contracts', () => { + const appRoot = `import { createRootRoute } from '@tanstack/react-router' +export const Route = createRootRoute() +` + + it('preserves adjacent TypeScript declaration outputs when regenerating namespaces', async () => { + const catalog = await writePackage( + catalogPackage({ + packageJson: { + tanstack: { router: { module: true } }, + exports: { + './route-module': './src/routeModule.gen.ts', + './route-types': './src/routeContract.gen.ts', + }, + }, + files: { + 'src/routes/__root.tsx': `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({})`, + 'src/routes/profile.tsx': route('@fixture/catalog:/profile'), + }, + }), + ) + await linkRouter(catalog) + await generate(catalog) + const shop = await writePackage({ + name: '@fixture/shop', + dependencies: ['@fixture/catalog'], + packageJson: { + tanstack: { router: { module: { uses: ['@fixture/catalog'] } } }, + }, + files: { + 'src/routes/__root.tsx': `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({})`, + }, + }) + await linkRouter(shop) + const config = { routeFileIgnorePattern: '\\.d\\.ts$' } + await generate(shop, config) + expect( + await checkConsumerTypes(shop, ['src/routeScope.gen.ts'], { + noEmit: false, + declaration: true, + emitDeclarationOnly: true, + }), + ).toBe('') + const namespaceFiles = [ + ...read(shop, 'src/routeScope.gen.ts').matchAll( + /export \* as \w+ from '([^']+)'/g, + ), + ].map((match) => path.join('src', `${match[1]}.d.ts`)) + expect(namespaceFiles).toHaveLength(1) + const declarations = ['src/routeScope.gen.d.ts', ...namespaceFiles].map( + (file) => ({ file, content: read(shop, file) }), + ) + await generate(shop, config) + for (const declaration of declarations) { + expect(read(shop, declaration.file)).toBe(declaration.content) + } + }, 30_000) + + it('uses an explicit installation name for the first installation', async () => { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { 'src/routes/__root.tsx': appRoot }, + }) + const generator = new Generator({ + root: app, + config: getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace, '.tmp'), + routeModules: { + includes: [ + { + module: '@fixture/catalog', + as: 'catalogFeature', + at: '/catalog', + }, + ], + }, + }, + app, + ), + }) + await generator.run() + expect( + generator.getMountedRouteModuleRoutes().map((node) => node.id), + ).toContain('@fixture/catalog#catalogFeature:/$itemId') + }) + + it.each(['catalog', '/catalog'])( + 'checks collisions for the mount spelling %s', + async (at) => { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': appRoot, + 'src/routes/catalog.tsx': `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/catalog')({}) +`, + }, + }) + await expect( + generate(app, { + routeModules: { includes: [{ module: '@fixture/catalog', at }] }, + }), + ).rejects.toThrow(/full path.*used by both/i) + }, + ) + + it.each(['catalog//sale', '/catalog//sale/'])( + 'checks collisions after normalizing interior slashes in %s', + async (at) => { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': appRoot, + 'src/routes/catalog.sale.tsx': `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/catalog/sale')({})`, + }, + }) + await expect( + generate(app, { + routeModules: { includes: [{ module: '@fixture/catalog', at }] }, + }), + ).rejects.toThrow(/full path.*used by both/i) + }, + ) + + it('rejects host and module path parameter overlap', async () => { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': appRoot, + 'src/routes/orgs.$itemId.tsx': `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/orgs/$itemId')({})`, + }, + }) + await expect( + generate(app, { + routeModules: { + includes: [ + { + module: '@fixture/catalog', + parent: '/orgs/$itemId', + at: '/catalog', + }, + ], + }, + }), + ).rejects.toThrow(/parameter.*itemId|itemId.*parameter/i) + }) + + it.each(['$', '{$}[.]txt'])( + 'rejects a module wildcard %s that overwrites a host _splat parameter', + async (file) => { + const catalog = await writePackage( + catalogPackage({ + files: { + 'src/routes/__root.tsx': moduleRoot, + [`src/routes/${file}.tsx`]: '', + }, + }), + ) + await generate(catalog) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': appRoot, + 'src/routes/orgs.$_splat.tsx': `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/orgs/$_splat')({})`, + }, + }) + await expect( + generate(app, { + routeModules: { + includes: [ + { + module: '@fixture/catalog', + parent: '/orgs/$_splat', + at: '/catalog', + }, + ], + }, + }), + ).rejects.toThrow(/parameter.*_splat|_splat.*parameter/i) + }, + ) + + it('preserves named nested installation contracts and hosted namespace guards', async () => { + const exports = { + './route-module': './src/routeModule.gen.ts', + './route-types': './src/routeContract.gen.ts', + } + const catalog = await writePackage( + catalogPackage({ + packageJson: { tanstack: { router: { module: true } }, exports }, + files: { + 'src/routes/__root.tsx': `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({})`, + 'src/routes/profile.tsx': route('@fixture/catalog:/profile'), + }, + }), + ) + await linkRouter(catalog) + await generate(catalog) + const shop = await writePackage({ + name: '@fixture/shop', + dependencies: ['@fixture/catalog'], + packageJson: { + exports, + tanstack: { + router: { + module: { + includes: [ + { + module: '@fixture/catalog', + as: 'ownedCatalog', + parent: '/teams/$teamId', + at: '/catalog', + }, + ], + }, + }, + }, + }, + files: { + 'src/routes/__root.tsx': `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({})`, + 'src/routes/teams.$teamId.tsx': route('@fixture/shop:/teams/$teamId'), + }, + }) + await linkRouter(shop) + await generate(shop) + const manifest = readRouteModuleManifest(shop)! + expect(manifest.modules).toContainEqual( + expect.objectContaining({ + id: '@fixture/catalog', + key: '@fixture/catalog#ownedCatalog', + }), + ) + expect(manifest.routes).toContainEqual( + expect.objectContaining({ + id: '@fixture/catalog#ownedCatalog:/profile', + parent: '@fixture/catalog#ownedCatalog:', + fullPath: '/teams/$teamId/catalog/profile', + }), + ) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/shop'], + files: { + 'src/routes/__root.tsx': appRoot, + 'src/routes/orgs.$orgId.tsx': `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/orgs/$orgId')({})`, + 'src/consumer.ts': `import type { InstalledRoutesById, InstalledHostParams } from '@fixture/shop/route-types' +import { catalog } from './routeScope.gen' +const id: InstalledRoutesById['@fixture/catalog#ownedCatalog:/profile']['id'] = '@fixture/catalog#ownedCatalog:/profile' +const host: InstalledHostParams['@fixture/catalog#ownedCatalog'] = { teamId: 'team' } +catalog.linkOptions({ to: '/profile', params: { orgId: 'org', teamId: host.teamId } }) +export { id } +`, + }, + }) + await linkRouter(app) + await generate(app, { + routeModules: { + includes: [ + { + module: '@fixture/shop', + as: 'namedShop', + parent: '/orgs/$orgId', + at: '/shop', + }, + ], + }, + }) + expect(await checkConsumerTypes(app, ['src/consumer.ts'])).toBe('') + const jiti = createJiti(import.meta.url, { + moduleCache: false, + fsCache: false, + }) + const scope = await jiti.import<{ + catalog: { + isScopedMatch: (match: { + routeId: string + localRouteId?: string + }) => boolean + } + namedShop: { + isScopedMatch: (match: { + routeId: string + localRouteId?: string + }) => boolean + } + }>(path.join(app, 'src/routeScope.gen.ts')) + const match = { + routeId: '@fixture/catalog#ownedCatalog:/profile', + localRouteId: '@fixture/catalog:/profile', + } + expect(scope.catalog.isScopedMatch(match)).toBe(true) + expect(scope.namedShop.isScopedMatch(match)).toBe(true) + expect( + scope.catalog.isScopedMatch({ + ...match, + routeId: '@fixture/catalog#other:/profile', + }), + ).toBe(false) + // Membership follows module root ids, not the routes known at generation: + // a route the module adds later passes, an installation whose name merely + // starts with the same characters does not, and neither does an + // application route. + expect( + scope.namedShop.isScopedMatch({ + routeId: '@fixture/catalog#ownedCatalog:/added', + localRouteId: '@fixture/catalog:/added', + }), + ).toBe(true) + expect( + scope.catalog.isScopedMatch({ + ...match, + routeId: '@fixture/catalog#ownedCatalogs:/profile', + }), + ).toBe(false) + expect(scope.namedShop.isScopedMatch({ routeId: '/orgs/$orgId' })).toBe( + false, + ) + // The provider's own scope combines both checks: its routes pass in any + // installation through `localRouteId`, the installation it names passes + // through `routeId`. + const shopScope = await jiti.import<{ + isScopedMatch: (match: { + routeId: string + localRouteId?: string + }) => boolean + }>(path.join(shop, 'src/routeScope.gen.ts')) + expect( + shopScope.isScopedMatch({ + routeId: '@fixture/shop#namedShop:/teams/$teamId', + localRouteId: '@fixture/shop:/teams/$teamId', + }), + ).toBe(true) + expect(shopScope.isScopedMatch(match)).toBe(true) + expect( + shopScope.isScopedMatch({ + ...match, + routeId: '@fixture/catalog#ownedCatalogs:/profile', + }), + ).toBe(false) + }, 30_000) + + it('keeps case-only namespace aliases independently addressable on portable filenames', async () => { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { 'src/routes/__root.tsx': appRoot }, + }) + await linkRouter(app) + await generate(app, { + routeModules: { + includes: [ + { module: '@fixture/catalog', as: 'catalog', at: '/first' }, + { module: '@fixture/catalog', as: 'Catalog', at: '/second' }, + ], + }, + }) + const namespaceFiles = [ + ...read(app, 'src/routeScope.gen.ts').matchAll( + /export \* as \w+ from '([^']+)'/g, + ), + ].map((match) => match[1]!) + expect(namespaceFiles).toHaveLength(2) + expect(new Set(namespaceFiles.map((file) => file.toLowerCase())).size).toBe( + 2, + ) + const jiti = createJiti(import.meta.url, { + moduleCache: false, + fsCache: false, + }) + const scope = await jiti.import<{ + catalog: { linkOptions: (options: { to: string }) => { _module: string } } + Catalog: { linkOptions: (options: { to: string }) => { _module: string } } + }>(path.join(app, 'src/routeScope.gen.ts')) + expect(scope.catalog.linkOptions({ to: '/' })._module).toBe( + '@fixture/catalog#catalog', + ) + expect(scope.Catalog.linkOptions({ to: '/' })._module).toBe( + '@fixture/catalog#Catalog', + ) + }) + + it('loads ordinary routes whose derived private names collide', async () => { + const app = await writePackage({ + name: '@fixture/app', + files: { + 'src/routes/__root.tsx': appRoot, + 'src/routes/foo-bar.tsx': `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/foo-bar')({})`, + 'src/routes/fooBar.tsx': `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/fooBar')({})`, + }, + }) + await linkRouter(app) + await generate(app) + const jiti = createJiti(import.meta.url, { + moduleCache: false, + fsCache: false, + }) + await expect( + jiti.import(path.join(app, 'src/routeTree.gen.ts')), + ).resolves.toHaveProperty('routeTree') + const source = read(app, 'src/routeTree.gen.ts') + await generate(app) + expect(read(app, 'src/routeTree.gen.ts')).toBe(source) + }) + + it('loads packages whose private identifiers normalize to the same name', async () => { + for (const name of ['foo-bar', 'foo_bar']) { + const root = await writePackage({ + name: `@fixture/${name}`, + packageJson: { + tanstack: { router: { module: true } }, + exports: { './route-module': './src/routeModule.gen.ts' }, + }, + files: { + 'src/routes/__root.tsx': `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({})`, + 'src/routes/index.tsx': route(`@fixture/${name}:/`), + }, + }) + await linkRouter(root) + await generate(root) + } + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/foo-bar', '@fixture/foo_bar'], + files: { 'src/routes/__root.tsx': appRoot }, + }) + await linkRouter(app) + await generate(app, { + routeModules: { + includes: [ + { module: '@fixture/foo-bar', as: 'first', at: '/first' }, + { module: '@fixture/foo_bar', as: 'second', at: '/second' }, + ], + }, + }) + const jiti = createJiti(import.meta.url, { + moduleCache: false, + fsCache: false, + }) + await expect( + jiti.import(path.join(app, 'src/routeTree.gen.ts')), + ).resolves.toHaveProperty('routeTree') + }) + + it('resolves cached provider route files after moving the workspace', async () => { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { 'src/routes/__root.tsx': appRoot }, + }) + const moved = `${workspace}-relocated` + await fs.rename(workspace, moved) + workspace = moved + const app = path.join(workspace, 'app') + const movedCatalog = path.join(workspace, 'catalog') + const dependency = path.join(app, 'node_modules/@fixture/catalog') + await fs.unlink(dependency) + await fs.symlink(movedCatalog, dependency, 'dir') + const generator = new Generator({ + root: app, + config: getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace, '.tmp'), + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }, + app, + ), + }) + await generator.run() + expect( + generator + .getRoutesByFileMap() + .get(routeFile(movedCatalog, 'src/routes/$itemId.tsx')), + ).toEqual({ routeId: '@fixture/catalog:/$itemId' }) + }) + + it('refreshes consumer topology when provider source and generated tree paths change', async () => { + const catalog = await writePackage( + catalogPackage({ + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/profile.tsx': route('@fixture/catalog:/profile'), + }, + }), + ) + await generate(catalog) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { 'src/routes/__root.tsx': appRoot }, + }) + const changes: Array> = + [] + const generator = new Generator({ + root: app, + config: getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace, '.tmp'), + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + plugins: [ + { + name: 'observe-provider-paths', + onRouteTreeChanged() { + changes.push(generator.getRouteModuleClientTrees()) + }, + }, + ], + }, + app, + ), + }) + await generator.run() + const originalRoutes = readRouteModuleManifest(catalog)!.routes + await fs.mkdir(path.join(catalog, 'src/routes/profile')) + await fs.rename( + path.join(catalog, 'src/routes/profile.tsx'), + path.join(catalog, 'src/routes/profile/route.tsx'), + ) + await generate(catalog) + expect(readRouteModuleManifest(catalog)!.routes).toEqual(originalRoutes) + await generator.run({ + type: 'update', + path: path.join(catalog, '.tanstack/route-module.json'), + }) + expect(changes).toHaveLength(2) + expect(generator.getMountedRouteModuleRoutes()).toContainEqual( + expect.objectContaining({ + id: '@fixture/catalog:/profile', + filePath: path.join(catalog, 'src/routes/profile/route.tsx'), + }), + ) + expect( + generator + .getRoutesByFileMap() + .get(routeFile(catalog, 'src/routes/profile/route.tsx')), + ).toEqual({ + routeId: '@fixture/catalog:/profile', + }) + await generate(catalog, { generatedRouteTree: './src/movedTree.gen.ts' }) + expect(readRouteModuleManifest(catalog)!.routes).toEqual(originalRoutes) + await generator.run({ + type: 'update', + path: path.join(catalog, '.tanstack/route-module.json'), + }) + expect(changes).toHaveLength(3) + expect(changes[2]).toContainEqual({ + filePath: path.join(catalog, 'src/movedTree.gen.ts'), + clientFilePath: path.join(catalog, 'src/movedTree.gen.client.ts'), + }) + }) + + it('accepts routes a used provider gains before and after its namespace is regenerated', async () => { + const runtimeModuleRoot = `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({}) +` + const exports = { + './route-module': './src/routeModule.gen.ts', + './route-types': './src/routeContract.gen.ts', + './scope': './src/routeScope.gen.ts', + } + const catalog = await writePackage( + catalogPackage({ + packageJson: { tanstack: { router: { module: true } }, exports }, + files: { + 'src/routes/__root.tsx': runtimeModuleRoot, + 'src/routes/profile.tsx': route('@fixture/catalog:/profile'), + }, + }), + ) + await linkRouter(catalog) + await generate(catalog) + const shop = await writePackage({ + name: '@fixture/shop', + dependencies: ['@fixture/catalog'], + packageJson: { + exports, + tanstack: { router: { module: { uses: ['@fixture/catalog'] } } }, + }, + files: { 'src/routes/__root.tsx': runtimeModuleRoot }, + }) + await linkRouter(shop) + const consumerGenerator = new Generator({ + root: shop, + config: getConfig( + { disableLogging: true, tmpDir: path.join(workspace, '.tmp') }, + shop, + ), + }) + await consumerGenerator.run() + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog', '@fixture/shop'], + files: { + 'src/routes/__root.tsx': appRoot, + 'src/consumer.ts': `import { createMemoryHistory, createRouter } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' +import { catalog } from '@fixture/shop/scope' +export function matchCatalog(pathname: string) { + const history = createMemoryHistory({ initialEntries: [pathname] }) + const router = createRouter({ routeTree, history, isServer: true }) + try { + const match = router.matchRoutes(pathname).at(-1)! + return { routeId: match.routeId, accepted: catalog.isScopedMatch(match) } + } finally { + history.destroy() + } +} +`, + }, + }) + await linkRouter(app) + const appOptions = { + routeModules: { + includes: [ + { module: '@fixture/catalog', at: '/catalog' }, + { module: '@fixture/shop', at: '/shop' }, + ], + }, + } + const loadConsumer = () => + createJiti(import.meta.url, { + moduleCache: false, + fsCache: false, + }).import<{ + matchCatalog: (pathname: string) => { + routeId: string + accepted: boolean + } + }>(path.join(app, 'src/consumer.ts')) + await generate(app, appOptions) + expect((await loadConsumer()).matchCatalog('/catalog/profile')).toEqual({ + routeId: '@fixture/catalog:/profile', + accepted: true, + }) + + await fs.writeFile( + path.join(catalog, 'src/routes/settings.tsx'), + route('@fixture/catalog:/settings'), + ) + await generate(catalog) + // The guard tests module ids, so the shop scope generated before the route + // existed accepts it as soon as the application tree contains it. + await generate(app, appOptions) + expect((await loadConsumer()).matchCatalog('/catalog/settings')).toEqual({ + routeId: '@fixture/catalog:/settings', + accepted: true, + }) + await consumerGenerator.run({ + type: 'update', + path: path.join(catalog, '.tanstack/route-module.json'), + }) + await generate(app, appOptions) + expect((await loadConsumer()).matchCatalog('/catalog/settings')).toEqual({ + routeId: '@fixture/catalog:/settings', + accepted: true, + }) + }) +}) + +function catalogPackage(extra: Partial = {}): PackageSpec { + return { + name: '@fixture/catalog', + packageJson: { + tanstack: { router: { module: true } }, + }, + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/catalog:/'), + 'src/routes/$itemId.tsx': route('@fixture/catalog:/$itemId'), + 'src/routes/_layout.tsx': route('@fixture/catalog:/_layout'), + 'src/routes/_layout/sale.tsx': route( + '@fixture/catalog:/_layout/sale', + ).replace('../routeScope.gen', '../../routeScope.gen'), + }, + ...extra, + } +} + +describe('route module generation', () => { + it('generates qualified ids, a local FileRoutesByPath and the module files', async () => { + const pkg = await writePackage(catalogPackage()) + await generate(pkg) + + const routeTree = read(pkg, 'src/routeTree.gen.ts') + expect(routeTree).not.toContain('@ts-nocheck') + expect(routeTree).not.toContain('declare module') + expect(routeTree).not.toContain('preLoaderRoute') + await expect(routeTree).toMatchFileSnapshot( + 'route-modules/module/routeTree.snapshot.ts', + ) + await expect(read(pkg, 'src/routeScope.gen.ts')).toMatchFileSnapshot( + 'route-modules/module/routeScope.snapshot.ts', + ) + await expect(read(pkg, 'src/routeContract.gen.ts')).toMatchFileSnapshot( + 'route-modules/module/routeContract.snapshot.ts', + ) + await expect(read(pkg, 'src/routeModule.gen.ts')).toMatchFileSnapshot( + 'route-modules/module/routeModule.snapshot.ts', + ) + + // The module's own guard accepts its routes in any installation, including + // routes added after generation, and rejects other modules' routes and + // application routes. + await linkRouter(pkg) + const jiti = createJiti(import.meta.url, { + moduleCache: false, + fsCache: false, + }) + const scope = await jiti.import<{ + isScopedMatch: (match: { + routeId: string + localRouteId?: string + }) => boolean + }>(path.join(pkg, 'src/routeScope.gen.ts')) + expect( + scope.isScopedMatch({ + routeId: '@fixture/catalog#eu:/added', + localRouteId: '@fixture/catalog:/added', + }), + ).toBe(true) + expect( + scope.isScopedMatch({ + routeId: '@fixture/catalog-extra:/', + localRouteId: '@fixture/catalog-extra:/', + }), + ).toBe(false) + expect(scope.isScopedMatch({ routeId: '/about' })).toBe(false) + expect(scope.isScopedMatch({ routeId: '__root__' })).toBe(false) + + const manifest = readRouteModuleManifest(pkg)! + expect(manifest.id).toBe('@fixture/catalog') + const root = '@fixture/catalog:' + expect(manifest.routes).toEqual([ + { id: root, parent: null, fullPath: '/', leaf: false }, + { id: `${root}/`, parent: root, fullPath: '/', leaf: true }, + { id: `${root}/$itemId`, parent: root, fullPath: '/$itemId', leaf: true }, + { id: `${root}/_layout`, parent: root, fullPath: '/', leaf: false }, + { + id: `${root}/_layout/sale`, + parent: `${root}/_layout`, + fullPath: '/sale', + leaf: true, + }, + ]) + expect(manifest.routeFiles).toContainEqual({ + owner: [], + file: 'src/routes/$itemId.tsx', + routeId: '@fixture/catalog:/$itemId', + }) + expect(manifest.routeFiles).toContainEqual({ + owner: [], + file: 'src/routes/__root.tsx', + routeId: '@fixture/catalog:', + }) + }) + + it('rewrites route ids and route factory imports to the module scope', async () => { + const root = await writePackage( + catalogPackage({ + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': `import { Link, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({}) +export const A = Link +`, + 'src/routes/empty.tsx': '', + }, + }), + ) + await generate(root) + + expect(read(root, 'src/routes/index.tsx')) + .toBe(`import { createFileRoute } from '../routeScope.gen' +import { Link } from '@tanstack/react-router' + +export const Route = createFileRoute('@fixture/catalog:/')({}) +export const A = Link +`) + const scaffolded = read(root, 'src/routes/empty.tsx') + expect(scaffolded).toContain( + "import { createFileRoute } from '../routeScope.gen'", + ) + expect(scaffolded).toContain("createFileRoute('@fixture/catalog:/empty')") + }) + + it('repairs a route factory import from a stale scope path', async () => { + const root = await writePackage( + catalogPackage({ + files: { + 'src/routes/__root.tsx': moduleRoot, + // moved one directory down without updating the import + 'src/routes/nested/moved.tsx': route( + '@fixture/catalog:/nested/moved', + ), + }, + }), + ) + await generate(root) + await generate(root) + expect(read(root, 'src/routes/nested/moved.tsx')).toBe( + `import { createFileRoute } from '../../routeScope.gen' + +export const Route = createFileRoute('@fixture/catalog:/nested/moved')({}) +`, + ) + }) + + it('scaffolds a module root', async () => { + const root = await writePackage( + catalogPackage({ files: { 'src/routes/__root.tsx': '' } }), + ) + await generate(root) + const scaffolded = read(root, 'src/routes/__root.tsx') + expect(scaffolded).toContain( + "import { createModuleRoot } from '../routeScope.gen'", + ) + expect(scaffolded).toContain('export const Route = createModuleRoot()(') + }) + + it('rejects lazy route files', async () => { + const root = await writePackage( + catalogPackage({ + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/about.lazy.tsx': '', + }, + }), + ) + await expect(generate(root)).rejects.toThrow(/lazy route files/) + }) + + it('rejects disableTypes', async () => { + const root = await writePackage(catalogPackage()) + await expect(generate(root, { disableTypes: true })).rejects.toThrow( + /require TypeScript/, + ) + }) + + it('rejects an invalid declaration', async () => { + const root = await writePackage( + catalogPackage({ + packageJson: { + tanstack: { router: { module: { includes: [{ at: '/x' }] } } }, + }, + }), + ) + await expect(generate(root)).rejects.toThrow( + /Invalid "tanstack.router.module"/, + ) + }) +}) + +describe('generated file upkeep', () => { + const generated = [ + 'src/routeScope.gen.ts', + 'src/routeContract.gen.ts', + 'src/routeModule.gen.ts', + 'src/routeTree.gen.client.ts', + '.tanstack/route-module.json', + '.tanstack/route-types-stubs.d.ts', + ] + + it('removes the generated files when a package stops being a route module', async () => { + const root = await writePackage(catalogPackage()) + await generate(root) + for (const file of generated) { + expect(existsSync(path.join(root, file)), file).toBe(true) + } + + await fs.rm(path.join(root, 'src/routes'), { recursive: true }) + await writePackage({ + name: '@fixture/catalog', + files: { + 'src/routes/__root.tsx': `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +`, + 'src/routes/index.tsx': `import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({}) +`, + }, + }) + await generate(root) + for (const file of generated) { + expect(existsSync(path.join(root, file)), file).toBe(false) + } + expect(read(root, 'src/routeTree.gen.ts')).toContain( + "'/': typeof IndexRoute", + ) + }) + + it('regenerates a generated file that was removed or edited', async () => { + const root = await writePackage(catalogPackage()) + const config = getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace, '.tmp'), + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + }, + root, + ) + const generator = new Generator({ config, root }) + await generator.run() + const scope = path.join(root, 'src/routeScope.gen.ts') + const expected = read(root, 'src/routeScope.gen.ts') + + await fs.rm(scope) + await generator.run({ type: 'delete', path: scope }) + expect(read(root, 'src/routeScope.gen.ts')).toBe(expected) + + // Changes are detected by mtime, in milliseconds: an edit right after + // the generation gets a later one, as any edit by hand has. + await fs.writeFile(scope, '// edited\n') + const later = new Date(Date.now() + 1000) + await fs.utimes(scope, later, later) + await generator.run({ type: 'update', path: scope }) + expect(read(root, 'src/routeScope.gen.ts')).toBe(expected) + }) +}) + +describe('mounting route modules', () => { + async function writeCatalog() { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + return catalog + } + + it('mounts included modules and composes their routes by id', async () => { + await writeCatalog() + const shop = await writePackage({ + name: '@fixture/shop', + packageJson: { + tanstack: { + router: { + module: { + includes: [ + { module: '@fixture/catalog', parent: '/_layout', at: '/c' }, + ], + }, + }, + }, + }, + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/shop:/'), + 'src/routes/_layout.tsx': route('@fixture/shop:/_layout'), + }, + }) + await generate(shop) + + await expect(read(shop, 'src/routeTree.gen.ts')).toMatchFileSnapshot( + 'route-modules/includer/routeTree.snapshot.ts', + ) + await expect(read(shop, 'src/routeScope.gen.ts')).toMatchFileSnapshot( + 'route-modules/includer/routeScope.snapshot.ts', + ) + await expect(readNamespace(shop, 'catalog')).toMatchFileSnapshot( + 'route-modules/includer/routeScope.catalog.snapshot.ts', + ) + await expect(read(shop, 'src/routeContract.gen.ts')).toMatchFileSnapshot( + 'route-modules/includer/routeContract.snapshot.ts', + ) + + const manifest = readRouteModuleManifest(shop)! + const catalogRoot = '@fixture/catalog:' + expect( + manifest.routes.filter((r) => r.id.startsWith('@fixture/catalog')), + ).toEqual([ + { + id: catalogRoot, + parent: '@fixture/shop:/_layout', + fullPath: '/c/', + leaf: false, + }, + { + id: `${catalogRoot}/`, + parent: catalogRoot, + fullPath: '/c/', + leaf: true, + }, + { + id: `${catalogRoot}/$itemId`, + parent: catalogRoot, + fullPath: '/c/$itemId', + leaf: true, + }, + { + id: `${catalogRoot}/_layout`, + parent: catalogRoot, + fullPath: '/c/', + leaf: false, + }, + { + id: `${catalogRoot}/_layout/sale`, + parent: `${catalogRoot}/_layout`, + fullPath: '/c/sale', + leaf: true, + }, + ]) + expect(manifest.modules).toEqual([ + { + id: '@fixture/shop', + key: '@fixture/shop', + uses: [], + mountPath: '/', + includedBy: null, + }, + { + id: '@fixture/catalog', + key: '@fixture/catalog', + uses: [], + mountPath: '/c/', + includedBy: '@fixture/shop', + }, + ]) + }) + + it('mounts modules into an application and keeps its own routes plain', async () => { + await writeCatalog() + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +`, + 'src/routes/index.tsx': `import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({}) +`, + }, + }) + await generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }) + + const routeTree = read(app, 'src/routeTree.gen.ts') + expect(routeTree).toContain("declare module '@tanstack/react-router'") + await expect(routeTree).toMatchFileSnapshot( + 'route-modules/application/routeTree.snapshot.ts', + ) + await expect(read(app, 'src/routeScope.gen.ts')).toMatchFileSnapshot( + 'route-modules/application/routeScope.snapshot.ts', + ) + await expect(readNamespace(app, 'catalog')).toMatchFileSnapshot( + 'route-modules/application/routeScope.catalog.snapshot.ts', + ) + expect(existsSync(path.join(app, 'src/routeContract.gen.ts'))).toBe(false) + expect(existsSync(path.join(app, '.tanstack/route-module.json'))).toBe( + false, + ) + }) + + it('lists the route files of mounted modules for bundlers', async () => { + const catalog = await writeCatalog() + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +`, + }, + }) + const config = getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace, '.tmp'), + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }, + app, + ) + const generator = new Generator({ config, root: app }) + await generator.run() + + const routesByFile = generator.getRoutesByFileMap() + expect(routesByFile.get(routeFile(app, 'src/routes/__root.tsx'))).toEqual({ + routeId: '/__root', + }) + expect( + routesByFile.get(routeFile(catalog, 'src/routes/$itemId.tsx')), + ).toEqual({ routeId: '@fixture/catalog:/$itemId' }) + expect( + generator + .getMountedRouteModuleRoutes() + .filter((r) => r.id.includes('$itemId') || r.id.endsWith(':')), + ).toEqual([ + { + id: '@fixture/catalog:', + parent: '__root__', + filePath: path.join(catalog, 'src/routes/__root.tsx'), + fullPath: '/catalog/', + }, + { + id: '@fixture/catalog:/$itemId', + parent: '@fixture/catalog:', + filePath: path.join(catalog, 'src/routes/$itemId.tsx'), + fullPath: '/catalog/$itemId', + }, + ]) + expect(generator.getRouteModuleWatchFiles()).toEqual([ + path.join(app, 'package.json'), + path.join(catalog, 'package.json'), + path.join(catalog, '.tanstack/route-module.json'), + path.join(app, 'src/start.ts'), + path.join(app, 'src/start.tsx'), + ]) + }) + + it('rejects a module that is not a dependency', async () => { + await writeCatalog() + const app = await writePackage({ + name: '@fixture/app', + files: { + 'src/routes/__root.tsx': '', + }, + }) + await expect( + generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }), + ).rejects.toThrow(/is not a dependency/) + }) + + it('rejects a module without a manifest', async () => { + await writePackage(catalogPackage()) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { 'src/routes/__root.tsx': '' }, + }) + await expect( + generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }), + ).rejects.toThrow(/has no route module manifest/) + }) + + it('rejects an unknown parent route', async () => { + await writeCatalog() + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { 'src/routes/__root.tsx': '' }, + }) + await expect( + generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', parent: '/_missing' }], + }, + }), + ).rejects.toThrow(/parent route "\/_missing"/) + }) + + it('rejects full paths that collide with mounted module routes', async () => { + await writeCatalog() + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': '', + 'src/routes/catalog.sale.tsx': '', + }, + }) + await expect( + generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }), + ).rejects.toThrow(/full path "\/catalog\/sale"/) + }) + + it('rejects declaring modules in package.json and in the options', async () => { + const root = await writePackage(catalogPackage()) + await expect( + generate(root, { routeModules: { includes: [] } }), + ).rejects.toThrow(/in one place/) + }) +}) + +describe('mounting under path params', () => { + /** `@fixture/shop` mounts the catalog below its `/orgs/$orgId` route. */ + async function writeShop(includes: Array> = []) { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + const shop = await writePackage({ + name: '@fixture/shop', + packageJson: { + tanstack: { + router: { + module: { + includes: [ + { + module: '@fixture/catalog', + parent: '/orgs/$orgId', + at: '/catalog', + }, + ...includes, + ], + }, + }, + }, + }, + dependencies: [ + '@fixture/catalog', + ...includes.map((include) => include.module!), + ], + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/shop:/'), + 'src/routes/orgs.$orgId.tsx': route('@fixture/shop:/orgs/$orgId'), + }, + }) + return shop + } + + it('types the namespace of the mounted module with the path params above it', async () => { + const shop = await writeShop() + await generate(shop) + + await expect(read(shop, 'src/routeTree.gen.ts')).toMatchFileSnapshot( + 'route-modules/host-params/routeTree.snapshot.ts', + ) + await expect(read(shop, 'src/routeScope.gen.ts')).toMatchFileSnapshot( + 'route-modules/host-params/routeScope.snapshot.ts', + ) + await expect(readNamespace(shop, 'catalog')).toMatchFileSnapshot( + 'route-modules/host-params/routeScope.catalog.snapshot.ts', + ) + await expect(read(shop, 'src/routeContract.gen.ts')).toMatchFileSnapshot( + 'route-modules/host-params/routeContract.snapshot.ts', + ) + }) + + it('adds the path params inside a module for the modules it installs', async () => { + const shop = await writeShop() + await generate(shop) + const app = await writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/shop'], + files: { + 'src/routes/__root.tsx': `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +`, + }, + }) + await generate(app, { routeModules: { includes: ['@fixture/shop'] } }) + + const scope = compact(readNamespace(app, 'catalog')) + expect(scope).toContain( + "HostedRouter< FixtureShopInstalledRouters['@fixture/catalog'], MountedModuleHostParams['@fixture/shop'] & FixtureShopInstalledHostParams['@fixture/catalog']", + ) + expect(scope).toContain("bindRouteScopeLink('@fixture/catalog')") + // The shop itself is mounted at the root: its namespace takes no params. + expect(compact(readNamespace(app, 'shop'))).toContain( + "type Router = ScopedRouter", + ) + }) + + async function writeAccount() { + const account = await writePackage({ + name: '@fixture/account', + packageJson: { + tanstack: { router: { module: { uses: ['@fixture/catalog'] } } }, + }, + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/account:/'), + }, + }) + await generate(account) + } + + it('rejects a module that uses it from outside the routes with the params', async () => { + const shop = await writeShop([ + { module: '@fixture/account', at: '/account' }, + ]) + await writeAccount() + + await expect(generate(shop)).rejects.toThrow( + '"@fixture/account" links into "@fixture/catalog", which is mounted below "/orgs/$orgId", but "@fixture/account" is mounted at "/account"', + ) + }) + + it('accepts a module that uses it from below the routes with the params', async () => { + const shop = await writeShop([ + { module: '@fixture/account', parent: '/orgs/$orgId', at: '/account' }, + ]) + await writeAccount() + + await generate(shop) + expect(compact(readNamespace(shop, 'account'))).toContain( + "HostedRouter< FixtureAccountRouter, MountedModuleHostParams['@fixture/account']", + ) + }) +}) + +describe('installing a module several times', () => { + const appRoute = ( + path: string, + ) => `import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('${path}')({}) +` + + /** + * `@fixture/app` installs the catalog under `/orgs/$orgId` (`orgCatalog`) + * and `/users/$userId` (`userCatalog`); `@fixture/account`, which uses the + * catalog, is mounted at `account`. + */ + async function writeApp() { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + const account = await writePackage({ + name: '@fixture/account', + packageJson: { + tanstack: { router: { module: { uses: ['@fixture/catalog'] } } }, + }, + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/account:/'), + }, + }) + await generate(account) + return writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog', '@fixture/account'], + files: { + 'src/routes/__root.tsx': `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +`, + 'src/routes/orgs.$orgId.tsx': appRoute('/orgs/$orgId'), + 'src/routes/users.$userId.tsx': appRoute('/users/$userId'), + }, + }) + } + + const installations = [ + { + module: '@fixture/catalog', + parent: '/orgs/$orgId', + at: '/catalog', + as: 'orgCatalog', + }, + { + module: '@fixture/catalog', + parent: '/users/$userId', + at: '/catalog', + as: 'userCatalog', + }, + ] + + it('mounts every installation and gives it a namespace', async () => { + const app = await writeApp() + await generate(app, { + routeModules: { + includes: [ + ...installations, + { + module: '@fixture/account', + parent: '/orgs/$orgId', + at: '/account', + }, + ], + }, + }) + + await expect(read(app, 'src/routeTree.gen.ts')).toMatchFileSnapshot( + 'route-modules/installations/routeTree.snapshot.ts', + ) + await expect(read(app, 'src/routeScope.gen.ts')).toMatchFileSnapshot( + 'route-modules/installations/routeScope.snapshot.ts', + ) + for (const namespace of ['orgCatalog', 'userCatalog', 'account']) { + await expect(readNamespace(app, namespace)).toMatchFileSnapshot( + `route-modules/installations/routeScope.${namespace}.snapshot.ts`, + ) + } + }) + + it('requires a name for every installation', async () => { + const app = await writeApp() + + await expect( + generate(app, { + routeModules: { + includes: [installations[0], { ...installations[1], as: undefined }], + }, + }), + ).rejects.toThrow( + '"@fixture/catalog" is included more than once. Name every installation with "as".', + ) + await expect( + generate(app, { + routeModules: { + includes: [ + installations[0], + { ...installations[1], as: 'orgCatalog' }, + ], + }, + }), + ).rejects.toThrow( + 'two installations of "@fixture/catalog" are named "orgCatalog"', + ) + }) + + it('rejects a module that uses it from below no installation', async () => { + const app = await writeApp() + + await expect( + generate(app, { + routeModules: { + includes: [ + ...installations, + { module: '@fixture/account', at: '/account' }, + ], + }, + }), + ).rejects.toThrow( + '"@fixture/account" links into "@fixture/catalog", which is installed several times, but no installation can take path params from "/account"', + ) + }) + + it('names a single named installation in its diagnostics', async () => { + const app = await writeApp() + + await expect( + generate(app, { + routeModules: { + includes: [ + installations[0], + { module: '@fixture/account', at: '/account' }, + ], + }, + }), + ).rejects.toThrow( + '"@fixture/account" links into "@fixture/catalog", which is installed as "orgCatalog", but it cannot take path params from "/account". Mount "@fixture/account" below the routes with the path params of that installation.', + ) + }) + + it('rejects a module that links into a named installation from inside another module', async () => { + await writeApp() + const shop = await writePackage({ + name: '@fixture/shop', + packageJson: { + tanstack: { + router: { + module: { + includes: [{ module: '@fixture/account', at: '/account' }], + }, + }, + }, + }, + dependencies: ['@fixture/account'], + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/shop:/'), + }, + }) + await generate(shop) + const host = await writePackage({ + name: '@fixture/host', + dependencies: ['@fixture/catalog', '@fixture/shop'], + files: { + 'src/routes/__root.tsx': `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +`, + 'src/routes/orgs.$orgId.tsx': appRoute('/orgs/$orgId'), + }, + }) + + await expect( + generate(host, { + routeModules: { + includes: [ + installations[0], + { module: '@fixture/shop', parent: '/orgs/$orgId', at: '/shop' }, + ], + }, + }), + ).rejects.toThrow( + '"@fixture/account" links into "@fixture/catalog", which this application installs as "orgCatalog", but "@fixture/account" is installed by "@fixture/shop", which cannot choose an installation. Install "@fixture/account" in this application.', + ) + }) + + it('lets only applications install a module several times', async () => { + const catalog = await writePackage(catalogPackage()) + await generate(catalog) + const shop = await writePackage({ + name: '@fixture/shop', + packageJson: { + tanstack: { router: { module: { includes: installations } } }, + }, + dependencies: ['@fixture/catalog'], + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/orgs.$orgId.tsx': route('@fixture/shop:/orgs/$orgId'), + 'src/routes/users.$userId.tsx': route('@fixture/shop:/users/$userId'), + }, + }) + + await expect(generate(shop)).rejects.toThrow( + 'Only an application can install a route module several times.', + ) + }) + + describe('namespace file layouts', () => { + const includes = { routeModules: { includes: installations } } + // Every relative import of the scope and its namespaces resolves to a + // generated file, wherever the layout puts them. + const expectGeneratedImportsResolve = async (app: string) => { + const src = path.join(app, 'src') + const files = (await fs.readdir(src, { recursive: true })) + .filter((file) => /^(?!routes\/).*\.ts$/.test(file)) + .map((file) => path.join(src, file)) + for (const file of files) { + for (const [, from] of readFileSync(file, 'utf8').matchAll( + /from '(\.{1,2}\/[^']+)'/g, + )) { + expect( + ['.ts', '.tsx'].some((extension) => + existsSync(path.resolve(path.dirname(file), from + extension)), + ), + `${path.relative(src, file)} imports ${from}`, + ).toBe(true) + } + } + } + const scopeImports = (app: string) => + [ + ...read(app, 'src/routeScope.gen.ts').matchAll( + /export \* as (\w+) from '([^']+)'/g, + ), + ].map(([, name, from]) => [name, from]) + + it.each([ + [ + 'indexed', + [ + ['orgCatalog', './routeScope.gen.namespace0'], + ['userCatalog', './routeScope.gen.namespace1'], + ], + ], + [ + 'named', + [ + ['orgCatalog', './routeScope.gen.orgCatalog'], + ['userCatalog', './routeScope.gen.userCatalog'], + ], + ], + [ + 'folder', + [ + ['orgCatalog', './routeScope.gen/orgCatalog'], + ['userCatalog', './routeScope.gen/userCatalog'], + ], + ], + ] as const)('%s', async (layout, expected) => { + const app = await writeApp() + await generate(app, { ...includes, routeScopeNamespaceFiles: layout }) + expect(scopeImports(app)).toEqual(expected) + for (const [, from] of expected) { + expect(existsSync(path.join(app, 'src', `${from}.ts`))).toBe(true) + } + await expectGeneratedImportsResolve(app) + }) + + it('takes the path of each namespace from a function', async () => { + const app = await writeApp() + const seen: Array = [] + await generate(app, { + ...includes, + routeScopeNamespaceFiles: (namespace: { name: string }) => { + seen.push(namespace) + return `scopes/${namespace.name}.gen` + }, + }) + expect(seen).toEqual([ + { + name: 'orgCatalog', + moduleId: '@fixture/catalog', + key: '@fixture/catalog#orgCatalog', + index: 0, + }, + { + name: 'userCatalog', + moduleId: '@fixture/catalog', + key: '@fixture/catalog#userCatalog', + index: 1, + }, + ]) + expect(scopeImports(app)).toEqual([ + ['orgCatalog', './scopes/orgCatalog.gen'], + ['userCatalog', './scopes/userCatalog.gen'], + ]) + // A namespace below the generated directory imports the route tree + // relative to its own location. + expect(read(app, 'src/scopes/orgCatalog.gen.ts')).toContain( + "from '../routeTree.gen'", + ) + await expectGeneratedImportsResolve(app) + }) + + it('removes the files of an earlier layout', async () => { + const app = await writeApp() + await generate(app, { ...includes, routeScopeNamespaceFiles: 'folder' }) + expect(existsSync(path.join(app, 'src/routeScope.gen'))).toBe(true) + await generate(app, { ...includes, routeScopeNamespaceFiles: 'named' }) + expect(existsSync(path.join(app, 'src/routeScope.gen'))).toBe(false) + expect( + existsSync(path.join(app, 'src/routeScope.gen.orgCatalog.ts')), + ).toBe(true) + await generate(app, includes) + expect( + (await fs.readdir(path.join(app, 'src'))) + .filter((file) => file.startsWith('routeScope.gen')) + .sort(), + ).toEqual([ + 'routeScope.gen.namespace0.ts', + 'routeScope.gen.namespace1.ts', + 'routeScope.gen.ts', + ]) + }) + + it.each([ + [ + 'outside the generated directory', + () => '../outside', + /must be a path inside the directory of the generated route tree/, + ], + [ + 'an absolute path', + () => '/tmp/namespace', + /must be a path inside the directory of the generated route tree/, + ], + [ + 'paths that differ only in case', + (namespace: { index: number }) => (namespace.index ? 'Scope' : 'scope'), + /clashes with "scope"/, + ], + [ + 'a generated file of the module', + () => 'routeTree.gen', + /clashes with "routeTree.gen"/, + ], + [ + 'the routes directory', + (namespace: { name: string }) => `routes/${namespace.name}`, + /inside the routes directory/, + ], + ])('rejects %s', async (_, layout, error) => { + const app = await writeApp() + await expect( + generate(app, { ...includes, routeScopeNamespaceFiles: layout }), + ).rejects.toThrow(error) + }) + }) +}) + +describe('TanStack Start fragments', () => { + const startDependency = { '@tanstack/react-start': '*' } + const startFile = `import { createStartModule } from './routeScope.gen' + +export const start = createStartModule(() => ({})) +` + const appRoot = `import { createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute() +` + + async function writeStartCatalog(withFragment = true) { + const base = catalogPackage() + const catalog = await writePackage({ + ...base, + packageJson: { ...base.packageJson, dependencies: startDependency }, + files: { + ...base.files, + ...(withFragment ? { 'src/start.ts': startFile } : {}), + }, + }) + await generate(catalog) + return catalog + } + + async function writeStartApp(opts: { + startApp: boolean + startFile: boolean + }) { + return writePackage({ + name: '@fixture/app', + dependencies: ['@fixture/catalog'], + packageJson: { + dependencies: { + '@fixture/catalog': '*', + ...(opts.startApp ? startDependency : {}), + }, + }, + files: { + 'src/routes/__root.tsx': appRoot, + ...(opts.startFile + ? { + 'src/start.ts': `import { createStart } from '@tanstack/react-start' +import { startModules } from './startModules.gen' + +export const startInstance = createStart(() => ({ extends: startModules })) +`, + } + : {}), + }, + }) + } + + it('gives a Start module typed server functions and exports its fragment', async () => { + const catalog = await writeStartCatalog() + + await expect(read(catalog, 'src/routeScope.gen.ts')).toMatchFileSnapshot( + 'route-modules/start-module/routeScope.snapshot.ts', + ) + await expect(read(catalog, 'src/routeModule.gen.ts')).toMatchFileSnapshot( + 'route-modules/start-module/routeModule.snapshot.ts', + ) + expect(readRouteModuleManifest(catalog)!.startModules).toBe(true) + }) + + it('registers a Start module without a fragment for server rendering only', async () => { + const catalog = await writeStartCatalog(false) + + // The register lives in the contract, so the module's emitted route + // declarations never reach the scope file and its namespaces. + const contract = read(catalog, 'src/routeContract.gen.ts') + expect(contract).toContain(' ssr: true\n}') + expect(contract).not.toContain('StartModuleConfig') + const scope = read(catalog, 'src/routeScope.gen.ts') + expect(scope).toContain('export const createServerFn') + expect(scope).not.toContain('StartModuleConfig') + expect(scope).not.toContain("from './start'") + expect(read(catalog, 'src/routeModule.gen.ts')).not.toContain( + 'startModules', + ) + expect(readRouteModuleManifest(catalog)!.startModules).toBe(false) + }) + + it('generates installed requirement validation for the default Start instance', async () => { + await writeStartCatalog(false) + const app = await writeStartApp({ startApp: true, startFile: false }) + await generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }) + const validation = compact(read(app, 'src/startModules.gen.ts')) + expect(validation).toContain( + 'export type StartModulesCheck = AssertStartModules<', + ) + expect(validation).toMatch( + /ValidateStartModules<[^,]+, typeof startModules, readonly \['@fixture\/catalog'\]/, + ) + expect(validation).toContain("from '@tanstack/react-start'") + }) + + it('passes the fragments of mounted modules on to the application', async () => { + await writeStartCatalog() + const shop = await writePackage({ + name: '@fixture/shop', + packageJson: { + tanstack: { + router: { + module: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }, + }, + }, + dependencies: ['@fixture/catalog'], + files: { 'src/routes/__root.tsx': moduleRoot }, + }) + await generate(shop) + + const routeModule = read(shop, 'src/routeModule.gen.ts') + expect(routeModule).toContain( + "import { startModules as FixtureCatalogStartModules } from '@fixture/catalog/route-module'", + ) + expect(routeModule).toMatch( + /export const startModules: readonly \[\.\.\.typeof FixtureCatalogStartModules\] = \[\s*\.\.\.FixtureCatalogStartModules,?\s*\]/, + ) + // The includer itself does not use Start. + expect(read(shop, 'src/routeScope.gen.ts')).not.toContain('createServerFn') + expect(readRouteModuleManifest(shop)!.startModules).toBe(true) + }) + + it('lists the fragments for the Start instance of an application', async () => { + await writeStartCatalog() + const app = await writeStartApp({ startApp: true, startFile: true }) + await generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }) + + await expect(read(app, 'src/startModules.gen.ts')).toMatchFileSnapshot( + 'route-modules/start-application/startModules.snapshot.ts', + ) + }) + + it('retains installed requirement validation when the final fragment is removed', async () => { + await writeStartCatalog() + const app = await writeStartApp({ startApp: true, startFile: true }) + await generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }) + expect(existsSync(path.join(app, 'src/startModules.gen.ts'))).toBe(true) + + await writeStartCatalog(false) + await fs.rm(path.join(workspace, 'catalog/src/start.ts')) + await generate(path.join(workspace, 'catalog')) + await generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }) + const validation = compact(read(app, 'src/startModules.gen.ts')) + expect(validation).toContain('export const startModules: readonly [] = []') + expect(validation).toContain( + 'export type StartModulesCheck = AssertStartModules<', + ) + expect(validation).toContain("readonly ['@fixture/catalog']") + }) + + it('requires a Start file in an application that installs a fragment', async () => { + await writeStartCatalog() + const app = await writeStartApp({ startApp: true, startFile: false }) + + await expect( + generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }), + ).rejects.toThrow( + /"@fixture\/catalog" has a TanStack Start fragment\. Install it in ".*src[\\/]start\.ts": export const startInstance = createStart/, + ) + }) + + it('rejects a fragment in an application without TanStack Start', async () => { + await writeStartCatalog() + const app = await writeStartApp({ startApp: false, startFile: false }) + + await expect( + generate(app, { + routeModules: { + includes: [{ module: '@fixture/catalog', at: '/catalog' }], + }, + }), + ).rejects.toThrow( + /Install it in a TanStack Start application, which depends on "@tanstack\/react-start"/, + ) + }) +}) + +describe('linking in both directions', () => { + const productsRoutes = { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/products:/'), + 'src/routes/$productId.tsx': route('@fixture/products:/$productId'), + } + const accountRoutes = { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/account:/'), + 'src/routes/orders.$orderId.tsx': route( + '@fixture/account:/orders/$orderId', + ), + } + const usesPackage = ( + name: string, + uses: Array, + files: Record, + field: + | 'dependencies' + | 'devDependencies' + | 'peerDependencies' = 'peerDependencies', + ): PackageSpec => ({ + name, + packageJson: { + tanstack: { router: { module: { uses } } }, + dependencies: {}, + [field]: Object.fromEntries(uses.map((used) => [used, '*'])), + }, + dependencies: uses, + files, + }) + const generatedFiles = (root: string) => + Object.fromEntries( + [ + 'src/routeTree.gen.ts', + 'src/routeScope.gen.ts', + 'src/routeScope.gen.namespace0.ts', + 'src/routeContract.gen.ts', + 'src/routeModule.gen.ts', + '.tanstack/route-module.json', + '.tanstack/route-types-stubs.d.ts', + ].map((file) => [file, read(root, file)]), + ) + + it('generates modules that use each other in either order', async () => { + const products = await writePackage( + usesPackage('@fixture/products', ['@fixture/account'], productsRoutes), + ) + const account = await writePackage( + usesPackage('@fixture/account', ['@fixture/products'], accountRoutes), + ) + + // Neither module has generated yet: a used module is read from its + // package.json, never from its manifest. + await generate(products) + const beforeAccount = generatedFiles(products) + expect(existsSync(path.join(account, '.tanstack'))).toBe(false) + await generate(account) + await generate(products) + expect(generatedFiles(products)).toEqual(beforeAccount) + + // The contract reaches the module's own files only; the namespace file + // carries the type dependency on the used contract. + const routeTree = read(products, 'src/routeTree.gen.ts') + expect(routeTree).not.toContain('@fixture/account/route-types') + expect(routeTree).not.toContain('MountedRoutesById') + expect(read(products, 'src/routeContract.gen.ts')).not.toContain( + './routeScope.gen', + ) + expect(readNamespace(products, 'account')).toContain( + "import type { Router as FixtureAccountRouter } from '@fixture/account/route-types'", + ) + await expect( + read(products, '.tanstack/route-types-stubs.d.ts'), + ).toMatchFileSnapshot('route-modules/cycle/route-types-stubs.snapshot.d.ts') + expect(readRouteModuleManifest(products)!.modules[0]!.uses).toEqual([ + '@fixture/account', + ]) + expect(readRouteModuleManifest(account)!.modules[0]!.uses).toEqual([ + '@fixture/products', + ]) + }) + + it.each(['dependencies', 'devDependencies', 'peerDependencies'] as const)( + 'resolves a used module declared in %s', + async (field) => { + await writePackage({ + name: '@fixture/account', + packageJson: { tanstack: { router: { module: true } } }, + files: accountRoutes, + }) + const products = await writePackage( + usesPackage( + '@fixture/products', + ['@fixture/account'], + productsRoutes, + field, + ), + ) + await generate(products) + expect(read(products, 'src/routeScope.gen.ts')).toContain( + 'export * as account from', + ) + }, + ) + + it('rejects a used module that is not declared', async () => { + await writePackage({ + name: '@fixture/account', + packageJson: { tanstack: { router: { module: true } } }, + files: accountRoutes, + }) + const products = await writePackage({ + name: '@fixture/products', + packageJson: { + tanstack: { router: { module: { uses: ['@fixture/account'] } } }, + dependencies: {}, + }, + dependencies: ['@fixture/account'], + files: productsRoutes, + }) + await expect(generate(products)).rejects.toThrow( + /"@fixture\/account" is listed in "uses" but is not a dependency\. Add it to "dependencies", "devDependencies" or "peerDependencies"/, + ) + }) + + it('writes an empty stub file for a module that uses nothing', async () => { + const products = await writePackage({ + name: '@fixture/products', + packageJson: { tanstack: { router: { module: true } } }, + files: productsRoutes, + }) + await generate(products) + const stubs = read(products, '.tanstack/route-types-stubs.d.ts') + expect(stubs).toContain('declaration build only') + expect(stubs).not.toContain('declare module') + }) + + it('links back into the module that includes it', async () => { + // storefront includes products at /products; products links to the cart + // of whatever storefront mounts it. + const products = await writePackage( + usesPackage('@fixture/products', ['@fixture/storefront'], productsRoutes), + ) + const storefront = await writePackage({ + name: '@fixture/storefront', + packageJson: { + tanstack: { + router: { + module: { + includes: [{ module: '@fixture/products', at: '/products' }], + }, + }, + }, + }, + dependencies: ['@fixture/products'], + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/index.tsx': route('@fixture/storefront:/'), + 'src/routes/cart.tsx': route('@fixture/storefront:/cart'), + }, + }) + await generate(products) + await generate(storefront) + await generate(products) + + // The module is not a namespace of itself, and its own scope does not + // import the including module's contract. + const scope = read(products, 'src/routeScope.gen.ts') + expect(scope).toContain('export * as storefront from') + expect(scope).not.toContain('export * as products from') + expect(read(products, 'src/routeTree.gen.ts')).not.toContain( + '@fixture/storefront/route-types', + ) + expect(compact(readNamespace(products, 'storefront'))).toContain( + "localRouteId.startsWith('@fixture/storefront:')", + ) + expect(readRouteModuleManifest(storefront)!.modules).toEqual([ + expect.objectContaining({ id: '@fixture/storefront' }), + expect.objectContaining({ + id: '@fixture/products', + uses: ['@fixture/storefront'], + mountPath: '/products/', + }), + ]) + }) + + it('exposes the modules a used module installs through its contract', async () => { + const products = await writePackage({ + name: '@fixture/products', + packageJson: { tanstack: { router: { module: true } } }, + files: productsRoutes, + }) + const storefront = await writePackage({ + name: '@fixture/storefront', + packageJson: { + tanstack: { + router: { + module: { + includes: [{ module: '@fixture/products', at: '/products' }], + }, + }, + }, + }, + dependencies: ['@fixture/products'], + files: { + 'src/routes/__root.tsx': moduleRoot, + 'src/routes/cart.tsx': route('@fixture/storefront:/cart'), + }, + }) + const account = await writePackage( + usesPackage('@fixture/account', ['@fixture/storefront'], accountRoutes), + ) + // Only account has generated: the installed modules of the used + // storefront come from the package.json files of storefront and products. + await generate(account) + expect(existsSync(path.join(storefront, '.tanstack'))).toBe(false) + expect(existsSync(path.join(products, '.tanstack'))).toBe(false) + const scope = read(account, 'src/routeScope.gen.ts') + expect(scope).toContain('export * as storefront from') + expect(scope).toContain('export * as products from') + expect(compact(readNamespace(account, 'products'))).toContain( + "import type { InstalledRouters as FixtureStorefrontInstalledRouters } from '@fixture/storefront/route-types'", + ) + const guard = compact(readNamespace(account, 'storefront')) + expect(guard).toContain("localRouteId.startsWith('@fixture/storefront:')") + expect(guard).toContain("localRouteId.startsWith('@fixture/products:')") + const stubs = read(account, '.tanstack/route-types-stubs.d.ts') + expect(stubs).toContain("declare module '@fixture/storefront/route-types'") + expect(stubs).not.toContain( + "declare module '@fixture/products/route-types'", + ) + // The stand-in declares every name the namespaces import from the contract. + const imported = [ + ...[ + readNamespace(account, 'storefront'), + readNamespace(account, 'products'), + ] + .join('\n') + .matchAll( + /import type \{ ([^}]+) \} from '@fixture\/storefront\/route-types'/g, + ), + ].flatMap(([, names]) => + names!.split(',').map((name) => name.trim().split(' as ')[0]!), + ) + expect(imported).toEqual(['Router', 'InstalledRouters']) + for (const name of imported) { + expect(stubs).toMatch(new RegExp(`export (?:type|interface) ${name}\\b`)) + } + }) + + it('rejects modules that include each other', async () => { + await writePackage({ + name: '@fixture/a', + packageJson: { + tanstack: { router: { module: { includes: ['@fixture/b'] } } }, + }, + dependencies: ['@fixture/b'], + files: { 'src/routes/__root.tsx': moduleRoot }, + }) + const b = await writePackage({ + name: '@fixture/b', + packageJson: { + tanstack: { router: { module: { includes: ['@fixture/a'] } } }, + }, + dependencies: ['@fixture/a'], + files: { 'src/routes/__root.tsx': moduleRoot }, + }) + await expect(generate(b)).rejects.toThrow( + /"@fixture\/b" includes "@fixture\/a", which includes "@fixture\/b"\. Route modules cannot include each other; link into another module's routes with "uses"\./, + ) + }) +}) diff --git a/packages/router-generator/tests/route-modules/application/routeScope.catalog.snapshot.ts b/packages/router-generator/tests/route-modules/application/routeScope.catalog.snapshot.ts new file mode 100644 index 0000000000..cd40fcdcca --- /dev/null +++ b/packages/router-generator/tests/route-modules/application/routeScope.catalog.snapshot.ts @@ -0,0 +1,213 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopedRouter } from '@tanstack/react-router' + +import type { Router as FixtureCatalogRouter } from '@fixture/catalog/route-types' + +type Router = ScopedRouter + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeUseLinkProps, +} from '@tanstack/react-router/_internal/route-module' + +import { + getRouteApi as frameworkGetRouteApi, + useMatch as frameworkUseMatch, + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLoaderData as frameworkUseLoaderData, + useLoaderDeps as frameworkUseLoaderDeps, + useSearch as frameworkUseSearch, + useParams as frameworkUseParams, + useRouteContext as frameworkUseRouteContext, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, + notFound as frameworkNotFound, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/catalog') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink('@fixture/catalog') + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions('@fixture/catalog') + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/catalog') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate('@fixture/catalog') + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/catalog') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute('@fixture/catalog') + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute('@fixture/catalog') + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/catalog') + +export const getRouteApi: RouteScope['getRouteApi'] = + frameworkGetRouteApi as never + +export const useMatch: RouteScope['useMatch'] = + frameworkUseMatch as never + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + frameworkUseLoaderData as never + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + frameworkUseLoaderDeps as never + +export const useSearch: RouteScope['useSearch'] = + frameworkUseSearch as never + +export const useParams: RouteScope['useParams'] = + frameworkUseParams as never + +export const useRouteContext: RouteScope['useRouteContext'] = + frameworkUseRouteContext as never + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps('@fixture/catalog') + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + frameworkNotFound as never + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray + +export type ValidateFromPath = RouterValidateFromPath< + Router, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + Router, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + Router +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + Router +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + const localRouteId = match.localRouteId ?? '' + return localRouteId.startsWith('@fixture/catalog:') +} diff --git a/packages/router-generator/tests/route-modules/application/routeScope.snapshot.ts b/packages/router-generator/tests/route-modules/application/routeScope.snapshot.ts new file mode 100644 index 0000000000..631ae0fb37 --- /dev/null +++ b/packages/router-generator/tests/route-modules/application/routeScope.snapshot.ts @@ -0,0 +1,9 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +export * as catalog from './routeScope.gen.namespace0' diff --git a/packages/router-generator/tests/route-modules/application/routeTree.snapshot.ts b/packages/router-generator/tests/route-modules/application/routeTree.snapshot.ts new file mode 100644 index 0000000000..7dca3bfddd --- /dev/null +++ b/packages/router-generator/tests/route-modules/application/routeTree.snapshot.ts @@ -0,0 +1,79 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { mountRouteModule } from '@tanstack/react-router/_internal/route-module' +import { routeModule as FixtureCatalogRouteModule } from '@fixture/catalog/route-module' +import type { MountedRoutesById } from '@tanstack/react-router' +import type { InstalledRoutesById as FixtureCatalogInstalledRoutesById } from '@fixture/catalog/route-types' + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) + +const FixtureCatalogModuleRoute: typeof FixtureCatalogRouteModule = + mountRouteModule(FixtureCatalogRouteModule, { + parent: () => rootRouteImport, + at: '/catalog', + }) + +/** The path params of the routes above each mounted route module. */ +export interface MountedModuleHostParams { + '@fixture/catalog': (typeof rootRouteImport)['types']['allParams'] +} + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/': typeof IndexRoute +} +interface RouteModuleRoutesById + extends + FileRoutesById, + MountedRoutesById {} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/' + fileRoutesByTo: FileRoutesByTo + to: '/' + id: keyof RouteModuleRoutesById + fileRoutesById: RouteModuleRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + FixtureCatalogModuleRoute: typeof FixtureCatalogModuleRoute +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + FixtureCatalogModuleRoute: FixtureCatalogModuleRoute, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/packages/router-generator/tests/route-modules/cycle/route-types-stubs.snapshot.d.ts b/packages/router-generator/tests/route-modules/cycle/route-types-stubs.snapshot.d.ts new file mode 100644 index 0000000000..fc0adc5cf9 --- /dev/null +++ b/packages/router-generator/tests/route-modules/cycle/route-types-stubs.snapshot.d.ts @@ -0,0 +1,20 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +// Stand-ins for the contracts of the route modules this module uses. Include +// this file in the declaration build only (tsconfig.route-types.json): there it +// replaces the real contracts, so the build needs no ordering against the modules +// it links into. The source check (tsconfig.json) must not include it. + +declare module '@fixture/account/route-types' { + import type { AnyRoute, ScopeRouter } from '@tanstack/react-router' + export type Router = ScopeRouter + export interface InstalledRouters { + [key: string]: Router + } +} diff --git a/packages/router-generator/tests/route-modules/host-params/routeContract.snapshot.ts b/packages/router-generator/tests/route-modules/host-params/routeContract.snapshot.ts new file mode 100644 index 0000000000..118e3d1a71 --- /dev/null +++ b/packages/router-generator/tests/route-modules/host-params/routeContract.snapshot.ts @@ -0,0 +1,53 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopeRouter } from '@tanstack/react-router' +import type { + FileRoutesById, + MountedModuleHostParams, + routeTree, +} from './routeTree.gen' +import type { + InstalledRoutesById as FixtureCatalogInstalledRoutesById, + InstalledRouters as FixtureCatalogInstalledRouters, +} from '@fixture/catalog/route-types' + +/** The router of "@fixture/shop": module-local paths, qualified ids. */ +export type RouteModuleRouter = ScopeRouter + +/** The register of "@fixture/shop": the scope its route factories and route-bound APIs are typed against. */ +export interface RouteModuleRegister { + router: RouteModuleRouter +} + +/** The route tree of "@fixture/shop": its module root with all its routes. */ +export type RouteModuleTree = typeof routeTree + +/** The router type of "@fixture/shop" (module-local paths, qualified ids). */ +export type Router = RouteModuleRouter + +/** The routes of "@fixture/shop" by qualified id, without other modules. */ +export type OwnRoutesById = FileRoutesById + +/** All routes installed with "@fixture/shop", including the modules it mounts. */ +export interface InstalledRoutesById + extends FileRoutesById, FixtureCatalogInstalledRoutesById {} + +/** The routers of "@fixture/shop" and of every module it mounts, by module id. */ +export interface InstalledRouters extends FixtureCatalogInstalledRouters { + '@fixture/shop': Router + '@fixture/catalog': FixtureCatalogInstalledRouters['@fixture/catalog'] +} + +/** + * The path params above every module "@fixture/shop" installs, relative to its + * root. Packages that mount "@fixture/shop" under path params add their own. + */ +export interface InstalledHostParams { + '@fixture/catalog': MountedModuleHostParams['@fixture/catalog'] +} diff --git a/packages/router-generator/tests/route-modules/host-params/routeScope.catalog.snapshot.ts b/packages/router-generator/tests/route-modules/host-params/routeScope.catalog.snapshot.ts new file mode 100644 index 0000000000..15a212ed48 --- /dev/null +++ b/packages/router-generator/tests/route-modules/host-params/routeScope.catalog.snapshot.ts @@ -0,0 +1,221 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopedRouter, HostedRouter } from '@tanstack/react-router' + +import type { Router as FixtureCatalogRouter } from '@fixture/catalog/route-types' + +import type { MountedModuleHostParams } from './routeTree.gen' + +type Router = ScopedRouter< + HostedRouter< + FixtureCatalogRouter, + MountedModuleHostParams['@fixture/catalog'] + >, + '@fixture/catalog' +> + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeUseLinkProps, +} from '@tanstack/react-router/_internal/route-module' + +import { + getRouteApi as frameworkGetRouteApi, + useMatch as frameworkUseMatch, + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLoaderData as frameworkUseLoaderData, + useLoaderDeps as frameworkUseLoaderDeps, + useSearch as frameworkUseSearch, + useParams as frameworkUseParams, + useRouteContext as frameworkUseRouteContext, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, + notFound as frameworkNotFound, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/catalog') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink('@fixture/catalog') + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions('@fixture/catalog') + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/catalog') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate('@fixture/catalog') + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/catalog') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute('@fixture/catalog') + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute('@fixture/catalog') + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/catalog') + +export const getRouteApi: RouteScope['getRouteApi'] = + frameworkGetRouteApi as never + +export const useMatch: RouteScope['useMatch'] = + frameworkUseMatch as never + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + frameworkUseLoaderData as never + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + frameworkUseLoaderDeps as never + +export const useSearch: RouteScope['useSearch'] = + frameworkUseSearch as never + +export const useParams: RouteScope['useParams'] = + frameworkUseParams as never + +export const useRouteContext: RouteScope['useRouteContext'] = + frameworkUseRouteContext as never + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps('@fixture/catalog') + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + frameworkNotFound as never + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray + +export type ValidateFromPath = RouterValidateFromPath< + Router, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + Router, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + Router +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + Router +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + const localRouteId = match.localRouteId ?? '' + return localRouteId.startsWith('@fixture/catalog:') +} diff --git a/packages/router-generator/tests/route-modules/host-params/routeScope.snapshot.ts b/packages/router-generator/tests/route-modules/host-params/routeScope.snapshot.ts new file mode 100644 index 0000000000..66a6e9332e --- /dev/null +++ b/packages/router-generator/tests/route-modules/host-params/routeScope.snapshot.ts @@ -0,0 +1,256 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { bindCreateModuleRoot } from '@tanstack/react-router/_internal/route-module' + +import { createFileRoute as createFrameworkFileRoute } from '@tanstack/react-router' + +import type { FileRouteScope } from '@tanstack/react-router' + +import type { FileRoutesByPath } from './routeTree.gen' + +import type { + RouteModuleRouter, + RouteModuleRegister, +} from './routeContract.gen' + +export type { + RouteModuleRouter, + RouteModuleRegister, +} from './routeContract.gen' + +export const createFileRoute = createFrameworkFileRoute as FileRouteScope< + FileRoutesByPath, + RouteModuleRegister, + '@fixture/shop' +>['createFileRoute'] + +export const createModuleRoot = /* @__PURE__ */ bindCreateModuleRoot< + RouteModuleRegister, + '@fixture/shop' +>('@fixture/shop') + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeUseLinkProps, +} from '@tanstack/react-router/_internal/route-module' + +import { + getRouteApi as frameworkGetRouteApi, + useMatch as frameworkUseMatch, + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLoaderData as frameworkUseLoaderData, + useLoaderDeps as frameworkUseLoaderDeps, + useSearch as frameworkUseSearch, + useParams as frameworkUseParams, + useRouteContext as frameworkUseRouteContext, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, + notFound as frameworkNotFound, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/shop') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink('@fixture/shop') + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions('@fixture/shop') + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/shop') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate('@fixture/shop') + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/shop') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute('@fixture/shop') + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute( + '@fixture/shop', + ) + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/shop') + +export const getRouteApi: RouteScope['getRouteApi'] = + frameworkGetRouteApi as never + +export const useMatch: RouteScope['useMatch'] = + frameworkUseMatch as never + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + frameworkUseLoaderData as never + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + frameworkUseLoaderDeps as never + +export const useSearch: RouteScope['useSearch'] = + frameworkUseSearch as never + +export const useParams: RouteScope['useParams'] = + frameworkUseParams as never + +export const useRouteContext: RouteScope['useRouteContext'] = + frameworkUseRouteContext as never + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps('@fixture/shop') + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + frameworkNotFound as never + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom, + TComp +> + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom +> + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom +> + +export type ValidateFromPath = RouterValidateFromPath< + RouteModuleRouter, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + RouteModuleRouter, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + RouteModuleRouter +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + RouteModuleRouter +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + const localRouteId = match.localRouteId ?? '' + return ( + localRouteId.startsWith('@fixture/shop:') || + localRouteId.startsWith('@fixture/catalog:') + ) +} + +export * as catalog from './routeScope.gen.namespace0' diff --git a/packages/router-generator/tests/route-modules/host-params/routeTree.snapshot.ts b/packages/router-generator/tests/route-modules/host-params/routeTree.snapshot.ts new file mode 100644 index 0000000000..f1f5e14918 --- /dev/null +++ b/packages/router-generator/tests/route-modules/host-params/routeTree.snapshot.ts @@ -0,0 +1,103 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { mountRouteModule } from '@tanstack/react-router/_internal/route-module' +import { routeModule as FixtureCatalogRouteModule } from '@fixture/catalog/route-module' +import type { MountedRoutesById } from '@tanstack/react-router' +import type { InstalledRoutesById as FixtureCatalogInstalledRoutesById } from '@fixture/catalog/route-types' + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as OrgsOrgIdRouteImport } from './routes/orgs.$orgId' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const OrgsOrgIdRoute = OrgsOrgIdRouteImport.update({ + id: '/orgs/$orgId', + path: '/orgs/$orgId', + getParentRoute: () => rootRouteImport, +} as any) + +const FixtureCatalogModuleRoute: typeof FixtureCatalogRouteModule = + mountRouteModule(FixtureCatalogRouteModule, { + parent: () => OrgsOrgIdRoute, + at: '/catalog', + }) + +/** The path params of the routes above each mounted route module. */ +export interface MountedModuleHostParams { + '@fixture/catalog': (typeof OrgsOrgIdRoute)['types']['allParams'] +} + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/orgs/$orgId': typeof OrgsOrgIdRouteWithChildren +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/orgs/$orgId': typeof OrgsOrgIdRouteWithChildren +} +export interface FileRoutesById { + '@fixture/shop:': typeof rootRouteImport + '@fixture/shop:/': typeof IndexRoute + '@fixture/shop:/orgs/$orgId': typeof OrgsOrgIdRouteWithChildren +} +interface RouteModuleRoutesById + extends + FileRoutesById, + MountedRoutesById {} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/' | '/orgs/$orgId' + fileRoutesByTo: FileRoutesByTo + to: '/' | '/orgs/$orgId' + id: keyof RouteModuleRoutesById + fileRoutesById: RouteModuleRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + OrgsOrgIdRoute: typeof OrgsOrgIdRouteWithChildren +} + +export interface FileRoutesByPath { + '@fixture/shop:/': { + id: '@fixture/shop:/' + path: '/' + fullPath: '/' + parentRoute: typeof rootRouteImport + } + '@fixture/shop:/orgs/$orgId': { + id: '@fixture/shop:/orgs/$orgId' + path: '/orgs/$orgId' + fullPath: '/orgs/$orgId' + parentRoute: typeof rootRouteImport + } +} + +interface OrgsOrgIdRouteChildren { + FixtureCatalogModuleRoute: typeof FixtureCatalogModuleRoute +} + +const OrgsOrgIdRouteChildren: OrgsOrgIdRouteChildren = { + FixtureCatalogModuleRoute: FixtureCatalogModuleRoute, +} + +const OrgsOrgIdRouteWithChildren = OrgsOrgIdRoute._addFileChildren( + OrgsOrgIdRouteChildren, +) + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + OrgsOrgIdRoute: OrgsOrgIdRouteWithChildren, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/packages/router-generator/tests/route-modules/includer/routeContract.snapshot.ts b/packages/router-generator/tests/route-modules/includer/routeContract.snapshot.ts new file mode 100644 index 0000000000..118e3d1a71 --- /dev/null +++ b/packages/router-generator/tests/route-modules/includer/routeContract.snapshot.ts @@ -0,0 +1,53 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopeRouter } from '@tanstack/react-router' +import type { + FileRoutesById, + MountedModuleHostParams, + routeTree, +} from './routeTree.gen' +import type { + InstalledRoutesById as FixtureCatalogInstalledRoutesById, + InstalledRouters as FixtureCatalogInstalledRouters, +} from '@fixture/catalog/route-types' + +/** The router of "@fixture/shop": module-local paths, qualified ids. */ +export type RouteModuleRouter = ScopeRouter + +/** The register of "@fixture/shop": the scope its route factories and route-bound APIs are typed against. */ +export interface RouteModuleRegister { + router: RouteModuleRouter +} + +/** The route tree of "@fixture/shop": its module root with all its routes. */ +export type RouteModuleTree = typeof routeTree + +/** The router type of "@fixture/shop" (module-local paths, qualified ids). */ +export type Router = RouteModuleRouter + +/** The routes of "@fixture/shop" by qualified id, without other modules. */ +export type OwnRoutesById = FileRoutesById + +/** All routes installed with "@fixture/shop", including the modules it mounts. */ +export interface InstalledRoutesById + extends FileRoutesById, FixtureCatalogInstalledRoutesById {} + +/** The routers of "@fixture/shop" and of every module it mounts, by module id. */ +export interface InstalledRouters extends FixtureCatalogInstalledRouters { + '@fixture/shop': Router + '@fixture/catalog': FixtureCatalogInstalledRouters['@fixture/catalog'] +} + +/** + * The path params above every module "@fixture/shop" installs, relative to its + * root. Packages that mount "@fixture/shop" under path params add their own. + */ +export interface InstalledHostParams { + '@fixture/catalog': MountedModuleHostParams['@fixture/catalog'] +} diff --git a/packages/router-generator/tests/route-modules/includer/routeScope.catalog.snapshot.ts b/packages/router-generator/tests/route-modules/includer/routeScope.catalog.snapshot.ts new file mode 100644 index 0000000000..cd40fcdcca --- /dev/null +++ b/packages/router-generator/tests/route-modules/includer/routeScope.catalog.snapshot.ts @@ -0,0 +1,213 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopedRouter } from '@tanstack/react-router' + +import type { Router as FixtureCatalogRouter } from '@fixture/catalog/route-types' + +type Router = ScopedRouter + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeUseLinkProps, +} from '@tanstack/react-router/_internal/route-module' + +import { + getRouteApi as frameworkGetRouteApi, + useMatch as frameworkUseMatch, + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLoaderData as frameworkUseLoaderData, + useLoaderDeps as frameworkUseLoaderDeps, + useSearch as frameworkUseSearch, + useParams as frameworkUseParams, + useRouteContext as frameworkUseRouteContext, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, + notFound as frameworkNotFound, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/catalog') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink('@fixture/catalog') + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions('@fixture/catalog') + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/catalog') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate('@fixture/catalog') + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/catalog') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute('@fixture/catalog') + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute('@fixture/catalog') + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/catalog') + +export const getRouteApi: RouteScope['getRouteApi'] = + frameworkGetRouteApi as never + +export const useMatch: RouteScope['useMatch'] = + frameworkUseMatch as never + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + frameworkUseLoaderData as never + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + frameworkUseLoaderDeps as never + +export const useSearch: RouteScope['useSearch'] = + frameworkUseSearch as never + +export const useParams: RouteScope['useParams'] = + frameworkUseParams as never + +export const useRouteContext: RouteScope['useRouteContext'] = + frameworkUseRouteContext as never + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps('@fixture/catalog') + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + frameworkNotFound as never + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray + +export type ValidateFromPath = RouterValidateFromPath< + Router, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + Router, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + Router +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + Router +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + const localRouteId = match.localRouteId ?? '' + return localRouteId.startsWith('@fixture/catalog:') +} diff --git a/packages/router-generator/tests/route-modules/includer/routeScope.snapshot.ts b/packages/router-generator/tests/route-modules/includer/routeScope.snapshot.ts new file mode 100644 index 0000000000..66a6e9332e --- /dev/null +++ b/packages/router-generator/tests/route-modules/includer/routeScope.snapshot.ts @@ -0,0 +1,256 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { bindCreateModuleRoot } from '@tanstack/react-router/_internal/route-module' + +import { createFileRoute as createFrameworkFileRoute } from '@tanstack/react-router' + +import type { FileRouteScope } from '@tanstack/react-router' + +import type { FileRoutesByPath } from './routeTree.gen' + +import type { + RouteModuleRouter, + RouteModuleRegister, +} from './routeContract.gen' + +export type { + RouteModuleRouter, + RouteModuleRegister, +} from './routeContract.gen' + +export const createFileRoute = createFrameworkFileRoute as FileRouteScope< + FileRoutesByPath, + RouteModuleRegister, + '@fixture/shop' +>['createFileRoute'] + +export const createModuleRoot = /* @__PURE__ */ bindCreateModuleRoot< + RouteModuleRegister, + '@fixture/shop' +>('@fixture/shop') + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeUseLinkProps, +} from '@tanstack/react-router/_internal/route-module' + +import { + getRouteApi as frameworkGetRouteApi, + useMatch as frameworkUseMatch, + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLoaderData as frameworkUseLoaderData, + useLoaderDeps as frameworkUseLoaderDeps, + useSearch as frameworkUseSearch, + useParams as frameworkUseParams, + useRouteContext as frameworkUseRouteContext, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, + notFound as frameworkNotFound, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/shop') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink('@fixture/shop') + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions('@fixture/shop') + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/shop') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate('@fixture/shop') + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/shop') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute('@fixture/shop') + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute( + '@fixture/shop', + ) + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/shop') + +export const getRouteApi: RouteScope['getRouteApi'] = + frameworkGetRouteApi as never + +export const useMatch: RouteScope['useMatch'] = + frameworkUseMatch as never + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + frameworkUseLoaderData as never + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + frameworkUseLoaderDeps as never + +export const useSearch: RouteScope['useSearch'] = + frameworkUseSearch as never + +export const useParams: RouteScope['useParams'] = + frameworkUseParams as never + +export const useRouteContext: RouteScope['useRouteContext'] = + frameworkUseRouteContext as never + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps('@fixture/shop') + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + frameworkNotFound as never + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom, + TComp +> + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom +> + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom +> + +export type ValidateFromPath = RouterValidateFromPath< + RouteModuleRouter, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + RouteModuleRouter, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + RouteModuleRouter +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + RouteModuleRouter +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + const localRouteId = match.localRouteId ?? '' + return ( + localRouteId.startsWith('@fixture/shop:') || + localRouteId.startsWith('@fixture/catalog:') + ) +} + +export * as catalog from './routeScope.gen.namespace0' diff --git a/packages/router-generator/tests/route-modules/includer/routeTree.snapshot.ts b/packages/router-generator/tests/route-modules/includer/routeTree.snapshot.ts new file mode 100644 index 0000000000..d02ea20b3e --- /dev/null +++ b/packages/router-generator/tests/route-modules/includer/routeTree.snapshot.ts @@ -0,0 +1,99 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { mountRouteModule } from '@tanstack/react-router/_internal/route-module' +import { routeModule as FixtureCatalogRouteModule } from '@fixture/catalog/route-module' +import type { MountedRoutesById } from '@tanstack/react-router' +import type { InstalledRoutesById as FixtureCatalogInstalledRoutesById } from '@fixture/catalog/route-types' + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as LayoutRouteImport } from './routes/_layout' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const LayoutRoute = LayoutRouteImport.update({ + id: '/_layout', + getParentRoute: () => rootRouteImport, +} as any) + +const FixtureCatalogModuleRoute: typeof FixtureCatalogRouteModule = + mountRouteModule(FixtureCatalogRouteModule, { + parent: () => LayoutRoute, + at: '/c', + }) + +/** The path params of the routes above each mounted route module. */ +export interface MountedModuleHostParams { + '@fixture/catalog': (typeof LayoutRoute)['types']['allParams'] +} + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute +} +export interface FileRoutesById { + '@fixture/shop:': typeof rootRouteImport + '@fixture/shop:/': typeof IndexRoute + '@fixture/shop:/_layout': typeof LayoutRouteWithChildren +} +interface RouteModuleRoutesById + extends + FileRoutesById, + MountedRoutesById {} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/' + fileRoutesByTo: FileRoutesByTo + to: '/' + id: keyof RouteModuleRoutesById + fileRoutesById: RouteModuleRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + LayoutRoute: typeof LayoutRouteWithChildren +} + +export interface FileRoutesByPath { + '@fixture/shop:/': { + id: '@fixture/shop:/' + path: '/' + fullPath: '/' + parentRoute: typeof rootRouteImport + } + '@fixture/shop:/_layout': { + id: '@fixture/shop:/_layout' + path: '' + fullPath: '/' + parentRoute: typeof rootRouteImport + } +} + +interface LayoutRouteChildren { + FixtureCatalogModuleRoute: typeof FixtureCatalogModuleRoute +} + +const LayoutRouteChildren: LayoutRouteChildren = { + FixtureCatalogModuleRoute: FixtureCatalogModuleRoute, +} + +const LayoutRouteWithChildren = + LayoutRoute._addFileChildren(LayoutRouteChildren) + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + LayoutRoute: LayoutRouteWithChildren, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/packages/router-generator/tests/route-modules/installations/routeScope.account.snapshot.ts b/packages/router-generator/tests/route-modules/installations/routeScope.account.snapshot.ts new file mode 100644 index 0000000000..985f21d4bb --- /dev/null +++ b/packages/router-generator/tests/route-modules/installations/routeScope.account.snapshot.ts @@ -0,0 +1,221 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopedRouter, HostedRouter } from '@tanstack/react-router' + +import type { Router as FixtureAccountRouter } from '@fixture/account/route-types' + +import type { MountedModuleHostParams } from './routeTree.gen' + +type Router = ScopedRouter< + HostedRouter< + FixtureAccountRouter, + MountedModuleHostParams['@fixture/account'] + >, + '@fixture/account' +> + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeUseLinkProps, +} from '@tanstack/react-router/_internal/route-module' + +import { + getRouteApi as frameworkGetRouteApi, + useMatch as frameworkUseMatch, + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLoaderData as frameworkUseLoaderData, + useLoaderDeps as frameworkUseLoaderDeps, + useSearch as frameworkUseSearch, + useParams as frameworkUseParams, + useRouteContext as frameworkUseRouteContext, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, + notFound as frameworkNotFound, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/account') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink('@fixture/account') + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions('@fixture/account') + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/account') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate('@fixture/account') + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/account') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute('@fixture/account') + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute('@fixture/account') + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/account') + +export const getRouteApi: RouteScope['getRouteApi'] = + frameworkGetRouteApi as never + +export const useMatch: RouteScope['useMatch'] = + frameworkUseMatch as never + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + frameworkUseLoaderData as never + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + frameworkUseLoaderDeps as never + +export const useSearch: RouteScope['useSearch'] = + frameworkUseSearch as never + +export const useParams: RouteScope['useParams'] = + frameworkUseParams as never + +export const useRouteContext: RouteScope['useRouteContext'] = + frameworkUseRouteContext as never + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps('@fixture/account') + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + frameworkNotFound as never + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray + +export type ValidateFromPath = RouterValidateFromPath< + Router, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + Router, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + Router +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + Router +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + const localRouteId = match.localRouteId ?? '' + return localRouteId.startsWith('@fixture/account:') +} diff --git a/packages/router-generator/tests/route-modules/installations/routeScope.orgCatalog.snapshot.ts b/packages/router-generator/tests/route-modules/installations/routeScope.orgCatalog.snapshot.ts new file mode 100644 index 0000000000..a6d455ab90 --- /dev/null +++ b/packages/router-generator/tests/route-modules/installations/routeScope.orgCatalog.snapshot.ts @@ -0,0 +1,240 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopedRouter, HostedRouter } from '@tanstack/react-router' + +import type { Router as FixtureCatalogRouter } from '@fixture/catalog/route-types' + +import type { MountedModuleHostParams } from './routeTree.gen' + +type Router = ScopedRouter< + HostedRouter< + FixtureCatalogRouter, + MountedModuleHostParams['@fixture/catalog#orgCatalog'] + >, + '@fixture/catalog#orgCatalog' +> + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeGetRouteApi, + bindRouteScopeUseMatch, + bindRouteScopeUseLoaderData, + bindRouteScopeUseLoaderDeps, + bindRouteScopeUseSearch, + bindRouteScopeUseParams, + bindRouteScopeUseRouteContext, + bindRouteScopeUseLinkProps, + bindRouteScopeNotFound, +} from '@tanstack/react-router/_internal/route-module' + +import { + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/catalog#orgCatalog') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink( + '@fixture/catalog#orgCatalog', + ) + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions( + '@fixture/catalog#orgCatalog', + ) + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/catalog#orgCatalog') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate( + '@fixture/catalog#orgCatalog', + ) + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/catalog#orgCatalog') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute( + '@fixture/catalog#orgCatalog', + ) + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute( + '@fixture/catalog#orgCatalog', + ) + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/catalog#orgCatalog') + +export const getRouteApi: RouteScope['getRouteApi'] = + /* @__PURE__ */ bindRouteScopeGetRouteApi( + '@fixture/catalog#orgCatalog', + ) + +export const useMatch: RouteScope['useMatch'] = + /* @__PURE__ */ bindRouteScopeUseMatch('@fixture/catalog#orgCatalog') + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + /* @__PURE__ */ bindRouteScopeUseLoaderData( + '@fixture/catalog#orgCatalog', + ) + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + /* @__PURE__ */ bindRouteScopeUseLoaderDeps( + '@fixture/catalog#orgCatalog', + ) + +export const useSearch: RouteScope['useSearch'] = + /* @__PURE__ */ bindRouteScopeUseSearch('@fixture/catalog#orgCatalog') + +export const useParams: RouteScope['useParams'] = + /* @__PURE__ */ bindRouteScopeUseParams('@fixture/catalog#orgCatalog') + +export const useRouteContext: RouteScope['useRouteContext'] = + /* @__PURE__ */ bindRouteScopeUseRouteContext( + '@fixture/catalog#orgCatalog', + ) + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps( + '@fixture/catalog#orgCatalog', + ) + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + /* @__PURE__ */ bindRouteScopeNotFound('@fixture/catalog#orgCatalog') + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray + +export type ValidateFromPath = RouterValidateFromPath< + Router, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + Router, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + Router +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + Router +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + return match.routeId.startsWith('@fixture/catalog#orgCatalog:') +} diff --git a/packages/router-generator/tests/route-modules/installations/routeScope.snapshot.ts b/packages/router-generator/tests/route-modules/installations/routeScope.snapshot.ts new file mode 100644 index 0000000000..983731384b --- /dev/null +++ b/packages/router-generator/tests/route-modules/installations/routeScope.snapshot.ts @@ -0,0 +1,13 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +export * as orgCatalog from './routeScope.gen.namespace1' + +export * as userCatalog from './routeScope.gen.namespace2' + +export * as account from './routeScope.gen.namespace0' diff --git a/packages/router-generator/tests/route-modules/installations/routeScope.userCatalog.snapshot.ts b/packages/router-generator/tests/route-modules/installations/routeScope.userCatalog.snapshot.ts new file mode 100644 index 0000000000..ec59eda5b0 --- /dev/null +++ b/packages/router-generator/tests/route-modules/installations/routeScope.userCatalog.snapshot.ts @@ -0,0 +1,246 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopedRouter, HostedRouter } from '@tanstack/react-router' + +import type { Router as FixtureCatalogRouter } from '@fixture/catalog/route-types' + +import type { MountedModuleHostParams } from './routeTree.gen' + +type Router = ScopedRouter< + HostedRouter< + FixtureCatalogRouter, + MountedModuleHostParams['@fixture/catalog#userCatalog'] + >, + '@fixture/catalog#userCatalog' +> + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeGetRouteApi, + bindRouteScopeUseMatch, + bindRouteScopeUseLoaderData, + bindRouteScopeUseLoaderDeps, + bindRouteScopeUseSearch, + bindRouteScopeUseParams, + bindRouteScopeUseRouteContext, + bindRouteScopeUseLinkProps, + bindRouteScopeNotFound, +} from '@tanstack/react-router/_internal/route-module' + +import { + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/catalog#userCatalog') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink( + '@fixture/catalog#userCatalog', + ) + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions( + '@fixture/catalog#userCatalog', + ) + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/catalog#userCatalog') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate( + '@fixture/catalog#userCatalog', + ) + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/catalog#userCatalog') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute( + '@fixture/catalog#userCatalog', + ) + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute( + '@fixture/catalog#userCatalog', + ) + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter( + '@fixture/catalog#userCatalog', + ) + +export const getRouteApi: RouteScope['getRouteApi'] = + /* @__PURE__ */ bindRouteScopeGetRouteApi( + '@fixture/catalog#userCatalog', + ) + +export const useMatch: RouteScope['useMatch'] = + /* @__PURE__ */ bindRouteScopeUseMatch('@fixture/catalog#userCatalog') + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + /* @__PURE__ */ bindRouteScopeUseLoaderData( + '@fixture/catalog#userCatalog', + ) + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + /* @__PURE__ */ bindRouteScopeUseLoaderDeps( + '@fixture/catalog#userCatalog', + ) + +export const useSearch: RouteScope['useSearch'] = + /* @__PURE__ */ bindRouteScopeUseSearch( + '@fixture/catalog#userCatalog', + ) + +export const useParams: RouteScope['useParams'] = + /* @__PURE__ */ bindRouteScopeUseParams( + '@fixture/catalog#userCatalog', + ) + +export const useRouteContext: RouteScope['useRouteContext'] = + /* @__PURE__ */ bindRouteScopeUseRouteContext( + '@fixture/catalog#userCatalog', + ) + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps( + '@fixture/catalog#userCatalog', + ) + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + /* @__PURE__ */ bindRouteScopeNotFound('@fixture/catalog#userCatalog') + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray + +export type ValidateFromPath = RouterValidateFromPath< + Router, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + Router, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + Router +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + Router +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + return match.routeId.startsWith('@fixture/catalog#userCatalog:') +} diff --git a/packages/router-generator/tests/route-modules/installations/routeTree.snapshot.ts b/packages/router-generator/tests/route-modules/installations/routeTree.snapshot.ts new file mode 100644 index 0000000000..c87fdf44e5 --- /dev/null +++ b/packages/router-generator/tests/route-modules/installations/routeTree.snapshot.ts @@ -0,0 +1,157 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { mountRouteModule } from '@tanstack/react-router/_internal/route-module' +import { routeModule as FixtureCatalogRouteModule } from '@fixture/catalog/route-module' +import { routeModule as FixtureAccountRouteModule } from '@fixture/account/route-module' +import type { + MountedRoutesById, + InstallationRoutesById, +} from '@tanstack/react-router' +import type { InstalledRoutesById as FixtureCatalogInstalledRoutesById } from '@fixture/catalog/route-types' +import type { InstalledRoutesById as FixtureAccountInstalledRoutesById } from '@fixture/account/route-types' + +import { Route as rootRouteImport } from './routes/__root' +import { Route as OrgsOrgIdRouteImport } from './routes/orgs.$orgId' +import { Route as UsersUserIdRouteImport } from './routes/users.$userId' + +const OrgsOrgIdRoute = OrgsOrgIdRouteImport.update({ + id: '/orgs/$orgId', + path: '/orgs/$orgId', + getParentRoute: () => rootRouteImport, +} as any) +const UsersUserIdRoute = UsersUserIdRouteImport.update({ + id: '/users/$userId', + path: '/users/$userId', + getParentRoute: () => rootRouteImport, +} as any) + +const FixtureCatalogOrgCatalogModuleRoute: typeof FixtureCatalogRouteModule = + mountRouteModule(FixtureCatalogRouteModule, { + parent: () => OrgsOrgIdRoute, + at: '/catalog', + as: 'orgCatalog', + }) + +const FixtureCatalogUserCatalogModuleRoute: typeof FixtureCatalogRouteModule = + mountRouteModule(FixtureCatalogRouteModule, { + parent: () => UsersUserIdRoute, + at: '/catalog', + as: 'userCatalog', + }) + +const FixtureAccountModuleRoute: typeof FixtureAccountRouteModule = + mountRouteModule(FixtureAccountRouteModule, { + parent: () => OrgsOrgIdRoute, + at: '/account', + uses: { '@fixture/catalog': '@fixture/catalog#orgCatalog' }, + }) + +/** The path params of the routes above each mounted route module. */ +export interface MountedModuleHostParams { + '@fixture/catalog#orgCatalog': (typeof OrgsOrgIdRoute)['types']['allParams'] + '@fixture/catalog#userCatalog': (typeof UsersUserIdRoute)['types']['allParams'] + '@fixture/account': (typeof OrgsOrgIdRoute)['types']['allParams'] +} + +export interface FileRoutesByFullPath { + '/orgs/$orgId': typeof OrgsOrgIdRouteWithChildren + '/users/$userId': typeof UsersUserIdRouteWithChildren +} +export interface FileRoutesByTo { + '/orgs/$orgId': typeof OrgsOrgIdRouteWithChildren + '/users/$userId': typeof UsersUserIdRouteWithChildren +} +export interface FileRoutesById { + __root__: typeof rootRouteImport + '/orgs/$orgId': typeof OrgsOrgIdRouteWithChildren + '/users/$userId': typeof UsersUserIdRouteWithChildren +} +interface RouteModuleRoutesById + extends + FileRoutesById, + MountedRoutesById< + InstallationRoutesById< + FixtureCatalogInstalledRoutesById, + '@fixture/catalog', + 'orgCatalog' + > + >, + MountedRoutesById< + InstallationRoutesById< + FixtureCatalogInstalledRoutesById, + '@fixture/catalog', + 'userCatalog' + > + >, + MountedRoutesById {} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/orgs/$orgId' | '/users/$userId' + fileRoutesByTo: FileRoutesByTo + to: '/orgs/$orgId' | '/users/$userId' + id: keyof RouteModuleRoutesById + fileRoutesById: RouteModuleRoutesById +} +export interface RootRouteChildren { + OrgsOrgIdRoute: typeof OrgsOrgIdRouteWithChildren + UsersUserIdRoute: typeof UsersUserIdRouteWithChildren +} + +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/orgs/$orgId': { + id: '/orgs/$orgId' + path: '/orgs/$orgId' + fullPath: '/orgs/$orgId' + preLoaderRoute: typeof OrgsOrgIdRouteImport + parentRoute: typeof rootRouteImport + } + '/users/$userId': { + id: '/users/$userId' + path: '/users/$userId' + fullPath: '/users/$userId' + preLoaderRoute: typeof UsersUserIdRouteImport + parentRoute: typeof rootRouteImport + } + } +} + +interface OrgsOrgIdRouteChildren { + FixtureCatalogOrgCatalogModuleRoute: typeof FixtureCatalogOrgCatalogModuleRoute + FixtureAccountModuleRoute: typeof FixtureAccountModuleRoute +} + +const OrgsOrgIdRouteChildren: OrgsOrgIdRouteChildren = { + FixtureCatalogOrgCatalogModuleRoute: FixtureCatalogOrgCatalogModuleRoute, + FixtureAccountModuleRoute: FixtureAccountModuleRoute, +} + +const OrgsOrgIdRouteWithChildren = OrgsOrgIdRoute._addFileChildren( + OrgsOrgIdRouteChildren, +) + +interface UsersUserIdRouteChildren { + FixtureCatalogUserCatalogModuleRoute: typeof FixtureCatalogUserCatalogModuleRoute +} + +const UsersUserIdRouteChildren: UsersUserIdRouteChildren = { + FixtureCatalogUserCatalogModuleRoute: FixtureCatalogUserCatalogModuleRoute, +} + +const UsersUserIdRouteWithChildren = UsersUserIdRoute._addFileChildren( + UsersUserIdRouteChildren, +) + +const rootRouteChildren: RootRouteChildren = { + OrgsOrgIdRoute: OrgsOrgIdRouteWithChildren, + UsersUserIdRoute: UsersUserIdRouteWithChildren, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/packages/router-generator/tests/route-modules/module/routeContract.snapshot.ts b/packages/router-generator/tests/route-modules/module/routeContract.snapshot.ts new file mode 100644 index 0000000000..c4f7b65329 --- /dev/null +++ b/packages/router-generator/tests/route-modules/module/routeContract.snapshot.ts @@ -0,0 +1,44 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { ScopeRouter } from '@tanstack/react-router' +import type { FileRoutesById, routeTree } from './routeTree.gen' + +/** The router of "@fixture/catalog": module-local paths, qualified ids. */ +export type RouteModuleRouter = ScopeRouter< + typeof routeTree, + '@fixture/catalog' +> + +/** The register of "@fixture/catalog": the scope its route factories and route-bound APIs are typed against. */ +export interface RouteModuleRegister { + router: RouteModuleRouter +} + +/** The route tree of "@fixture/catalog": its module root with all its routes. */ +export type RouteModuleTree = typeof routeTree + +/** The router type of "@fixture/catalog" (module-local paths, qualified ids). */ +export type Router = RouteModuleRouter + +/** The routes of "@fixture/catalog" by qualified id, without other modules. */ +export type OwnRoutesById = FileRoutesById + +/** All routes installed with "@fixture/catalog", including the modules it mounts. */ +export interface InstalledRoutesById extends FileRoutesById {} + +/** The routers of "@fixture/catalog" and of every module it mounts, by module id. */ +export interface InstalledRouters { + '@fixture/catalog': Router +} + +/** + * The path params above every module "@fixture/catalog" installs, relative to its + * root. Packages that mount "@fixture/catalog" under path params add their own. + */ +export interface InstalledHostParams {} diff --git a/packages/router-generator/tests/route-modules/module/routeModule.snapshot.ts b/packages/router-generator/tests/route-modules/module/routeModule.snapshot.ts new file mode 100644 index 0000000000..5c40aa007d --- /dev/null +++ b/packages/router-generator/tests/route-modules/module/routeModule.snapshot.ts @@ -0,0 +1,10 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +/** The root route of this module with all its routes. Mount it with `mountRouteModule`. */ +export { routeTree as routeModule } from './routeTree.gen' diff --git a/packages/router-generator/tests/route-modules/module/routeScope.snapshot.ts b/packages/router-generator/tests/route-modules/module/routeScope.snapshot.ts new file mode 100644 index 0000000000..3787baa659 --- /dev/null +++ b/packages/router-generator/tests/route-modules/module/routeScope.snapshot.ts @@ -0,0 +1,261 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { bindCreateModuleRoot } from '@tanstack/react-router/_internal/route-module' + +import { createFileRoute as createFrameworkFileRoute } from '@tanstack/react-router' + +import type { FileRouteScope } from '@tanstack/react-router' + +import type { FileRoutesByPath } from './routeTree.gen' + +import type { + RouteModuleRouter, + RouteModuleRegister, +} from './routeContract.gen' + +export type { + RouteModuleRouter, + RouteModuleRegister, +} from './routeContract.gen' + +export const createFileRoute = createFrameworkFileRoute as FileRouteScope< + FileRoutesByPath, + RouteModuleRegister, + '@fixture/catalog' +>['createFileRoute'] + +export const createModuleRoot = /* @__PURE__ */ bindCreateModuleRoot< + RouteModuleRegister, + '@fixture/catalog' +>('@fixture/catalog') + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeUseLinkProps, +} from '@tanstack/react-router/_internal/route-module' + +import { + getRouteApi as frameworkGetRouteApi, + useMatch as frameworkUseMatch, + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLoaderData as frameworkUseLoaderData, + useLoaderDeps as frameworkUseLoaderDeps, + useSearch as frameworkUseSearch, + useParams as frameworkUseParams, + useRouteContext as frameworkUseRouteContext, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, + notFound as frameworkNotFound, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/catalog') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink( + '@fixture/catalog', + ) + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions( + '@fixture/catalog', + ) + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/catalog') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate( + '@fixture/catalog', + ) + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/catalog') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute( + '@fixture/catalog', + ) + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute( + '@fixture/catalog', + ) + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/catalog') + +export const getRouteApi: RouteScope['getRouteApi'] = + frameworkGetRouteApi as never + +export const useMatch: RouteScope['useMatch'] = + frameworkUseMatch as never + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + frameworkUseLoaderData as never + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + frameworkUseLoaderDeps as never + +export const useSearch: RouteScope['useSearch'] = + frameworkUseSearch as never + +export const useParams: RouteScope['useParams'] = + frameworkUseParams as never + +export const useRouteContext: RouteScope['useRouteContext'] = + frameworkUseRouteContext as never + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps( + '@fixture/catalog', + ) + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + frameworkNotFound as never + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom, + TComp +> + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom +> + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom +> + +export type ValidateFromPath = RouterValidateFromPath< + RouteModuleRouter, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + RouteModuleRouter, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + RouteModuleRouter +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + RouteModuleRouter +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + const localRouteId = match.localRouteId ?? '' + return localRouteId.startsWith('@fixture/catalog:') +} diff --git a/packages/router-generator/tests/route-modules/module/routeTree.snapshot.ts b/packages/router-generator/tests/route-modules/module/routeTree.snapshot.ts new file mode 100644 index 0000000000..386ce827d4 --- /dev/null +++ b/packages/router-generator/tests/route-modules/module/routeTree.snapshot.ts @@ -0,0 +1,112 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { Route as rootRouteImport } from './routes/__root' +import { Route as IndexRouteImport } from './routes/index' +import { Route as ItemIdRouteImport } from './routes/$itemId' +import { Route as LayoutRouteImport } from './routes/_layout' +import { Route as LayoutSaleRouteImport } from './routes/_layout/sale' + +const IndexRoute = IndexRouteImport.update({ + id: '/', + path: '/', + getParentRoute: () => rootRouteImport, +} as any) +const ItemIdRoute = ItemIdRouteImport.update({ + id: '/$itemId', + path: '/$itemId', + getParentRoute: () => rootRouteImport, +} as any) +const LayoutRoute = LayoutRouteImport.update({ + id: '/_layout', + getParentRoute: () => rootRouteImport, +} as any) +const LayoutSaleRoute = LayoutSaleRouteImport.update({ + id: '/sale', + path: '/sale', + getParentRoute: () => LayoutRoute, +} as any) + +export interface FileRoutesByFullPath { + '/': typeof IndexRoute + '/$itemId': typeof ItemIdRoute + '/sale': typeof LayoutSaleRoute +} +export interface FileRoutesByTo { + '/': typeof IndexRoute + '/$itemId': typeof ItemIdRoute + '/sale': typeof LayoutSaleRoute +} +export interface FileRoutesById { + '@fixture/catalog:': typeof rootRouteImport + '@fixture/catalog:/': typeof IndexRoute + '@fixture/catalog:/$itemId': typeof ItemIdRoute + '@fixture/catalog:/_layout': typeof LayoutRouteWithChildren + '@fixture/catalog:/_layout/sale': typeof LayoutSaleRoute +} +interface RouteModuleRoutesById extends FileRoutesById {} +export interface FileRouteTypes { + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: '/' | '/$itemId' | '/sale' + fileRoutesByTo: FileRoutesByTo + to: '/' | '/$itemId' | '/sale' + id: keyof RouteModuleRoutesById + fileRoutesById: RouteModuleRoutesById +} +export interface RootRouteChildren { + IndexRoute: typeof IndexRoute + ItemIdRoute: typeof ItemIdRoute + LayoutRoute: typeof LayoutRouteWithChildren +} + +export interface FileRoutesByPath { + '@fixture/catalog:/': { + id: '@fixture/catalog:/' + path: '/' + fullPath: '/' + parentRoute: typeof rootRouteImport + } + '@fixture/catalog:/$itemId': { + id: '@fixture/catalog:/$itemId' + path: '/$itemId' + fullPath: '/$itemId' + parentRoute: typeof rootRouteImport + } + '@fixture/catalog:/_layout': { + id: '@fixture/catalog:/_layout' + path: '' + fullPath: '/' + parentRoute: typeof rootRouteImport + } + '@fixture/catalog:/_layout/sale': { + id: '@fixture/catalog:/_layout/sale' + path: '/sale' + fullPath: '/sale' + parentRoute: typeof LayoutRoute + } +} + +interface LayoutRouteChildren { + LayoutSaleRoute: typeof LayoutSaleRoute +} + +const LayoutRouteChildren: LayoutRouteChildren = { + LayoutSaleRoute: LayoutSaleRoute, +} + +const LayoutRouteWithChildren = + LayoutRoute._addFileChildren(LayoutRouteChildren) + +const rootRouteChildren: RootRouteChildren = { + IndexRoute: IndexRoute, + ItemIdRoute: ItemIdRoute, + LayoutRoute: LayoutRouteWithChildren, +} +export const routeTree = rootRouteImport + ._addFileChildren(rootRouteChildren) + ._addFileTypes() diff --git a/packages/router-generator/tests/route-modules/start-application/startModules.snapshot.ts b/packages/router-generator/tests/route-modules/start-application/startModules.snapshot.ts new file mode 100644 index 0000000000..df845b43ed --- /dev/null +++ b/packages/router-generator/tests/route-modules/start-application/startModules.snapshot.ts @@ -0,0 +1,34 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import type { + AssertStartModules, + ValidateStartModules, +} from '@tanstack/react-start' +import type { startInstance } from './start' +import { startModules as FixtureCatalogStartModules } from '@fixture/catalog/route-module' + +/** + * The TanStack Start fragments of every installed route module. Install them + * with `createStart(() => ({ extends: startModules }))`. + */ +export const startModules: readonly [...typeof FixtureCatalogStartModules] = [ + ...FixtureCatalogStartModules, +] + +/** + * Fails to type-check when `startInstance` does not install the fragments or + * does not provide the context they require. + */ +export type StartModulesCheck = AssertStartModules< + ValidateStartModules< + typeof startInstance, + typeof startModules, + readonly ['@fixture/catalog'] + > +> diff --git a/packages/router-generator/tests/route-modules/start-module/routeModule.snapshot.ts b/packages/router-generator/tests/route-modules/start-module/routeModule.snapshot.ts new file mode 100644 index 0000000000..91099aecb5 --- /dev/null +++ b/packages/router-generator/tests/route-modules/start-module/routeModule.snapshot.ts @@ -0,0 +1,18 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { start } from './start' + +/** The root route of this module with all its routes. Mount it with `mountRouteModule`. */ +export { routeTree as routeModule } from './routeTree.gen' + +/** + * The TanStack Start fragments of this module and of the modules it mounts. + * Applications install them with `createStart(() => ({ extends: startModules }))`. + */ +export const startModules: readonly [typeof start] = [start] diff --git a/packages/router-generator/tests/route-modules/start-module/routeScope.snapshot.ts b/packages/router-generator/tests/route-modules/start-module/routeScope.snapshot.ts new file mode 100644 index 0000000000..5c272d3d42 --- /dev/null +++ b/packages/router-generator/tests/route-modules/start-module/routeScope.snapshot.ts @@ -0,0 +1,285 @@ +/* eslint-disable */ + +// noinspection JSUnusedGlobalSymbols + +// This file was automatically generated by TanStack Router. +// You should NOT make any changes in this file as it will be overwritten. +// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. + +import { bindCreateModuleRoot } from '@tanstack/react-router/_internal/route-module' + +import { createFileRoute as createFrameworkFileRoute } from '@tanstack/react-router' + +import type { FileRouteScope } from '@tanstack/react-router' + +import type { FileRoutesByPath } from './routeTree.gen' + +import type { + RouteModuleRouter, + RouteModuleRegister, +} from './routeContract.gen' + +export type { + RouteModuleRouter, + RouteModuleRegister, +} from './routeContract.gen' + +import { + createServerFn as createStartServerFn, + createMiddleware as createStartMiddleware, +} from '@tanstack/react-start' + +import { createStartModule as createStartModuleFor } from '@tanstack/react-start/_internal/route-module' + +import type { + CreateServerFn, + CreateMiddlewareFn, + StartModuleRegister, +} from '@tanstack/react-start' + +export const createFileRoute = createFrameworkFileRoute as FileRouteScope< + FileRoutesByPath, + RouteModuleRegister, + '@fixture/catalog' +>['createFileRoute'] + +export const createModuleRoot = /* @__PURE__ */ bindCreateModuleRoot< + RouteModuleRegister, + '@fixture/catalog' +>('@fixture/catalog') + +import { + bindRouteScopeLink, + bindRouteScopeCreateLink, + bindRouteScopeLinkOptions, + bindRouteScopeNavigate, + bindRouteScopeUseNavigate, + bindRouteScopeRedirect, + bindRouteScopeMatchRoute, + bindRouteScopeUseMatchRoute, + bindRouteScopeUseRouter, + bindRouteScopeUseLinkProps, +} from '@tanstack/react-router/_internal/route-module' + +import { + getRouteApi as frameworkGetRouteApi, + useMatch as frameworkUseMatch, + useMatches as frameworkUseMatches, + useParentMatches as frameworkUseParentMatches, + useChildMatches as frameworkUseChildMatches, + useLoaderData as frameworkUseLoaderData, + useLoaderDeps as frameworkUseLoaderDeps, + useSearch as frameworkUseSearch, + useParams as frameworkUseParams, + useRouteContext as frameworkUseRouteContext, + useLocation as frameworkUseLocation, + useRouterState as frameworkUseRouterState, + useBlocker as frameworkUseBlocker, + notFound as frameworkNotFound, +} from '@tanstack/react-router' + +import type { RouteScope } from '@tanstack/react-router' + +export const Link: RouteScope['Link'] = + /* @__PURE__ */ bindRouteScopeLink('@fixture/catalog') + +export const createLink: RouteScope['createLink'] = + /* @__PURE__ */ bindRouteScopeCreateLink( + '@fixture/catalog', + ) + +export const linkOptions: RouteScope['linkOptions'] = + /* @__PURE__ */ bindRouteScopeLinkOptions( + '@fixture/catalog', + ) + +export const Navigate: RouteScope['Navigate'] = + /* @__PURE__ */ bindRouteScopeNavigate('@fixture/catalog') + +export const useNavigate: RouteScope['useNavigate'] = + /* @__PURE__ */ bindRouteScopeUseNavigate( + '@fixture/catalog', + ) + +export const redirect: RouteScope['redirect'] = + /* @__PURE__ */ bindRouteScopeRedirect('@fixture/catalog') + +export const MatchRoute: RouteScope['MatchRoute'] = + /* @__PURE__ */ bindRouteScopeMatchRoute( + '@fixture/catalog', + ) + +export const useMatchRoute: RouteScope['useMatchRoute'] = + /* @__PURE__ */ bindRouteScopeUseMatchRoute( + '@fixture/catalog', + ) + +export const useRouter: RouteScope['useRouter'] = + /* @__PURE__ */ bindRouteScopeUseRouter('@fixture/catalog') + +export const getRouteApi: RouteScope['getRouteApi'] = + frameworkGetRouteApi as never + +export const useMatch: RouteScope['useMatch'] = + frameworkUseMatch as never + +export const useMatches: RouteScope['useMatches'] = + frameworkUseMatches as never + +export const useParentMatches: RouteScope['useParentMatches'] = + frameworkUseParentMatches as never + +export const useChildMatches: RouteScope['useChildMatches'] = + frameworkUseChildMatches as never + +export const useLoaderData: RouteScope['useLoaderData'] = + frameworkUseLoaderData as never + +export const useLoaderDeps: RouteScope['useLoaderDeps'] = + frameworkUseLoaderDeps as never + +export const useSearch: RouteScope['useSearch'] = + frameworkUseSearch as never + +export const useParams: RouteScope['useParams'] = + frameworkUseParams as never + +export const useRouteContext: RouteScope['useRouteContext'] = + frameworkUseRouteContext as never + +export const useLocation: RouteScope['useLocation'] = + frameworkUseLocation as never + +export const useRouterState: RouteScope['useRouterState'] = + frameworkUseRouterState as never + +export const useLinkProps: RouteScope['useLinkProps'] = + /* @__PURE__ */ bindRouteScopeUseLinkProps( + '@fixture/catalog', + ) + +export const useBlocker: RouteScope['useBlocker'] = + frameworkUseBlocker as never + +export const notFound: RouteScope['notFound'] = + frameworkNotFound as never + +import type { + ValidateLinkOptions as RouterValidateLinkOptions, + ValidateLinkOptionsArray as RouterValidateLinkOptionsArray, + ValidateNavigateOptions as RouterValidateNavigateOptions, + ValidateNavigateOptionsArray as RouterValidateNavigateOptionsArray, + ValidateRedirectOptions as RouterValidateRedirectOptions, + ValidateRedirectOptionsArray as RouterValidateRedirectOptionsArray, + ValidateFromPath as RouterValidateFromPath, + ValidateToPath as RouterValidateToPath, + ValidateSearch as RouterValidateSearch, + ValidateParams as RouterValidateParams, + ValidateId as RouterValidateId, + ValidateUseSearchOptions as RouterValidateUseSearchOptions, + ValidateUseParamsOptions as RouterValidateUseParamsOptions, +} from '@tanstack/react-router' + +export type ValidateLinkOptions< + TOptions = unknown, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptions + +export type ValidateLinkOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, + TComp = 'a', +> = RouterValidateLinkOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom, + TComp +> + +export type ValidateNavigateOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptions + +export type ValidateNavigateOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateNavigateOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom +> + +export type ValidateRedirectOptions< + TOptions = unknown, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptions + +export type ValidateRedirectOptionsArray< + TOptions extends ReadonlyArray = ReadonlyArray, + TDefaultFrom extends string = string, +> = RouterValidateRedirectOptionsArray< + RouteModuleRouter, + TOptions, + TDefaultFrom +> + +export type ValidateFromPath = RouterValidateFromPath< + RouteModuleRouter, + TFrom +> + +export type ValidateToPath< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateToPath + +export type ValidateSearch< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateSearch + +export type ValidateParams< + TTo extends string | undefined = undefined, + TFrom extends string = string, +> = RouterValidateParams + +export type ValidateId = RouterValidateId< + RouteModuleRouter, + TId +> + +export type ValidateUseSearchOptions = RouterValidateUseSearchOptions< + TOptions, + RouteModuleRouter +> + +export type ValidateUseParamsOptions = RouterValidateUseParamsOptions< + TOptions, + RouteModuleRouter +> + +import type { + AnyRouteMatch, + KnownRouteMatchUnion, +} from '@tanstack/react-router' + +/** Narrows a full router match to the routes installed in this scope. */ +export function isScopedMatch( + match: AnyRouteMatch, +): match is KnownRouteMatchUnion { + const localRouteId = match.localRouteId ?? '' + return localRouteId.startsWith('@fixture/catalog:') +} + +export const createServerFn = + createStartServerFn as unknown as CreateServerFn + +export const createMiddleware = + createStartMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@fixture/catalog'> + > + +export const createStartModule = + /* @__PURE__ */ createStartModuleFor('@fixture/catalog') diff --git a/packages/router-generator/tsconfig.json b/packages/router-generator/tsconfig.json index d1334dff90..597f7786cd 100644 --- a/packages/router-generator/tsconfig.json +++ b/packages/router-generator/tsconfig.json @@ -15,6 +15,7 @@ "tests/generator/**/routeTree.gen.js", "tests/generator/**/routeTree.gen.ts", "tests/generator/**/routeTree.snapshot.js", - "tests/generator/**/routeTree.snapshot.ts" + "tests/generator/**/routeTree.snapshot.ts", + "tests/route-modules/**" ] } diff --git a/packages/router-generator/tsconfig.legacy.json b/packages/router-generator/tsconfig.legacy.json index 604fde5556..f301a27d89 100644 --- a/packages/router-generator/tsconfig.legacy.json +++ b/packages/router-generator/tsconfig.legacy.json @@ -1,5 +1,5 @@ { "extends": "../../tsconfig.json", "include": ["src", "vite.config.ts", "tests"], - "exclude": ["tests/generator/**/**"] + "exclude": ["tests/generator/**/**", "tests/route-modules/**"] } diff --git a/packages/router-plugin/package.json b/packages/router-plugin/package.json index b681bb61a2..5a83121470 100644 --- a/packages/router-plugin/package.json +++ b/packages/router-plugin/package.json @@ -114,7 +114,7 @@ "!skills/_artifacts" ], "engines": { - "node": "^20.19.0 || >=22.12.0" + "node": ">=22.22.0" }, "dependencies": { "@babel/core": "catalog:", diff --git a/packages/router-plugin/src/core/code-splitter/compilers.ts b/packages/router-plugin/src/core/code-splitter/compilers.ts index 0cd783a58a..71bad3dc04 100644 --- a/packages/router-plugin/src/core/code-splitter/compilers.ts +++ b/packages/router-plugin/src/core/code-splitter/compilers.ts @@ -133,6 +133,7 @@ const splittableCreateRouteFns = ['createFileRoute'] const unsplittableCreateRouteFns = [ 'createRootRoute', 'createRootRouteWithContext', + 'createModuleRoot', ] const allCreateRouteFns = [ ...splittableCreateRouteFns, @@ -1039,7 +1040,8 @@ export function compileCodeSplitVirtualRoute( splitMeta.localExporterIdent = splitNode.id.name } else if ( t.isFunctionExpression(splitNode) || - t.isArrowFunctionExpression(splitNode) + t.isArrowFunctionExpression(splitNode) || + t.isCallExpression(splitNode) ) { programPath.pushContainer( 'body', @@ -1079,40 +1081,6 @@ export function compileCodeSplitVirtualRoute( `Unexpected splitNode type ☝️: ${splitNode.type}`, ) } - } else if (t.isCallExpression(splitNode)) { - const outputSplitNodeCode = generateFromAst(splitNode).code - const splitNodeAst = babel.parse(outputSplitNodeCode) - - if (!splitNodeAst) { - throw new Error( - `Failed to parse the generated code for "${SPLIT_TYPE}" in the node type "${splitNode.type}"`, - ) - } - - const statement = splitNodeAst.program.body[0] - - if (!statement) { - throw new Error( - `Failed to parse the generated code for "${SPLIT_TYPE}" in the node type "${splitNode.type}" as no statement was found in the program body`, - ) - } - - if (t.isExpressionStatement(statement)) { - const expression = statement.expression - programPath.pushContainer( - 'body', - t.variableDeclaration('const', [ - t.variableDeclarator( - t.identifier(splitMeta.localExporterIdent), - expression, - ), - ]), - ) - } else { - throw new Error( - `Unexpected expression type encounter for "${SPLIT_TYPE}" in the node type "${splitNode.type}"`, - ) - } } else if (t.isConditionalExpression(splitNode)) { programPath.pushContainer( 'body', diff --git a/packages/router-plugin/src/core/hmr/handle-route-update.ts b/packages/router-plugin/src/core/hmr/handle-route-update.ts index 23b51d2432..07c1968c23 100644 --- a/packages/router-plugin/src/core/hmr/handle-route-update.ts +++ b/packages/router-plugin/src/core/hmr/handle-route-update.ts @@ -4,6 +4,7 @@ type AnyRouteWithPrivateProps = AnyRoute & { options: Record parentRoute: AnyRoute _lazy?: Promise | true + _template?: AnyRouteWithPrivateProps update: (options: Record) => unknown _path: string _id: string @@ -19,30 +20,48 @@ type AnyRouterWithPrivateState = AnyRouter & { _replaceRouteChunk: (route: AnyRoute, lazyFn: AnyRoute['lazyFn']) => void } +/** + * Applies a hot update of a route file to the live router. Returns whether + * the router had an older version of the route to update. + */ function handleRouteUpdate( routeId: string, newRoute: AnyRouteWithPrivateProps, -) { +): boolean { const router = window.__TSR_ROUTER__ as AnyRouterWithPrivateState const oldRoute = router.routesById[routeId] as | AnyRouteWithPrivateProps | undefined - if (!oldRoute) { - return + // The route of a route module the route tree installs several times is the + // template of one copy per installation: `#:/…` for + // `:/…`. The copies are updated, and the template stands in for + // the live route of the hot export. + const liveRoutes = oldRoute + ? [oldRoute] + : ( + Object.values(router.routesById) as Array + ).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + + if (!previousRoute || previousRoute === newRoute) { + return false } // Generated route-tree options are not present on the freshly imported route // module, but they must stay on the live route before rebuilding indexes. - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions: Record = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -58,28 +77,45 @@ function handleRouteUpdate( // so we must explicitly preserve the old reference. // Preserve component identity so React doesn't remount. // React Fast Refresh patches the function bodies in-place. + // Installations share their template's components. const componentKeys = '__TSR_COMPONENT_TYPES__' as unknown as Array if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { - ...newRoute.options, - ...generatedRouteOptions, + const updateRoute = (route: AnyRouteWithPrivateProps) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute: AnyRouteWithPrivateProps) { // routeTree.gen.ts mutates the original module export with generated diff --git a/packages/router-plugin/src/core/hmr/vite-adapter.ts b/packages/router-plugin/src/core/hmr/vite-adapter.ts index 5357c45acf..b3d8a44f30 100644 --- a/packages/router-plugin/src/core/hmr/vite-adapter.ts +++ b/packages/router-plugin/src/core/hmr/vite-adapter.ts @@ -34,12 +34,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/src/core/hmr/webpack-adapter.ts b/packages/router-plugin/src/core/hmr/webpack-adapter.ts index eaf34ccfb1..6e092913c2 100644 --- a/packages/router-plugin/src/core/hmr/webpack-adapter.ts +++ b/packages/router-plugin/src/core/hmr/webpack-adapter.ts @@ -23,6 +23,9 @@ export function createWebpackHmrStatement( }, ): Array { const handleRouteUpdateCode = getHandleRouteUpdateCode(stableRouteOptionKeys) + // The generated id is current, like in the Vite adapter: hot data can be + // stale and the replacement Route object is uninitialized (a file route or a + // module root has no id and reads as a root). const staticRouteIdLiteral = typeof opts.routeId === 'string' ? JSON.stringify(opts.routeId) @@ -69,16 +72,16 @@ export function createWebpackHmrStatement( if (import.meta.webpackHot) { const hot = import.meta.webpackHot const hotData = hot.data ??= {} - const routeId = hotData['tsr-route-id'] ?? Route.id ?? (Route.isRoot ? '__root__' : ${staticRouteIdLiteral}) + const routeId = ${staticRouteIdLiteral} ?? hotData['tsr-route-id'] ?? Route.id ?? (Route.isRoot ? '__root__' : undefined) if (routeId) { hotData['tsr-route-id'] = routeId } - const existingRoute = - typeof window !== 'undefined' && routeId - ? window.__TSR_ROUTER__?.routesById?.[routeId] - : undefined - if (routeId && existingRoute && existingRoute !== Route) { - (${handleRouteUpdateCode})(routeId, Route)${reactRefreshCall} + if ( + routeId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && + (${handleRouteUpdateCode})(routeId, Route) + ) {${reactRefreshCall} } hot.dispose((data) => { if (routeId) { diff --git a/packages/router-plugin/src/core/router-generator-plugin.ts b/packages/router-plugin/src/core/router-generator-plugin.ts index 50dde9f55c..655e52ee52 100644 --- a/packages/router-plugin/src/core/router-generator-plugin.ts +++ b/packages/router-plugin/src/core/router-generator-plugin.ts @@ -11,6 +11,15 @@ import type { RouterPluginContext } from './router-plugin-context' const PLUGIN_NAME = 'unplugin:router-generator' +/** The compiler hooks the generator taps; webpack and Rspack share them. */ +interface WatchingCompiler { + hooks: { + beforeRun: { tapPromise: (name: string, fn: () => Promise) => void } + watchRun: { tapPromise: (name: string, fn: () => Promise) => void } + watchClose: { tap: (name: string, fn: () => Promise) => void } + } +} + export function createRouterGeneratorPlugin( options: Partial Config)> | undefined = {}, routerPluginContext: RouterPluginContext, @@ -18,6 +27,9 @@ export function createRouterGeneratorPlugin( let ROOT: string = process.cwd() let userConfig: Config let generator: Generator + // Route modules: files outside the routes directory that change the route + // tree (package.json, manifests of mounted modules). Watchers add them. + let watchRouteModuleFiles: ((files: Array) => void) | undefined const getRoutesDirectoryPath = () => { return isAbsolute(userConfig.routesDirectory) @@ -57,11 +69,57 @@ export function createRouterGeneratorPlugin( try { await generator.run(generatorEvent) routerPluginContext.routesByFile = generator.getRoutesByFileMap() + watchRouteModuleFiles?.(generator.getRouteModuleWatchFiles()) } catch (e) { console.error(e) } } + /** + * Generates before a build and on watch runs. The bundler's watcher does not + * register newly created files, so a chokidar watcher over the routes + * directory and the route-module files drives the generator while watching. + */ + const generateWithCompiler = (compiler: WatchingCompiler) => { + initConfigAndGenerator() + + let handle: FSWatcher | null = null + + compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, () => generate()) + + compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => { + if (handle) { + return + } + + const chokidar = await import('chokidar') + const watcher = chokidar + .watch(getRoutesDirectoryPath(), { ignoreInitial: true }) + .on('add', (file) => generate({ file, event: 'create' })) + .on('change', (file) => { + if (generator.getRouteModuleWatchFiles().includes(file)) { + return generate({ file, event: 'update' }) + } + return undefined + }) + handle = watcher + watchRouteModuleFiles = (files) => { + if (files.length) { + watcher.add(files) + } + } + watchRouteModuleFiles(generator.getRouteModuleWatchFiles()) + + await generate() + }) + + compiler.hooks.watchClose.tap(PLUGIN_NAME, async () => { + if (handle) { + await handle.close() + } + }) + } + return { name: 'tanstack:router-generator', enforce: 'pre', @@ -76,63 +134,20 @@ export function createRouterGeneratorPlugin( initConfigAndGenerator({ root: config.root }) await generate() }, + configureServer(server) { + watchRouteModuleFiles = (files) => { + if (files.length) { + server.watcher.add(files) + } + } + watchRouteModuleFiles(generator.getRouteModuleWatchFiles()) + }, }, rspack(compiler) { - initConfigAndGenerator() - - let handle: FSWatcher | null = null - - compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, () => generate()) - - compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => { - if (handle) { - return - } - - // rspack watcher doesn't register newly created files - const routesDirectoryPath = getRoutesDirectoryPath() - const chokidar = await import('chokidar') - handle = chokidar - .watch(routesDirectoryPath, { ignoreInitial: true }) - .on('add', (file) => generate({ file, event: 'create' })) - - await generate() - }) - - compiler.hooks.watchClose.tap(PLUGIN_NAME, async () => { - if (handle) { - await handle.close() - } - }) + generateWithCompiler(compiler) }, webpack(compiler) { - initConfigAndGenerator() - - let handle: FSWatcher | null = null - - compiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, () => generate()) - - compiler.hooks.watchRun.tapPromise(PLUGIN_NAME, async () => { - if (handle) { - return - } - - // webpack watcher doesn't register newly created files - const routesDirectoryPath = getRoutesDirectoryPath() - const chokidar = await import('chokidar') - handle = chokidar - .watch(routesDirectoryPath, { ignoreInitial: true }) - .on('add', (file) => generate({ file, event: 'create' })) - - await generate() - }) - - compiler.hooks.watchClose.tap(PLUGIN_NAME, async () => { - if (handle) { - await handle.close() - } - }) - + generateWithCompiler(compiler) compiler.hooks.done.tap(PLUGIN_NAME, () => { console.info('✅ ' + PLUGIN_NAME + ': route-tree generation done') }) diff --git a/packages/router-plugin/src/core/utils.ts b/packages/router-plugin/src/core/utils.ts index 61ab1ca278..d91f71beeb 100644 --- a/packages/router-plugin/src/core/utils.ts +++ b/packages/router-plugin/src/core/utils.ts @@ -20,6 +20,8 @@ export const routeFactoryCallCodeFilter = [ /\bcreateFileRoute\s*\(/, /\bcreateRootRoute\s*\(/, /\bcreateRootRouteWithContext\s*(?:<|\()/, + // The root of a route module, from its generated scope. + /\bcreateModuleRoot\s*(?:<|\()/, ] export function getObjectPropertyKeyName( diff --git a/packages/router-plugin/tests/add-hmr.test.ts b/packages/router-plugin/tests/add-hmr.test.ts index 0d89832f3b..4c4922d6a2 100644 --- a/packages/router-plugin/tests/add-hmr.test.ts +++ b/packages/router-plugin/tests/add-hmr.test.ts @@ -159,7 +159,7 @@ describe('add-hmr works', () => { const output = compileResult.code expect(output).toContain( - 'router._replaceRouteChunk(oldRoute, newRoute.lazyFn);', + 'router._replaceRouteChunk(liveRoute, newRoute.lazyFn);', ) expect(output).toContain('void router._refreshRoute?.();') expect(output).not.toContain('__routeContext') @@ -192,6 +192,20 @@ describe('add-hmr works', () => { expect(output).toContain('"object":{"type":"Identifier","name":"hotData"}') }) + it('prefers the current generated route id over stale webpack hot data', async () => { + const statement = createRouteHmrStatement([], { + hmrStyle: 'webpack', + targetFramework: 'react', + routeId: '@acme/feature:', + }) + const output = JSON.stringify(statement) + + expect(output).toContain('"name":"routeId"') + expect(output).toContain( + '"operator":"??","left":{"type":"StringLiteral","value":"@acme/feature:"', + ) + }) + it('normalizes the generated root route id for Vite HMR', async () => { const statement = createRouteHmrStatement([], { hmrStyle: 'vite', diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx index e45f8b634a..a91121c1ec 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@true.tsx @@ -42,17 +42,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -65,19 +72,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -91,12 +117,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx index eb655d0287..a90b914d60 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/arrow-function@webpack-hot.tsx @@ -24,31 +24,38 @@ if (import.meta.webpackHot) { const hot = import.meta.webpackHot const hotData = (hot.data ??= {}) const routeId = + undefined ?? hotData['tsr-route-id'] ?? Route.id ?? (Route.isRoot ? '__root__' : undefined) if (routeId) { hotData['tsr-route-id'] = routeId } - const existingRoute = - typeof window !== 'undefined' && routeId - ? window.__TSR_ROUTER__?.routesById?.[routeId] - : undefined - if (routeId && existingRoute && existingRoute !== Route) { - ;(function handleRouteUpdate(routeId, newRoute) { + if ( + routeId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && + (function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -61,19 +68,38 @@ if (import.meta.webpackHot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -83,6 +109,7 @@ if (import.meta.webpackHot) { newRoute._to = liveRoute._to } })(routeId, Route) + ) { try { const tsrReactRefreshUtils = typeof __react_refresh_utils__ !== 'undefined' diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@true.tsx index 441852d762..616c21afe2 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createFileRoute-lowercase-components@true.tsx @@ -61,17 +61,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -84,19 +91,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -110,12 +136,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createModuleRoot@false.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createModuleRoot@false.tsx new file mode 100644 index 0000000000..2ace9c4a1a --- /dev/null +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createModuleRoot@false.tsx @@ -0,0 +1,18 @@ +import { Outlet } from '@tanstack/react-router' +import crypto from 'node:crypto' +import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({ + ssr: () => { + if (crypto.randomInt(0, 2) === 0) { + return 'data-only' + } + return false + }, + component: () => { + return ( +
+ +
+ ) + }, +}) diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createModuleRoot@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createModuleRoot@true.tsx new file mode 100644 index 0000000000..f836690dfe --- /dev/null +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createModuleRoot@true.tsx @@ -0,0 +1,140 @@ +import { Outlet } from '@tanstack/react-router' +import crypto from 'node:crypto' +import { createModuleRoot } from '../routeScope.gen' +const TSRComponent = () => { + return ( +
+ +
+ ) +} +export const Route = createModuleRoot()({ + ssr: () => { + if (crypto.randomInt(0, 2) === 0) { + return 'data-only' + } + return false + }, + component: TSRComponent, +}) +const hot = import.meta.hot +if (hot && typeof window !== 'undefined') { + hot.data ??= {} + const tsrReactRefresh = (window.__TSR_REACT_REFRESH__ ??= (() => { + const ignoredExportsById = new Map() + const previousGetIgnoredExports = window.__getReactRefreshIgnoredExports + window.__getReactRefreshIgnoredExports = (ctx) => { + const ignoredExports = previousGetIgnoredExports?.(ctx) ?? [] + const moduleIgnored = ignoredExportsById.get(ctx.id) ?? [] + return [...ignoredExports, ...moduleIgnored] + } + return { ignoredExportsById } + })()) + tsrReactRefresh.ignoredExportsById.set('createModuleRoot.tsx', ['Route']) +} +export function TSRFastRefreshAnchor() { + return null +} +if (import.meta.hot) { + const hot = import.meta.hot + const hotData = (hot.data ??= {}) + const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { + const router = window.__TSR_ROUTER__ + const oldRoute = router.routesById[routeId] + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false + } + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options + const newHasShellComponent = 'shellComponent' in newRoute.options + const preserveComponentIdentity = + oldHasShellComponent === newHasShellComponent + const componentKeys = [ + 'component', + 'shellComponent', + 'pendingComponent', + 'errorComponent', + 'notFoundComponent', + ] + if (preserveComponentIdentity) { + componentKeys.forEach((key) => { + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] + } + }) + } + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } + router.setRoutes(router.buildRouteTree()) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } + router.resolvePathCache.clear() + void router._refreshRoute?.() + return true + function syncHotRouteExport(liveRoute) { + newRoute.options = liveRoute.options + newRoute.parentRoute = liveRoute.parentRoute + newRoute._path = liveRoute._path + newRoute._id = liveRoute._id + newRoute._fullPath = liveRoute._fullPath + newRoute._to = liveRoute._to + } + } + const initialRouteId = Route.id ?? hotData['tsr-route-id'] + if (initialRouteId) { + hotData['tsr-route-id'] = initialRouteId + } + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && + handleRouteUpdate(initialRouteId, Route) + ) { + hotData['tsr-route-update-handled'] = Route + } + hot.accept((newModule) => { + if (Route && newModule && newModule.Route) { + const routeId = hotData['tsr-route-id'] ?? Route.id + if (routeId) { + hotData['tsr-route-id'] = routeId + } + if (hotData['tsr-route-update-handled'] === newModule.Route) { + delete hotData['tsr-route-update-handled'] + return + } + handleRouteUpdate(routeId, newModule.Route) + } + }) +} diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx index f45186bdd9..2d77b8d039 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-inline-component@true.tsx @@ -27,17 +27,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -50,19 +57,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -76,12 +102,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@true.tsx index f9a6875fe7..00c4522a1a 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute-lowercase-components@true.tsx @@ -43,17 +43,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -66,19 +73,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -92,12 +118,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx index 3bde5adf5c..251a75edd6 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRoute@true.tsx @@ -26,17 +26,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -49,19 +56,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -75,12 +101,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx index c96d6f01a5..b30bcc6d0e 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/createRootRouteWithContext-type-args@true.tsx @@ -34,17 +34,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -57,19 +64,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -83,12 +109,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx index 99674604fa..a16f321380 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/explicit-undefined-component@true.tsx @@ -25,17 +25,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -48,19 +55,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -74,12 +100,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx index 614c38c954..765fe000dc 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/function-declaration@true.tsx @@ -42,17 +42,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -65,19 +72,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -91,12 +117,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx index 871bf352e0..a54802975e 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/multi-component@true.tsx @@ -57,17 +57,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -80,19 +87,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -106,12 +132,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx index 6d5b2a1fd3..c79a808bdc 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/react/string-literal-keys@true.tsx @@ -57,17 +57,24 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent @@ -80,19 +87,38 @@ if (import.meta.hot) { ] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -106,12 +132,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx b/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx index bc531f9000..bcb34a3063 100644 --- a/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx +++ b/packages/router-plugin/tests/add-hmr/snapshots/solid/arrow-function@true.tsx @@ -12,36 +12,62 @@ if (import.meta.hot) { const handleRouteUpdate = function handleRouteUpdate(routeId, newRoute) { const router = window.__TSR_ROUTER__ const oldRoute = router.routesById[routeId] - if (!oldRoute) { - return + const liveRoutes = oldRoute + ? [oldRoute] + : Object.values(router.routesById).filter( + (route) => + route._template && route.id.replace(/#[^:]*:/, ':') === routeId, + ) + const previousRoute = oldRoute ?? liveRoutes[0]?._template + if (!previousRoute || previousRoute === newRoute) { + return false } - const generatedRouteOptionKeys = new Set(['id', 'path', 'getParentRoute']) - const generatedRouteOptions = {} - generatedRouteOptionKeys.forEach((key) => { - if (key in oldRoute.options) { - generatedRouteOptions[key] = oldRoute.options[key] - } - }) - const oldHasShellComponent = 'shellComponent' in oldRoute.options + const generatedRouteOptionKeys = [ + 'id', + 'path', + 'getParentRoute', + '_module', + '_uses', + ] + const oldHasShellComponent = 'shellComponent' in previousRoute.options const newHasShellComponent = 'shellComponent' in newRoute.options const preserveComponentIdentity = oldHasShellComponent === newHasShellComponent const componentKeys = [] if (preserveComponentIdentity) { componentKeys.forEach((key) => { - if (key in oldRoute.options && key in newRoute.options) { - newRoute.options[key] = oldRoute.options[key] + if (key in previousRoute.options && key in newRoute.options) { + newRoute.options[key] = previousRoute.options[key] } }) } - const nextOptions = { ...newRoute.options, ...generatedRouteOptions } - oldRoute.options = nextOptions - oldRoute.update(nextOptions) - router._replaceRouteChunk(oldRoute, newRoute.lazyFn) + const updateRoute = (route) => { + const nextOptions = { ...newRoute.options } + generatedRouteOptionKeys.forEach((key) => { + if (key in route.options) { + nextOptions[key] = route.options[key] + } + }) + route.options = nextOptions + route.update(nextOptions) + } + liveRoutes.forEach((liveRoute) => { + updateRoute(liveRoute) + router._replaceRouteChunk(liveRoute, newRoute.lazyFn) + }) + if (!oldRoute) { + updateRoute(previousRoute) + } router.setRoutes(router.buildRouteTree()) - syncHotRouteExport(oldRoute) + syncHotRouteExport(previousRoute) + if (!oldRoute) { + liveRoutes.forEach((liveRoute) => { + liveRoute._template = newRoute + }) + } router.resolvePathCache.clear() void router._refreshRoute?.() + return true function syncHotRouteExport(liveRoute) { newRoute.options = liveRoute.options newRoute.parentRoute = liveRoute.parentRoute @@ -55,12 +81,12 @@ if (import.meta.hot) { if (initialRouteId) { hotData['tsr-route-id'] = initialRouteId } - const existingRoute = - typeof window !== 'undefined' && initialRouteId - ? window.__TSR_ROUTER__?.routesById?.[initialRouteId] - : undefined - if (initialRouteId && existingRoute && existingRoute !== Route) { + if ( + initialRouteId && + typeof window !== 'undefined' && + window.__TSR_ROUTER__ && handleRouteUpdate(initialRouteId, Route) + ) { hotData['tsr-route-update-handled'] = Route } import.meta.hot.accept((newModule) => { diff --git a/packages/router-plugin/tests/add-hmr/test-files/react/createModuleRoot.tsx b/packages/router-plugin/tests/add-hmr/test-files/react/createModuleRoot.tsx new file mode 100644 index 0000000000..1897b06c18 --- /dev/null +++ b/packages/router-plugin/tests/add-hmr/test-files/react/createModuleRoot.tsx @@ -0,0 +1,19 @@ +import { Outlet } from '@tanstack/react-router' +import crypto from 'node:crypto' +import { createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ + ssr: () => { + if (crypto.randomInt(0, 2) === 0) { + return 'data-only' + } + return false + }, + component: () => { + return ( +
+ +
+ ) + }, +}) diff --git a/packages/router-plugin/tests/code-splitter.test.ts b/packages/router-plugin/tests/code-splitter.test.ts index 96807e4d42..af1aac51e4 100644 --- a/packages/router-plugin/tests/code-splitter.test.ts +++ b/packages/router-plugin/tests/code-splitter.test.ts @@ -59,114 +59,117 @@ const testGroups: Array<{ name: string; groupings: CodeSplitGroupings }> = [ ] describe('code-splitter works', () => { - describe.each(frameworks)('FRAMEWORK=%s', (framework) => { - describe.each(testGroups)( - 'SPLIT_GROUP=$name', - async ({ groupings: grouping, name: groupName }) => { - const dirs = getFrameworkDir(framework) - const filenames = await readdir(dirs.files) + describe.each([...frameworks, 'vue'] as const)( + 'FRAMEWORK=%s', + (framework) => { + describe.each(testGroups)( + 'SPLIT_GROUP=$name', + async ({ groupings: grouping, name: groupName }) => { + const dirs = getFrameworkDir(framework) + const filenames = await readdir(dirs.files) - it.each(filenames)( - `should compile "reference" for "%s"`, - async (filename) => { - const file = await readFile(path.join(dirs.files, filename)) - const code = file.toString() + it.each(filenames)( + `should compile "reference" for "%s"`, + async (filename) => { + const file = await readFile(path.join(dirs.files, filename)) + const code = file.toString() - const sharedBindings = computeSharedBindings({ - code, - codeSplitGroupings: grouping, - }) - - const compileResult = compileCodeSplitReferenceRoute({ - code, - filename, - id: filename, - addHmr: false, - codeSplitGroupings: grouping, - targetFramework: framework, - sharedBindings: - sharedBindings.size > 0 ? sharedBindings : undefined, - }) - - await expect( - await formatSnapshot(compileResult?.code || code, filename), - ).toMatchFileSnapshot( - path.join(dirs.snapshots, groupName, filename), - ) - }, - ) - - it.each(filenames)( - `should compile "virtual" for "%s"`, - async (filename) => { - const file = await readFile(path.join(dirs.files, filename)) - const code = file.toString() - - const sharedBindings = computeSharedBindings({ - code, - codeSplitGroupings: grouping, - }) - - for (const targets of grouping) { - const ident = createIdentifier(targets) - - const splitResult = compileCodeSplitVirtualRoute({ + const sharedBindings = computeSharedBindings({ code, - filename: `${filename}?${ident}`, - splitTargets: targets, + codeSplitGroupings: grouping, + }) + + const compileResult = compileCodeSplitReferenceRoute({ + code, + filename, + id: filename, + addHmr: false, + codeSplitGroupings: grouping, + targetFramework: framework, sharedBindings: sharedBindings.size > 0 ? sharedBindings : undefined, }) + await expect( + await formatSnapshot(compileResult?.code || code, filename), + ).toMatchFileSnapshot( + path.join(dirs.snapshots, groupName, filename), + ) + }, + ) + + it.each(filenames)( + `should compile "virtual" for "%s"`, + async (filename) => { + const file = await readFile(path.join(dirs.files, filename)) + const code = file.toString() + + const sharedBindings = computeSharedBindings({ + code, + codeSplitGroupings: grouping, + }) + + for (const targets of grouping) { + const ident = createIdentifier(targets) + + const splitResult = compileCodeSplitVirtualRoute({ + code, + filename: `${filename}?${ident}`, + splitTargets: targets, + sharedBindings: + sharedBindings.size > 0 ? sharedBindings : undefined, + }) + + const snapshotFilename = path.join( + dirs.snapshots, + groupName, + `${filename.replace('.tsx', '')}@${ident}.tsx`, + ) + await expect( + await formatSnapshot(splitResult.code, filename), + ).toMatchFileSnapshot(snapshotFilename) + } + }, + ) + + it.each(filenames)( + `should compile "shared" for "%s"`, + async (filename) => { + const file = await readFile(path.join(dirs.files, filename)) + const code = file.toString() + + const sharedBindings = computeSharedBindings({ + code, + codeSplitGroupings: grouping, + }) + const snapshotFilename = path.join( dirs.snapshots, groupName, - `${filename.replace('.tsx', '')}@${ident}.tsx`, + `${filename.replace('.tsx', '')}@shared.tsx`, ) + + if (sharedBindings.size === 0) { + // No shared module — snapshot should be empty string + await expect('').toMatchFileSnapshot(snapshotFilename) + return + } + + const sharedResult = compileCodeSplitSharedRoute({ + code, + sharedBindings, + filename: `${filename}?tsr-shared=1`, + }) + await expect( - await formatSnapshot(splitResult.code, filename), + await formatSnapshot(sharedResult.code, filename), ).toMatchFileSnapshot(snapshotFilename) - } - }, - ) - - it.each(filenames)( - `should compile "shared" for "%s"`, - async (filename) => { - const file = await readFile(path.join(dirs.files, filename)) - const code = file.toString() - - const sharedBindings = computeSharedBindings({ - code, - codeSplitGroupings: grouping, - }) - - const snapshotFilename = path.join( - dirs.snapshots, - groupName, - `${filename.replace('.tsx', '')}@shared.tsx`, - ) - - if (sharedBindings.size === 0) { - // No shared module — snapshot should be empty string - await expect('').toMatchFileSnapshot(snapshotFilename) - return - } - - const sharedResult = compileCodeSplitSharedRoute({ - code, - sharedBindings, - filename: `${filename}?tsr-shared=1`, - }) - - await expect( - await formatSnapshot(sharedResult.code, filename), - ).toMatchFileSnapshot(snapshotFilename) - }, - ) - }, - ) - }) + }, + ) + }, + ) + }, + ) }) describe('React Refresh virtual route compiler plugin', () => { diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component.tsx new file mode 100644 index 0000000000..d258b0d353 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component.tsx @@ -0,0 +1,7 @@ +const $$splitComponentImporter = () => + import('inline-memo-component.tsx?tsr-split=component') +import { lazyRouteComponent } from '@tanstack/react-router' +import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/')({ + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@component.tsx new file mode 100644 index 0000000000..cd233c2328 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@component.tsx @@ -0,0 +1,6 @@ +import { memo } from 'react' +const SplitComponent = memo(() => { + const label: string = 'Inline memo component' + return
{label}
+}) +export { SplitComponent as component } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@errorComponent.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@notFoundComponent.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/1-default/inline-memo-component@shared.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component.tsx new file mode 100644 index 0000000000..564de9a8f6 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component.tsx @@ -0,0 +1,7 @@ +const $$splitComponentImporter = () => + import('inline-memo-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent') +import { lazyRouteComponent } from '@tanstack/react-router' +import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/')({ + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component@component---errorComponent---notFoundComponent---pendingComponent.tsx new file mode 100644 index 0000000000..cd233c2328 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -0,0 +1,6 @@ +import { memo } from 'react' +const SplitComponent = memo(() => { + const label: string = 'Inline memo component' + return
{label}
+}) +export { SplitComponent as component } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component@loader.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/2-components-combined-loader-separate/inline-memo-component@shared.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component.tsx new file mode 100644 index 0000000000..971872b321 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component.tsx @@ -0,0 +1,7 @@ +const $$splitComponentImporter = () => + import('inline-memo-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent') +import { lazyRouteComponent } from '@tanstack/react-router' +import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/')({ + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component@component---loader---notFoundComponent---pendingComponent.tsx new file mode 100644 index 0000000000..cd233c2328 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component@component---loader---notFoundComponent---pendingComponent.tsx @@ -0,0 +1,6 @@ +import { memo } from 'react' +const SplitComponent = memo(() => { + const label: string = 'Inline memo component' + return
{label}
+}) +export { SplitComponent as component } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component@errorComponent.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/react/3-all-combined-errorComponent-separate/inline-memo-component@shared.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component.tsx new file mode 100644 index 0000000000..ca23589440 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component.tsx @@ -0,0 +1,7 @@ +const $$splitComponentImporter = () => + import('inline-define-component.tsx?tsr-split=component') +import { lazyRouteComponent } from '@tanstack/vue-router' +import { createFileRoute } from '@tanstack/vue-router' +export const Route = createFileRoute('/')({ + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@component.tsx new file mode 100644 index 0000000000..db88804cf9 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@component.tsx @@ -0,0 +1,8 @@ +import { defineComponent } from 'vue' +const SplitComponent = defineComponent({ + setup() { + const label: string = 'Inline Vue component' + return () =>
{label}
+ }, +}) +export { SplitComponent as component } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@errorComponent.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@notFoundComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@notFoundComponent.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/1-default/inline-define-component@shared.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component.tsx new file mode 100644 index 0000000000..c21a096049 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component.tsx @@ -0,0 +1,7 @@ +const $$splitComponentImporter = () => + import('inline-define-component.tsx?tsr-split=component---errorComponent---notFoundComponent---pendingComponent') +import { lazyRouteComponent } from '@tanstack/vue-router' +import { createFileRoute } from '@tanstack/vue-router' +export const Route = createFileRoute('/')({ + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component@component---errorComponent---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component@component---errorComponent---notFoundComponent---pendingComponent.tsx new file mode 100644 index 0000000000..db88804cf9 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component@component---errorComponent---notFoundComponent---pendingComponent.tsx @@ -0,0 +1,8 @@ +import { defineComponent } from 'vue' +const SplitComponent = defineComponent({ + setup() { + const label: string = 'Inline Vue component' + return () =>
{label}
+ }, +}) +export { SplitComponent as component } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component@loader.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component@loader.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/2-components-combined-loader-separate/inline-define-component@shared.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component.tsx new file mode 100644 index 0000000000..eacbb6dcb3 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component.tsx @@ -0,0 +1,7 @@ +const $$splitComponentImporter = () => + import('inline-define-component.tsx?tsr-split=component---loader---notFoundComponent---pendingComponent') +import { lazyRouteComponent } from '@tanstack/vue-router' +import { createFileRoute } from '@tanstack/vue-router' +export const Route = createFileRoute('/')({ + component: lazyRouteComponent($$splitComponentImporter, 'component'), +}) diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component@component---loader---notFoundComponent---pendingComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component@component---loader---notFoundComponent---pendingComponent.tsx new file mode 100644 index 0000000000..db88804cf9 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component@component---loader---notFoundComponent---pendingComponent.tsx @@ -0,0 +1,8 @@ +import { defineComponent } from 'vue' +const SplitComponent = defineComponent({ + setup() { + const label: string = 'Inline Vue component' + return () =>
{label}
+ }, +}) +export { SplitComponent as component } diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component@errorComponent.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component@errorComponent.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component@shared.tsx b/packages/router-plugin/tests/code-splitter/snapshots/vue/3-all-combined-errorComponent-separate/inline-define-component@shared.tsx new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/router-plugin/tests/code-splitter/test-files/react/inline-memo-component.tsx b/packages/router-plugin/tests/code-splitter/test-files/react/inline-memo-component.tsx new file mode 100644 index 0000000000..bbb68c9e8f --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/test-files/react/inline-memo-component.tsx @@ -0,0 +1,9 @@ +import { memo } from 'react' +import { createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({ + component: memo(() => { + const label: string = 'Inline memo component' + return
{label}
+ }), +}) diff --git a/packages/router-plugin/tests/code-splitter/test-files/vue/inline-define-component.tsx b/packages/router-plugin/tests/code-splitter/test-files/vue/inline-define-component.tsx new file mode 100644 index 0000000000..2d564835c9 --- /dev/null +++ b/packages/router-plugin/tests/code-splitter/test-files/vue/inline-define-component.tsx @@ -0,0 +1,11 @@ +import { defineComponent } from 'vue' +import { createFileRoute } from '@tanstack/vue-router' + +export const Route = createFileRoute('/')({ + component: defineComponent({ + setup() { + const label: string = 'Inline Vue component' + return () =>
{label}
+ }, + }), +}) diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createModuleRoot-ssr-function.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createModuleRoot-ssr-function.tsx new file mode 100644 index 0000000000..2ace9c4a1a --- /dev/null +++ b/packages/router-plugin/tests/delete-nodes/snapshots/react/1-delete-nodes-undefined/createModuleRoot-ssr-function.tsx @@ -0,0 +1,18 @@ +import { Outlet } from '@tanstack/react-router' +import crypto from 'node:crypto' +import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({ + ssr: () => { + if (crypto.randomInt(0, 2) === 0) { + return 'data-only' + } + return false + }, + component: () => { + return ( +
+ +
+ ) + }, +}) diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createModuleRoot-ssr-function.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createModuleRoot-ssr-function.tsx new file mode 100644 index 0000000000..2ace9c4a1a --- /dev/null +++ b/packages/router-plugin/tests/delete-nodes/snapshots/react/2-delete-nodes-empty/createModuleRoot-ssr-function.tsx @@ -0,0 +1,18 @@ +import { Outlet } from '@tanstack/react-router' +import crypto from 'node:crypto' +import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({ + ssr: () => { + if (crypto.randomInt(0, 2) === 0) { + return 'data-only' + } + return false + }, + component: () => { + return ( +
+ +
+ ) + }, +}) diff --git a/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createModuleRoot-ssr-function.tsx b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createModuleRoot-ssr-function.tsx new file mode 100644 index 0000000000..ddf2f58e2f --- /dev/null +++ b/packages/router-plugin/tests/delete-nodes/snapshots/react/3-delete-nodes-ssr/createModuleRoot-ssr-function.tsx @@ -0,0 +1,11 @@ +import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({ + component: () => { + return ( +
+ +
+ ) + }, +}) diff --git a/packages/router-plugin/tests/delete-nodes/test-files/react/createModuleRoot-ssr-function.tsx b/packages/router-plugin/tests/delete-nodes/test-files/react/createModuleRoot-ssr-function.tsx new file mode 100644 index 0000000000..1897b06c18 --- /dev/null +++ b/packages/router-plugin/tests/delete-nodes/test-files/react/createModuleRoot-ssr-function.tsx @@ -0,0 +1,19 @@ +import { Outlet } from '@tanstack/react-router' +import crypto from 'node:crypto' +import { createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ + ssr: () => { + if (crypto.randomInt(0, 2) === 0) { + return 'data-only' + } + return false + }, + component: () => { + return ( +
+ +
+ ) + }, +}) diff --git a/packages/router-plugin/tests/handle-route-update.test.ts b/packages/router-plugin/tests/handle-route-update.test.ts index 9c8e239fe2..af7d6a86f8 100644 --- a/packages/router-plugin/tests/handle-route-update.test.ts +++ b/packages/router-plugin/tests/handle-route-update.test.ts @@ -8,6 +8,7 @@ import { createNonReactiveReadonlyStore, trimPathRight, } from '@tanstack/router-core' +import { mountRouteModule } from '@tanstack/router-core/_internal/route-module' import { describe, expect, it, onTestFinished, vi } from 'vitest' import { Fragment, act, createElement } from 'react' import { createPortal } from 'react-dom' @@ -35,7 +36,7 @@ const getHandleRouteUpdate = () => { return new Function(`return ${getHandleRouteUpdateCode([])}`)() as ( routeId: string, newRoute: AnyRoute, - ) => void + ) => boolean } function asAnyRoute(route: TRoute): TRoute & AnyRoute { @@ -133,7 +134,7 @@ function runHandleRouteUpdate( ) { const restoreWindow = withWindowRouter(router) try { - getHandleRouteUpdate()(routeId, asAnyRoute(newRoute)) + return getHandleRouteUpdate()(routeId, asAnyRoute(newRoute)) } finally { restoreWindow() } @@ -649,4 +650,75 @@ describe('handleRouteUpdate', () => { expect(document.head.querySelector('script[src="/hot-head.js"]')).toBeNull() expect(document.head.querySelector('script[src="/hot-body.js"]')).toBeNull() }) + + it('updates every installation of a route module installed several times', () => { + const rootRoute = new BaseRootRoute({}) + const orgRoute = new BaseRoute({ + getParentRoute: () => asAnyRoute(rootRoute), + path: '/orgs/$orgId', + }) + const userRoute = new BaseRoute({ + getParentRoute: () => asAnyRoute(rootRoute), + path: '/users/$userId', + }) + const settingsRoot = asAnyRoute( + new BaseRoute({ _module: '@acme/settings' } as any), + ) + const profileRoute = asAnyRoute( + new BaseRoute({ + getParentRoute: () => settingsRoot, + path: '/profile', + loader: () => 'old', + }), + ) + settingsRoot.addChildren([profileRoute]) + const install = (parent: AnyRoute, as: string) => + mountRouteModule(settingsRoot, { + parent: () => parent, + at: '/settings', + as, + } as any) + const router = createTestRouter( + rootRoute.addChildren([ + orgRoute.addChildren([install(asAnyRoute(orgRoute), 'orgSettings')]), + userRoute.addChildren([install(asAnyRoute(userRoute), 'userSettings')]), + ]), + ) + const copies = [ + '@acme/settings#orgSettings:/profile', + '@acme/settings#userSettings:/profile', + ].map((id) => router.routesById[id] as AnyRoute) + + const loader = () => 'new' + const hotProfileRoute = new BaseRoute({ loader } as any) + expect( + runHandleRouteUpdate(router, '@acme/settings:/profile', hotProfileRoute), + ).toBe(true) + + for (const copy of copies) { + expect(copy.options.loader).toBe(loader) + expect(router.routesById[copy.id]).toBe(copy) + } + // The hot export is the new template, with the module-local id. + expect(hotProfileRoute.id).toBe('@acme/settings:/profile') + expect(hotProfileRoute.fullPath).toBe('/profile') + expect( + runHandleRouteUpdate(router, '@acme/settings:/profile', hotProfileRoute), + ).toBe(false) + + const component = () => null + runHandleRouteUpdate( + router, + '@acme/settings:', + new BaseRoute({ _module: '@acme/settings', component } as any), + ) + expect( + ['orgSettings', 'userSettings'].map( + (as) => router.routesById[`@acme/settings#${as}:`]?.options.component, + ), + ).toEqual([component, component]) + expect(Object.keys(router.routesById)).toContain( + '@acme/settings#userSettings:/profile', + ) + }) }) diff --git a/packages/router-plugin/tests/utils.test.ts b/packages/router-plugin/tests/utils.test.ts index 530880858e..f02259171b 100644 --- a/packages/router-plugin/tests/utils.test.ts +++ b/packages/router-plugin/tests/utils.test.ts @@ -109,6 +109,15 @@ describe('getUniqueProgramIdentifier', () => { }) describe('routeFactoryCallCodeFilter', () => { + it('matches the module root factory of a route module', () => { + expect(matchesRouteFactoryCallCodeFilter('createModuleRoot()({})')).toBe( + true, + ) + expect( + matchesRouteFactoryCallCodeFilter('createModuleRoot()({})'), + ).toBe(true) + }) + it('matches route factory calls with TypeScript type arguments', () => { expect( matchesRouteFactoryCallCodeFilter( diff --git a/packages/router-vite-plugin/package.json b/packages/router-vite-plugin/package.json index 8e411904cb..bc9952300d 100644 --- a/packages/router-vite-plugin/package.json +++ b/packages/router-vite-plugin/package.json @@ -61,7 +61,7 @@ "src" ], "engines": { - "node": ">=20.19" + "node": ">=22.22.0" }, "dependencies": { "@tanstack/router-plugin": "workspace:*" diff --git a/packages/solid-router/package.json b/packages/solid-router/package.json index 80840069ea..4697de4364 100644 --- a/packages/solid-router/package.json +++ b/packages/solid-router/package.json @@ -90,7 +90,21 @@ "default": "./dist/cjs/ssr/client.cjs" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./_internal/route-module": { + "solid": { + "types": "./dist/source/route-module-internal.d.ts", + "default": "./dist/source/route-module-internal.js" + }, + "import": { + "types": "./dist/esm/route-module-internal.d.ts", + "default": "./dist/esm/route-module-internal.js" + }, + "require": { + "types": "./dist/cjs/route-module-internal.d.cts", + "default": "./dist/cjs/route-module-internal.cjs" + } + } }, "sideEffects": false, "files": [ diff --git a/packages/solid-router/src/Match.tsx b/packages/solid-router/src/Match.tsx index 37c4020c03..2af512ca9a 100644 --- a/packages/solid-router/src/Match.tsx +++ b/packages/solid-router/src/Match.tsx @@ -1,3 +1,4 @@ +import { routeModules } from '@tanstack/router-core/_internal/route-module' import * as Solid from 'solid-js' import { rootRouteId } from '@tanstack/router-core' import { isServer } from '@tanstack/router-core/isServer' @@ -141,7 +142,13 @@ export const Match = (props: { routeId: string }) => { notFoundError.routeId ??= currentMatch().routeId - if (notFoundError.routeId !== currentMatch().routeId) { + if ( + (routeModules?.resolveRouteId( + router, + notFoundError.routeId, + currentMatch().routeId, + ) ?? notFoundError.routeId) !== currentMatch().routeId + ) { throw notFoundError } diff --git a/packages/solid-router/src/Matches.tsx b/packages/solid-router/src/Matches.tsx index d2dd1a681a..454bcb7cc6 100644 --- a/packages/solid-router/src/Matches.tsx +++ b/packages/solid-router/src/Matches.tsx @@ -18,12 +18,14 @@ import type { MakeRouteMatchUnion, MaskOptions, MatchRouteOptions, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveRoute, ToSubOptionsProps, } from '@tanstack/router-core' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface RouteMatchExtensions { meta?: Array links?: Array @@ -127,6 +129,24 @@ export type UseMatchRouteOptions< MaskOptions & MatchRouteOptions +/** + * The signature of `useMatchRoute`, typed against the router of `TDefaultRegister` unless a + * router type is passed explicitly. Route modules export a `useMatchRoute` of + * this type. + */ +export type UseMatchRouteFn = < + TRouter extends AnyRouter = RegisteredRouterOf, +>() => < + const TFrom extends string = string, + const TTo extends string | undefined = undefined, + const TMaskFrom extends string = TFrom, + const TMaskTo extends string = '', +>( + opts: UseMatchRouteOptions, +) => Solid.Accessor< + false | Expand['types']['allParams']> +> + export function useMatchRoute() { const router = useRouter() @@ -173,6 +193,20 @@ export type MakeMatchRouteOptions< | Solid.JSX.Element } +/** + * The signature of `MatchRoute`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `MatchRoute` of this type. + */ +export type MatchRouteFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string = string, + const TTo extends string | undefined = undefined, + const TMaskFrom extends string = TFrom, + const TMaskTo extends string = '', +>( + props: MakeMatchRouteOptions, +) => any + export function MatchRoute< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, @@ -206,6 +240,17 @@ export type UseMatchesResult< TSelected, > = unknown extends TSelected ? Array> : TSelected +/** + * The signature of `useMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useMatches` of this type. + */ +export type UseMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseMatchesBaseOptions, +) => Solid.Accessor> + export function useMatches< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, @@ -223,6 +268,17 @@ export function useMatches< }) as Solid.Accessor> } +/** + * The signature of `useParentMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useParentMatches` of this type. + */ +export type UseParentMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseMatchesBaseOptions, +) => Solid.Accessor> + export function useParentMatches< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, @@ -242,6 +298,17 @@ export function useParentMatches< } as any) } +/** + * The signature of `useChildMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useChildMatches` of this type. + */ +export type UseChildMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseMatchesBaseOptions, +) => Solid.Accessor> + export function useChildMatches< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, diff --git a/packages/solid-router/src/fileRoute.ts b/packages/solid-router/src/fileRoute.ts index a1fcae713f..fc6a9bba08 100644 --- a/packages/solid-router/src/fileRoute.ts +++ b/packages/solid-router/src/fileRoute.ts @@ -53,6 +53,81 @@ export function createFileRoute< } } +/** + * The route factory returned by `createFileRoute(path)`. `TDefaultRegister` + * is the scope of the created route: the application's `Register`, or the + * scope register of a route module. + */ +export type FileRouteFactory< + TFilePath extends string, + TParentRoute extends AnyRoute, + TId extends RouteConstraints['TId'], + TPath extends RouteConstraints['TPath'], + TFullPath extends RouteConstraints['TFullPath'], + TDefaultRegister = Register, +> = < + TRegister = TDefaultRegister, + TSearchValidator = undefined, + TParams = ResolveParams, + TRouteContextFn = AnyContext, + TBeforeLoadFn = AnyContext, + TLoaderDeps extends Record = {}, + TLoaderFn = undefined, + TChildren = unknown, + TSSR = unknown, + const TMiddlewares = unknown, + THandlers = undefined, +>( + options?: FileBaseRouteOptions< + TRegister, + TParentRoute, + TId, + TPath, + TSearchValidator, + TParams, + TLoaderDeps, + TLoaderFn, + AnyContext, + TRouteContextFn, + TBeforeLoadFn, + AnyContext, + TSSR, + TMiddlewares, + THandlers + > & + UpdatableRouteOptions< + TParentRoute, + TId, + TFullPath, + TParams, + TSearchValidator, + TLoaderFn, + TLoaderDeps, + AnyContext, + TRouteContextFn, + TBeforeLoadFn + >, +) => Route< + TRegister, + TParentRoute, + TPath, + TFullPath, + TFilePath, + TId, + TSearchValidator, + TParams, + AnyContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + TChildren, + unknown, + TSSR, + TMiddlewares, + THandlers +> + /** @deprecated It's no longer recommended to use the `FileRoute` class directly. Instead, use `createFileRoute('/path/to/file')(options)` to create a file route. @@ -74,68 +149,13 @@ export class FileRoute< this.silent = _opts?.silent } - createRoute = < - TRegister = Register, - TSearchValidator = undefined, - TParams = ResolveParams, - TRouteContextFn = AnyContext, - TBeforeLoadFn = AnyContext, - TLoaderDeps extends Record = {}, - TLoaderFn = undefined, - TChildren = unknown, - TSSR = unknown, - const TMiddlewares = unknown, - THandlers = undefined, - >( - options?: FileBaseRouteOptions< - TRegister, - TParentRoute, - TId, - TPath, - TSearchValidator, - TParams, - TLoaderDeps, - TLoaderFn, - AnyContext, - TRouteContextFn, - TBeforeLoadFn, - AnyContext, - TSSR, - TMiddlewares, - THandlers - > & - UpdatableRouteOptions< - TParentRoute, - TId, - TFullPath, - TParams, - TSearchValidator, - TLoaderFn, - TLoaderDeps, - AnyContext, - TRouteContextFn, - TBeforeLoadFn - >, - ): Route< - TRegister, - TParentRoute, - TPath, - TFullPath, + createRoute: FileRouteFactory< TFilePath, + TParentRoute, TId, - TSearchValidator, - TParams, - AnyContext, - TRouteContextFn, - TBeforeLoadFn, - TLoaderDeps, - TLoaderFn, - TChildren, - unknown, - TSSR, - TMiddlewares, - THandlers - > => { + TPath, + TFullPath + > = (options) => { if (process.env.NODE_ENV !== 'production') { if (!this.silent) { console.warn( @@ -182,7 +202,7 @@ export function FileRouteLoader< return (loaderFn) => loaderFn as any } -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface LazyRoute { useMatch: UseMatchRoute useRouteContext: UseRouteContextRoute diff --git a/packages/solid-router/src/index.tsx b/packages/solid-router/src/index.tsx index 9b1026a6b8..659e10e8d5 100644 --- a/packages/solid-router/src/index.tsx +++ b/packages/solid-router/src/index.tsx @@ -151,6 +151,8 @@ export type { LoaderFnContext, MakeRouteMatch, MakeRouteMatchUnion, + KnownRouteMatchUnion, + ForeignRouteMatch, RouteMatch, AnyRouteMatch, RouteContextFn, @@ -271,9 +273,50 @@ export type { ErrorRouteComponent, NotFoundRouteComponent, } from './route' +// `createFileRoute` returns router-core's `Route`, and `Route` above is this +// package's class: declarations name the type of file routes through this +// export, so they need no import of `@tanstack/router-core`. +export type { Route as RouteCore } from '@tanstack/router-core' export { createRouter, Router } from './router' +export type { FileRouteScope, RouteScope } from './routeModule' +export type { FileRouteFactory } from './fileRoute' +export type { + HostedRouter, + InstallationRoutesById, + MountedRoutesById, + ModuleRootRoute, + ModuleRootRouteOptions, + MountRouteModuleOptions, + RedirectFn, + RegisteredRouterOf, + ScopeRouter, + ScopedRouter, + ScopedRouterView, + ValidateRouteModuleMount, + ValidateRouteModuleMountPath, +} from '@tanstack/router-core' +export type { GetRouteApiFn } from './route' +export type { CreateLinkFn, LinkOptionsFn } from './link' +export type { NavigateComponentFn, UseNavigateFn } from './useNavigate' +export type { + MatchRouteFn, + UseChildMatchesFn, + UseMatchRouteFn, + UseMatchesFn, + UseParentMatchesFn, +} from './Matches' +export type { UseRouterFn } from './useRouter' +export type { UseMatchFn } from './useMatch' +export type { UseLoaderDataFn } from './useLoaderData' +export type { UseLoaderDepsFn } from './useLoaderDeps' +export type { UseSearchFn } from './useSearch' +export type { UseParamsFn } from './useParams' +export type { UseRouteContextFn } from './useRouteContext' +export type { UseLocationFn } from './useLocation' +export type { UseRouterStateFn } from './useRouterState' + export { lazyFn, SearchParamError } from '@tanstack/router-core' export { RouterProvider, RouterContextProvider } from './RouterProvider' diff --git a/packages/solid-router/src/link.tsx b/packages/solid-router/src/link.tsx index 27bed97d92..ecc4bce428 100644 --- a/packages/solid-router/src/link.tsx +++ b/packages/solid-router/src/link.tsx @@ -13,6 +13,7 @@ import { import { isServer } from '@tanstack/router-core/isServer' import { Dynamic } from 'solid-js/web' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import { useRouter } from './useRouter' import { nearestMatchContext } from './matchContext' @@ -24,14 +25,27 @@ import type { Constrain, LinkOptions, ParsedLocation, + Register, RegisteredRouter, + RegisteredRouterOf, RoutePaths, + ScopedRouteOptions, } from '@tanstack/router-core' import type { ValidateLinkOptions, ValidateLinkOptionsArray, } from './typePrimitives' +export type UseLinkPropsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TFrom extends string = string, + TTo extends string = '', + TMaskFrom extends string = TFrom, + TMaskTo extends string = '', +>( + options: UseLinkPropsOptions, +) => Solid.ComponentProps<'a'> + export function useLinkProps< TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths | string = string, @@ -91,6 +105,11 @@ function createLinkProps( currentLocation() } } + // The nearest route resolves module destinations to the installation the + // Link renders under. Only the route-module translation reads it. + if (routeModules) { + dest._nearestRoute = routeId + } return dest } const dest = @@ -461,7 +480,7 @@ const NAVIGATION_KEYS = [ 'unsafeRelative', 'from', 'href', -] as const +] // Options the Link consumes; every other option is an element prop. const LINK_OPTION_KEYS = [ ...NAVIGATION_KEYS, @@ -486,6 +505,18 @@ const LINK_OPTION_KEYS = [ ] // A Link also consumes its children and component, and drops `type`. const LINK_ELEMENT_KEYS = [...LINK_OPTION_KEYS, '_asChild', 'children', 'type'] + +/** + * Called by route-module code: its scopes pass these internal options, which + * decide where a Link navigates (see `scopeLocationOptions` in router-core). + */ +export function addRouteModuleLinkOptions(): void { + if (!NAVIGATION_KEYS.includes('_module')) { + for (const keys of [NAVIGATION_KEYS, LINK_OPTION_KEYS, LINK_ELEMENT_KEYS]) { + keys.push('_module', '_fromRoute') + } + } +} const STATIC_EVENT_PROPS = [ 'onClick', 'onBlur', @@ -616,8 +647,9 @@ export type CreateLinkProps = LinkProps< export type LinkComponent< in out TComp, in out TDefaultFrom extends string = string, + in out TDefaultRegister = Register, > = < - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, const TFrom extends string = TDefaultFrom, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, @@ -628,10 +660,11 @@ export type LinkComponent< export interface LinkComponentRoute< in out TDefaultFrom extends string = string, + in out TDefaultRegister = Register, > { defaultFrom: TDefaultFrom; < - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, const TTo extends string | undefined = undefined, const TMaskTo extends string = '', >( @@ -646,6 +679,14 @@ export interface LinkComponentRoute< ): Solid.JSX.Element } +/** + * The signature of `createLink`, creating links typed against the router of `TDefaultRegister`. + * Route modules export a `createLink` of this type. + */ +export type CreateLinkFn = ( + Comp: Constrain Solid.JSX.Element>, +) => LinkComponent + export function createLink( Comp: Constrain Solid.JSX.Element>, ): LinkComponent { @@ -702,12 +743,12 @@ export type LinkOptionsFnOptions< ? ValidateLinkOptionsArray : ValidateLinkOptions -export type LinkOptionsFn = < +export type LinkOptionsFn = < const TOptions, - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, >( options: LinkOptionsFnOptions, -) => TOptions +) => ScopedRouteOptions export const linkOptions: LinkOptionsFn<'a'> = (options) => { return options as any diff --git a/packages/solid-router/src/route-module-internal.ts b/packages/solid-router/src/route-module-internal.ts new file mode 100644 index 0000000000..3ac86d6306 --- /dev/null +++ b/packages/solid-router/src/route-module-internal.ts @@ -0,0 +1,6 @@ +// Internal generated/framework wiring; use generated scopes to author modules. +export * from './routeModule' +export { + mountRouteModule, + getRouteModuleId, +} from '@tanstack/router-core/_internal/route-module' diff --git a/packages/solid-router/src/route.tsx b/packages/solid-router/src/route.tsx index 5bf786a0f6..3c75193c3c 100644 --- a/packages/solid-router/src/route.tsx +++ b/packages/solid-router/src/route.tsx @@ -4,6 +4,7 @@ import { BaseRouteApi, notFound, } from '@tanstack/router-core' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import { Link } from './link' import { useLoaderData } from './useLoaderData' import { useLoaderDeps } from './useLoaderDeps' @@ -23,6 +24,7 @@ import type { NotFoundRouteProps, Register, RegisteredRouter, + RegisteredRouterOf, ResolveFullPath, ResolveId, ResolveParams, @@ -48,7 +50,7 @@ import type * as Solid from 'solid-js' import type { UseRouteContextRoute } from './useRouteContext' import type { LinkComponentRoute } from './link' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface ErrorBoundaryTypes { error: Error } @@ -71,18 +73,31 @@ declare module '@tanstack/router-core' { export interface RouteExtensions< in out TId extends string, in out TFullPath extends string, + in out TRegister, > { - useMatch: UseMatchRoute - useRouteContext: UseRouteContextRoute - useSearch: UseSearchRoute - useParams: UseParamsRoute - useLoaderDeps: UseLoaderDepsRoute - useLoaderData: UseLoaderDataRoute - useNavigate: () => UseNavigateResult - Link: LinkComponentRoute + useMatch: UseMatchRoute + useRouteContext: UseRouteContextRoute + useSearch: UseSearchRoute + useParams: UseParamsRoute + useLoaderDeps: UseLoaderDepsRoute + useLoaderData: UseLoaderDataRoute + useNavigate: () => UseNavigateResult + Link: LinkComponentRoute } } +/** + * The signature of `getRouteApi`, typed against the router of `TDefaultRegister` unless a + * router type is passed explicitly. Route modules export a `getRouteApi` of + * this type. + */ +export type GetRouteApiFn = < + const TId, + TRouter extends AnyRouter = RegisteredRouterOf, +>( + id: ConstrainLiteral>, +) => RouteApi + export function getRouteApi< const TId, TRouter extends AnyRouter = RegisteredRouter, @@ -101,48 +116,64 @@ export class RouteApi< super({ id }) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts) => { + useRouteContext: UseRouteContextRoute = (opts) => { return useRouteContext({ ...(opts as any), from: this.id }) } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id, strict: false } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id, strict: false } as any) } useNavigate = (): UseNavigateResult< - RouteTypesById['fullPath'] + RouteTypesById['fullPath'], + { router: TRouter } > => { const router = useRouter() - return useNavigate({ from: router.routesById[this.id as string].fullPath }) + return useNavigate({ + from: router.routesById[this.id as string]?.fullPath, + ...routeModules?.navigationScope(this.id as string), + } as any) as any } notFound = (opts?: NotFoundError) => { return notFound({ routeId: this.id as string, ...opts }) } - Link: LinkComponentRoute['fullPath']> = (( - props, - ) => { + Link: LinkComponentRoute< + RouteTypesById['fullPath'], + { router: TRouter } + > = ((props) => { const router = useRouter() - const fullPath = router.routesById[this.id as string].fullPath - return - }) as LinkComponentRoute['fullPath']> + const fullPath = router.routesById[this.id as string]?.fullPath + // A Solid spread keeps its getter even when it yields nothing: spread the + // route-module scope only when route modules installed it. + const scope = routeModules?.navigationScope(this.id as string) + // The scope of a route-module route replaces `from`. + return scope ? ( + + ) : ( + + ) + }) as LinkComponentRoute< + RouteTypesById['fullPath'], + { router: TRouter } + > } export class Route< @@ -240,37 +271,48 @@ export class Route< super(options) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts?) => { + useRouteContext: UseRouteContextRoute = (opts?) => { return useRouteContext({ ...(opts as any), from: this.id }) as any } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id } as any) } - useNavigate = (): UseNavigateResult => { - return useNavigate({ from: this.fullPath }) + useNavigate = (): UseNavigateResult => { + return useNavigate({ + from: this.fullPath, + ...routeModules?.navigationScope(this.id), + } as any) as any } - Link: LinkComponentRoute = ((props) => { - return - }) as LinkComponentRoute + Link: LinkComponentRoute = ((props) => { + // A Solid spread keeps its getter even when it yields nothing: spread the + // route-module scope only when route modules installed it. + // The scope of a route-module route replaces `from`. + const scope = routeModules?.navigationScope(this.id) + return scope ? ( + + ) : ( + + ) + }) as LinkComponentRoute } export function createRoute< @@ -469,37 +511,37 @@ export class RootRoute< super(options) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts) => { + useRouteContext: UseRouteContextRoute = (opts) => { return useRouteContext({ ...(opts as any), from: this.id }) } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id } as any) } - useNavigate = (): UseNavigateResult<'/'> => { - return useNavigate({ from: this.fullPath }) + useNavigate = (): UseNavigateResult<'/', TRegister> => { + return useNavigate({ from: this.fullPath }) as any } - Link: LinkComponentRoute<'/'> = ((props) => { + Link: LinkComponentRoute<'/', TRegister> = ((props) => { return - }) as LinkComponentRoute<'/'> + }) as LinkComponentRoute<'/', TRegister> } export function createRouteMask< diff --git a/packages/solid-router/src/routeModule.tsx b/packages/solid-router/src/routeModule.tsx new file mode 100644 index 0000000000..dff1fb4e50 --- /dev/null +++ b/packages/solid-router/src/routeModule.tsx @@ -0,0 +1,389 @@ +import { mergeProps, useContext } from 'solid-js' +import { notFound } from '@tanstack/router-core' +import { + bindRouteScopeIdApi, + bindRouteScopeOptions, + createScopedRedirect, + getScopedRouterView, + installRouteModules, + resolveRouteScope, +} from '@tanstack/router-core/_internal/route-module' +import { Route, getRouteApi } from './route' +import { Link, addRouteModuleLinkOptions, useLinkProps } from './link' +import { Navigate, useNavigate } from './useNavigate' +import { MatchRoute, useMatchRoute } from './Matches' +import { useRouter } from './useRouter' +import { nearestMatchContext } from './matchContext' +import { useMatch } from './useMatch' +import { useLoaderData } from './useLoaderData' +import { useLoaderDeps } from './useLoaderDeps' +import { useSearch } from './useSearch' +import { useParams } from './useParams' +import { useRouteContext } from './useRouteContext' +import type { UseBlockerFn } from './useBlocker' +import type * as Solid from 'solid-js' +import type { RouteModuleScope } from '@tanstack/router-core/_internal/route-module' +import type { + AnyContext, + AnyRoute, + AnyRouter, + ModuleRootRoute, + ModuleRootRouteOptions, + NotFoundError, + RedirectFn, + RouteIds, + ScopedRouterView, +} from '@tanstack/router-core' +import type { FileRouteFactory } from './fileRoute' +import type { GetRouteApiFn } from './route' +import type { + CreateLinkFn, + LinkComponent, + LinkOptionsFn, + UseLinkPropsFn, +} from './link' +import type { NavigateComponentFn, UseNavigateFn } from './useNavigate' +import type { + MatchRouteFn, + UseChildMatchesFn, + UseMatchRouteFn, + UseMatchesFn, + UseParentMatchesFn, +} from './Matches' +import type { UseMatchFn } from './useMatch' +import type { UseLoaderDataFn } from './useLoaderData' +import type { UseLoaderDepsFn } from './useLoaderDeps' +import type { UseSearchFn } from './useSearch' +import type { UseParamsFn } from './useParams' +import type { UseRouteContextFn } from './useRouteContext' +import type { UseLocationFn } from './useLocation' +import type { UseRouterStateFn } from './useRouterState' + +// Entries reference the route files, whose types depend on these factories: +// read one property at a time and never constrain or check whole entries. +type FileRouteEntry = + TFileRoutesByPath[TFilePath & keyof TFileRoutesByPath] +type FileRouteParent = + FileRouteEntry extends { + parentRoute: infer TParentRoute extends AnyRoute + } + ? TParentRoute + : never +type FileRouteId = + FileRouteEntry extends { + id: infer TId extends string + } + ? TId + : never +type FileRoutePath = + FileRouteEntry extends { + path: infer TPath extends string + } + ? TPath + : never +type FileRouteFullPath = + FileRouteEntry extends { + fullPath: infer TFullPath extends string + } + ? TFullPath + : never + +/** + * Route factories of a route module, typed against the module's generated + * `FileRoutesByPath` and its scope register instead of the application's + * global registrations. + */ +export interface FileRouteScope< + TFileRoutesByPath, + TRegister, + TModuleId extends string, +> { + /** `createFileRoute`, typed against the module's own route files. */ + createFileRoute: ( + path?: TFilePath, + ) => FileRouteFactory< + FileRouteId, + FileRouteParent, + FileRouteId, + FileRoutePath, + FileRouteFullPath, + TRegister + > + /** + * Creates the module root. `TRouterContext` is the router context the module + * requires from the route it is mounted under. + */ + createModuleRoot: () => < + TRouteContextFn = AnyContext, + TBeforeLoadFn = AnyContext, + TSearchValidator = undefined, + TLoaderDeps extends Record = {}, + TLoaderFn = undefined, + TSSR = unknown, + const TServerMiddlewares = unknown, + THandlers = undefined, + >( + options?: ModuleRootRouteOptions< + TModuleId, + TRegister, + TSearchValidator, + TRouterContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + TSSR, + TServerMiddlewares, + THandlers + >, + ) => ModuleRootRoute< + TModuleId, + TRegister, + TSearchValidator, + TRouterContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + unknown, + unknown, + TSSR, + TServerMiddlewares, + THandlers + > +} + +/** + * Installs the route-module behavior of the core and of this framework's + * links. Module roots call it when they are created, before an application + * creates its router. + */ +function installRouteModuleBindings() { + installRouteModules() + addRouteModuleLinkOptions() +} + +/** Binds only the module-root factory used by generated route scopes. */ +export function bindCreateModuleRoot( + moduleId: TModuleId, +): FileRouteScope['createModuleRoot'] { + return () => (options) => { + // Module routes resolve their route-bound APIs through the route-module + // behavior: install it with the first module root. Binding the factory + // itself, as every generated scope does, has no effect. + installRouteModuleBindings() + return new Route({ ...(options as any), _module: moduleId }) as any + } +} + +/** + * The routing APIs of a route scope, typed against `TRouter`. + * + * Path-based APIs (`Link`, `useNavigate`, `redirect`, ...) address routes by + * the module-local paths of the module: they work wherever the module is + * mounted. Id-based APIs (`useMatch`, `getRouteApi`, ...) take qualified route + * ids such as `@acme/products:/$productId`. + */ +export interface RouteScope { + Link: LinkComponent<'a', string, { router: TRouter }> + createLink: CreateLinkFn<{ router: TRouter }> + linkOptions: LinkOptionsFn<'a', { router: TRouter }> + Navigate: NavigateComponentFn<{ router: TRouter }> + useNavigate: UseNavigateFn<{ router: TRouter }> + useLinkProps: UseLinkPropsFn<{ router: TRouter }> + useBlocker: UseBlockerFn<{ router: TRouter }> + notFound: ( + options?: Omit & { + routeId?: RouteIds + }, + ) => NotFoundError + redirect: RedirectFn<{ router: TRouter }> + MatchRoute: MatchRouteFn<{ router: TRouter }> + useMatchRoute: UseMatchRouteFn<{ router: TRouter }> + /** + * The router, viewed from the module: its `navigate`, `buildLocation`, + * `preloadRoute` and `matchRoute` take module-local paths. + */ + useRouter: (opts?: { warn?: boolean }) => ScopedRouterView + getRouteApi: GetRouteApiFn<{ router: TRouter }> + useMatch: UseMatchFn<{ router: TRouter }> + useMatches: UseMatchesFn<{ router: TRouter }> + useParentMatches: UseParentMatchesFn<{ router: TRouter }> + useChildMatches: UseChildMatchesFn<{ router: TRouter }> + useLoaderData: UseLoaderDataFn<{ router: TRouter }> + useLoaderDeps: UseLoaderDepsFn<{ router: TRouter }> + useSearch: UseSearchFn<{ router: TRouter }> + useParams: UseParamsFn<{ router: TRouter }> + useRouteContext: UseRouteContextFn<{ router: TRouter }> + useLocation: UseLocationFn<{ router: TRouter }> + useRouterState: UseRouterStateFn<{ router: TRouter }> +} + +// Each generated ESM export binds only its own API. These functions allocate +// closures/components; they never access a router or register runtime state. +function bindOptions(moduleId: string): (options: any) => any { + const router = useRouter() + const routeId = useContext(nearestMatchContext)[0 /* route id */]() + return (options: any) => + bindRouteScopeOptions(moduleId, options ?? {}, router, routeId) +} + +/** + * The props of a scoped component with the module's scope merged in. The + * props are a proxy: spreading it would read every prop, children included, + * in one memo and re-create them all on any change. A lazy getter keeps each + * prop's own reactivity. + */ +function bindProps(moduleId: string, props: { _module?: RouteModuleScope }) { + const router = useRouter() + const routeId = useContext(nearestMatchContext)[0 /* route id */]() + return mergeProps(props, { + get _module() { + return resolveRouteScope(moduleId, props._module, router, routeId) + }, + }) +} + +export function bindRouteScopeLink( + moduleId: string, +): RouteScope['Link'] { + const AnyLink = Link as (props: any) => Solid.JSX.Element + return ((props: object) => { + const bound = bindProps(moduleId, props) + return + }) as any +} + +export function bindRouteScopeCreateLink( + moduleId: string, +): RouteScope['createLink'] { + const AnyLink = Link as (props: any) => Solid.JSX.Element + return ((Comp: unknown) => (props: object) => { + const bound = bindProps(moduleId, props) + return + }) as any +} + +export function bindRouteScopeNavigate( + moduleId: string, +): RouteScope['Navigate'] { + const AnyNavigate = Navigate as (props: any) => null + return ((props: object) => { + const bound = bindProps(moduleId, props) + return + }) as any +} + +export function bindRouteScopeMatchRoute( + moduleId: string, +): RouteScope['MatchRoute'] { + const AnyMatchRoute = MatchRoute as (props: any) => any + return ((props: object) => { + const bound = bindProps(moduleId, props) + const routeId = useContext(nearestMatchContext)[0 /* route id */]() + return + }) as any +} + +export function bindRouteScopeUseLinkProps( + moduleId: string, +): RouteScope['useLinkProps'] { + return ((options: any) => + useLinkProps(bindProps(moduleId, options) as any)) as any +} + +export function bindRouteScopeLinkOptions( + moduleId: string, +): RouteScope['linkOptions'] { + return ((options: any) => + Array.isArray(options) + ? options.map((option) => bindRouteScopeOptions(moduleId, option)) + : bindRouteScopeOptions(moduleId, options)) as any +} + +export function bindRouteScopeUseNavigate( + moduleId: string, +): RouteScope['useNavigate'] { + return ((options?: any) => { + const bind = bindOptions(moduleId) + const navigate = useNavigate(bind(options)) + return (next: any) => navigate(bind(next)) + }) as any +} + +export function bindRouteScopeRedirect( + moduleId: string, +): RouteScope['redirect'] { + return createScopedRedirect(moduleId) +} + +export function bindRouteScopeUseMatchRoute( + moduleId: string, +): RouteScope['useMatchRoute'] { + return (() => { + const bind = bindOptions(moduleId) + const matchRoute = useMatchRoute() + const routeId = useContext(nearestMatchContext)[0 /* route id */]() + return (options: any) => + matchRoute({ ...bind(options), _nearestRoute: routeId }) + }) as any +} + +export function bindRouteScopeUseRouter( + moduleId: string, +): RouteScope['useRouter'] { + return ((options?: { warn?: boolean }) => + getScopedRouterView( + useRouter(options), + moduleId, + useContext(nearestMatchContext)[0 /* route id */](), + )) as any +} + +export function bindRouteScopeGetRouteApi( + moduleId: string, +): RouteScope['getRouteApi'] { + return bindRouteScopeIdApi(moduleId, getRouteApi) as any +} + +export function bindRouteScopeUseMatch( + moduleId: string, +): RouteScope['useMatch'] { + return bindRouteScopeIdApi(moduleId, useMatch, 'from') as any +} + +export function bindRouteScopeUseLoaderData( + moduleId: string, +): RouteScope['useLoaderData'] { + return bindRouteScopeIdApi(moduleId, useLoaderData, 'from') as any +} + +export function bindRouteScopeUseLoaderDeps( + moduleId: string, +): RouteScope['useLoaderDeps'] { + return bindRouteScopeIdApi(moduleId, useLoaderDeps, 'from') as any +} + +export function bindRouteScopeUseSearch( + moduleId: string, +): RouteScope['useSearch'] { + return bindRouteScopeIdApi(moduleId, useSearch, 'from') as any +} + +export function bindRouteScopeUseParams( + moduleId: string, +): RouteScope['useParams'] { + return bindRouteScopeIdApi(moduleId, useParams, 'from') as any +} + +export function bindRouteScopeUseRouteContext( + moduleId: string, +): RouteScope['useRouteContext'] { + return bindRouteScopeIdApi(moduleId, useRouteContext, 'from') as any +} + +export function bindRouteScopeNotFound( + moduleId: string, +): RouteScope['notFound'] { + return bindRouteScopeIdApi(moduleId, notFound, 'routeId') as any +} diff --git a/packages/solid-router/src/router.ts b/packages/solid-router/src/router.ts index 3fce7c9d75..b7fa9c05d0 100644 --- a/packages/solid-router/src/router.ts +++ b/packages/solid-router/src/router.ts @@ -14,7 +14,7 @@ import type { } from './route' import type { JSX } from 'solid-js' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface RouterOptionsExtensions { /** * The default `component` a route should use if no component is provided. diff --git a/packages/solid-router/src/useBlocker.tsx b/packages/solid-router/src/useBlocker.tsx index 566a58d1ca..c6d5b0213d 100644 --- a/packages/solid-router/src/useBlocker.tsx +++ b/packages/solid-router/src/useBlocker.tsx @@ -1,3 +1,4 @@ +import { isServer } from '@tanstack/router-core/isServer' import * as Solid from 'solid-js' import { useRouter } from './useRouter' import type { @@ -11,6 +12,8 @@ import type { AnyRouter, ParseRoute, RegisteredRouter, + RegisteredRouterOf, + RouteScopeMarker, } from '@tanstack/router-core' type ShouldBlockFnLocation< @@ -30,14 +33,21 @@ type AnyShouldBlockFnLocation = ShouldBlockFnLocation type MakeShouldBlockFnLocationUnion< TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute, -> = TRoute extends any +> = TRouter['routeTree'] extends RouteScopeMarker ? ShouldBlockFnLocation< - TRoute['id'], - TRoute['fullPath'], - TRoute['types']['allParams'], - TRoute['types']['fullSearchSchema'] + string, + string, + Record, + Record > - : never + : TRoute extends any + ? ShouldBlockFnLocation< + TRoute['id'], + TRoute['fullPath'], + TRoute['types']['allParams'], + TRoute['types']['fullSearchSchema'] + > + : never type BlockerResolver = | { @@ -134,6 +144,16 @@ function _resolveBlockerOpts( } } +/** The generated module hook observes navigation across the entire application. */ +export type UseBlockerFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TWithResolver extends boolean = false, +>( + opts: UseBlockerOpts, +) => TWithResolver extends true + ? Solid.Accessor> + : void + export function useBlocker< TRouter extends AnyRouter = RegisteredRouter, TWithResolver extends boolean = false, @@ -171,14 +191,19 @@ export function useBlocker( const router = useRouter() - const [resolver, setResolver] = Solid.createSignal({ + const idle: BlockerResolver = { status: 'idle', current: undefined, next: undefined, action: undefined, proceed: undefined, reset: undefined, - }) + } + if (isServer ?? router.isServer) { + return () => idle + } + + const [resolver, setResolver] = Solid.createSignal(idle) Solid.createEffect(() => { const blockerFnComposed = async (blockerFnArgs: BlockerFnArgs) => { diff --git a/packages/solid-router/src/useLoaderData.tsx b/packages/solid-router/src/useLoaderData.tsx index 7b56918708..c873a21838 100644 --- a/packages/solid-router/src/useLoaderData.tsx +++ b/packages/solid-router/src/useLoaderData.tsx @@ -2,7 +2,9 @@ import { useMatch } from './useMatch' import type { Accessor } from 'solid-js' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseLoaderData, StrictOrFrom, UseLoaderDataResult, @@ -25,13 +27,26 @@ export type UseLoaderDataOptions< > = StrictOrFrom & UseLoaderDataBaseOptions -export type UseLoaderDataRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseLoaderDataRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, >( opts?: UseLoaderDataBaseOptions, ) => Accessor> +/** + * The signature of `useLoaderData`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLoaderData` of this type. + */ +export type UseLoaderDataFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TSelected = unknown, +>( + opts: UseLoaderDataOptions, +) => Accessor> + export function useLoaderData< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/solid-router/src/useLoaderDeps.tsx b/packages/solid-router/src/useLoaderDeps.tsx index 41664f0af7..d5eb5bb526 100644 --- a/packages/solid-router/src/useLoaderDeps.tsx +++ b/packages/solid-router/src/useLoaderDeps.tsx @@ -2,7 +2,9 @@ import { useMatch } from './useMatch' import type { Accessor } from 'solid-js' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseLoaderDeps, StrictOrFrom, UseLoaderDepsResult, @@ -23,13 +25,25 @@ export type UseLoaderDepsOptions< > = StrictOrFrom & UseLoaderDepsBaseOptions -export type UseLoaderDepsRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseLoaderDepsRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, >( opts?: UseLoaderDepsBaseOptions, ) => Accessor> +/** + * The signature of `useLoaderDeps`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLoaderDeps` of this type. + */ +export type UseLoaderDepsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TSelected = unknown, +>( + opts: UseLoaderDepsOptions, +) => Accessor> + export function useLoaderDeps< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/solid-router/src/useLocation.tsx b/packages/solid-router/src/useLocation.tsx index 5c968443bb..06c9226d4b 100644 --- a/packages/solid-router/src/useLocation.tsx +++ b/packages/solid-router/src/useLocation.tsx @@ -3,7 +3,9 @@ import { replaceEqualDeep } from '@tanstack/router-core' import { useRouter } from './useRouter' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, RouterState, } from '@tanstack/router-core' import type { Accessor } from 'solid-js' @@ -19,6 +21,17 @@ export type UseLocationResult< ? RouterState['location'] : TSelected +/** + * The signature of `useLocation`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLocation` of this type. + */ +export type UseLocationFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseLocationBaseOptions, +) => Accessor> + export function useLocation< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, diff --git a/packages/solid-router/src/useMatch.tsx b/packages/solid-router/src/useMatch.tsx index 8d5443cb4e..06eebe631a 100644 --- a/packages/solid-router/src/useMatch.tsx +++ b/packages/solid-router/src/useMatch.tsx @@ -1,12 +1,16 @@ import * as Solid from 'solid-js' import { invariant, replaceEqualDeep } from '@tanstack/router-core' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import { nearestMatchContext } from './matchContext' import { useRouter } from './useRouter' import type { AnyRouter, MakeRouteMatch, MakeRouteMatchUnion, + Register, RegisteredRouter, + RegisteredRouterOf, + RouteScopeMarker, StrictOrFrom, ThrowConstraint, ThrowOrOptional, @@ -20,13 +24,17 @@ export interface UseMatchBaseOptions< TSelected, > { select?: ( - match: MakeRouteMatch, + match: TRouter['routeTree'] extends RouteScopeMarker + ? TStrict extends true + ? MakeRouteMatch + : MakeRouteMatchUnion + : MakeRouteMatch, ) => TSelected shouldThrow?: TThrow } -export type UseMatchRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseMatchRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TThrow extends boolean = true, >( @@ -55,6 +63,28 @@ export type UseMatchResult< : MakeRouteMatchUnion : TSelected +/** + * The signature of `useMatch`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useMatch` of this type. + */ +export type UseMatchFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, +>( + opts: UseMatchOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected + >, +) => Solid.Accessor< + ThrowOrOptional, TThrow> +> + export function useMatch< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, @@ -75,10 +105,23 @@ export function useMatch< const router = useRouter() const contextMatch = Solid.useContext(nearestMatchContext) const nearestMatch = opts.from ? undefined : contextMatch + // `from` can be the module-local id of a module installed several times: + // it resolves through the nearest match. A live match never changes route, + // so read it once without tracking. + const nearestRouteId = + routeModules && opts.from + ? Solid.untrack(contextMatch[0 /* route id */]) + : undefined const match = () => { if (opts.from) { - return router.stores.getMatchStore(opts.from).get() + return router.stores + .getMatchStore( + routeModules + ? routeModules.resolveRouteId(router, opts.from, nearestRouteId) + : opts.from, + ) + .get() } return nearestMatch?.[1 /* match */]() @@ -107,7 +150,13 @@ export function useMatch< return undefined } - const res = opts.select ? opts.select(selectedMatch) : selectedMatch + const res = opts.select + ? opts.select( + selectedMatch as unknown as Parameters< + NonNullable + >[0], + ) + : selectedMatch if (prev === undefined) return res as TSelected return replaceEqualDeep(prev, res) as TSelected }) as any diff --git a/packages/solid-router/src/useNavigate.tsx b/packages/solid-router/src/useNavigate.tsx index 40e51ced6b..d7c198d273 100644 --- a/packages/solid-router/src/useNavigate.tsx +++ b/packages/solid-router/src/useNavigate.tsx @@ -1,29 +1,76 @@ import * as Solid from 'solid-js' +import { isServer } from '@tanstack/router-core/isServer' +import { routeModules } from '@tanstack/router-core/_internal/route-module' +import { nearestMatchContext } from './matchContext' import { useRouter } from './useRouter' import type { AnyRouter, + CompatibleRouteScope, FromPathOption, NavigateOptions, + Register, RegisteredRouter, + RegisteredRouterOf, + RouteModuleScope, UseNavigateResult, } from '@tanstack/router-core' +/** + * The signature of `useNavigate`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useNavigate` of this type. + */ +export type UseNavigateFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TDefaultFrom extends string = string, +>(_defaultOpts?: { + from?: FromPathOption + _module?: RouteModuleScope> +}) => UseNavigateResult + export function useNavigate< TRouter extends AnyRouter = RegisteredRouter, TDefaultFrom extends string = string, >(_defaultOpts?: { from?: FromPathOption -}): UseNavigateResult { +}): UseNavigateResult { const router = useRouter() + // Only the route-module translation reads the nearest route. A live match + // never changes route, so read it once without tracking. + const routeId = routeModules + ? Solid.useContext(nearestMatchContext)[0 /* routeId */]() + : undefined return ((options: NavigateOptions) => { - return router.navigate({ - ...options, - from: options.from ?? _defaultOpts?.from, - }) - }) as UseNavigateResult + return router.navigate( + routeModules + ? { + // Route-module APIs also pass their internal `_module` and + // `_fromRoute` scope; it resolves to the installation of the + // nearest match. + ..._defaultOpts, + _nearestRoute: routeId, + ...options, + from: options.from ?? _defaultOpts?.from, + } + : { ...options, from: options.from ?? _defaultOpts?.from }, + ) + }) as UseNavigateResult } +/** + * The signature of `Navigate`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `Navigate` of this type. + */ +export type NavigateComponentFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string = string, + const TTo extends string | undefined = undefined, + const TMaskFrom extends string = TFrom, + const TMaskTo extends string = '', +>( + props: NavigateOptions, +) => null + export function Navigate< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string = string, @@ -31,13 +78,18 @@ export function Navigate< const TMaskFrom extends string = TFrom, const TMaskTo extends string = '', >(props: NavigateOptions): null { - const { navigate } = useRouter() + const router = useRouter() + if (isServer ?? router.isServer) { + return null + } + const navigate = useNavigate() - Solid.onMount(() => { - navigate({ - ...props, - }) - }) + Solid.createEffect( + Solid.on( + () => ({ ...props }), + (options) => navigate(options), + ), + ) return null } diff --git a/packages/solid-router/src/useParams.tsx b/packages/solid-router/src/useParams.tsx index bec382bbb9..fd41295284 100644 --- a/packages/solid-router/src/useParams.tsx +++ b/packages/solid-router/src/useParams.tsx @@ -2,7 +2,9 @@ import { useMatch } from './useMatch' import type { Accessor } from 'solid-js' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseParams, StrictOrFrom, ThrowConstraint, @@ -30,8 +32,8 @@ export type UseParamsOptions< > = StrictOrFrom & UseParamsBaseOptions -export type UseParamsRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseParamsRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TThrow extends boolean = true, >( @@ -46,6 +48,28 @@ export type UseParamsRoute = < ThrowOrOptional, TThrow> > +/** + * The signature of `useParams`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useParams` of this type. + */ +export type UseParamsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, +>( + opts: UseParamsOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected + >, +) => Accessor< + ThrowOrOptional, TThrow> +> + export function useParams< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/solid-router/src/useRouteContext.ts b/packages/solid-router/src/useRouteContext.ts index 4a9ef1d786..07220a95ec 100644 --- a/packages/solid-router/src/useRouteContext.ts +++ b/packages/solid-router/src/useRouteContext.ts @@ -2,19 +2,34 @@ import { useMatch } from './useMatch' import type { Accessor } from 'solid-js' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, UseRouteContextBaseOptions, UseRouteContextOptions, UseRouteContextResult, } from '@tanstack/router-core' -export type UseRouteContextRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseRouteContextRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, >( opts?: UseRouteContextBaseOptions, ) => Accessor> +/** + * The signature of `useRouteContext`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouteContext` of this type. + */ +export type UseRouteContextFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TSelected = unknown, +>( + opts: UseRouteContextOptions, +) => Accessor> + export function useRouteContext< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/solid-router/src/useRouter.tsx b/packages/solid-router/src/useRouter.tsx index 344afe90ed..df8919b347 100644 --- a/packages/solid-router/src/useRouter.tsx +++ b/packages/solid-router/src/useRouter.tsx @@ -1,6 +1,21 @@ import * as Solid from 'solid-js' import { routerContext } from './routerContext' -import type { AnyRouter, RegisteredRouter } from '@tanstack/router-core' +import type { + AnyRouter, + Register, + RegisteredRouter, + RegisteredRouterOf, +} from '@tanstack/router-core' + +/** + * The signature of `useRouter`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouter` of this type. + */ +export type UseRouterFn = < + TRouter extends AnyRouter = RegisteredRouterOf, +>(opts?: { + warn?: boolean +}) => TRouter export function useRouter(opts?: { warn?: boolean diff --git a/packages/solid-router/src/useRouterState.tsx b/packages/solid-router/src/useRouterState.tsx index 382e35d2d2..e822f9829e 100644 --- a/packages/solid-router/src/useRouterState.tsx +++ b/packages/solid-router/src/useRouterState.tsx @@ -4,7 +4,9 @@ import { replaceEqualDeep } from '@tanstack/router-core' import { useRouter } from './useRouter' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, RouterState, } from '@tanstack/router-core' import type { Accessor } from 'solid-js' @@ -19,6 +21,17 @@ export type UseRouterStateResult< TSelected, > = unknown extends TSelected ? RouterState : TSelected +/** + * The signature of `useRouterState`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouterState` of this type. + */ +export type UseRouterStateFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseRouterStateOptions, +) => Accessor> + export function useRouterState< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, @@ -36,7 +49,7 @@ export function useRouterState< // The expression must stay inlined in the `if` so bundlers fold the // browser-build constant `isServer = false` and drop this server block. if (isServer ?? router.isServer) { - const state = router.stores.__store.get() as RouterState< + const state = router.stores.__store.get() as unknown as RouterState< TRouter['routeTree'] > const selected = ( @@ -56,7 +69,11 @@ export function useRouterState< const select = opts.select return Solid.createMemo((prev: TSelected | undefined) => { - const res = select(router.stores.__store.get()) + const res = select( + router.stores.__store.get() as unknown as RouterState< + TRouter['routeTree'] + >, + ) if (prev === undefined) return res return replaceEqualDeep(prev, res) }) as Accessor> diff --git a/packages/solid-router/src/useSearch.tsx b/packages/solid-router/src/useSearch.tsx index 79ed25ccb4..37a6ade190 100644 --- a/packages/solid-router/src/useSearch.tsx +++ b/packages/solid-router/src/useSearch.tsx @@ -2,7 +2,9 @@ import { useMatch } from './useMatch' import type { Accessor } from 'solid-js' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseSearch, StrictOrFrom, ThrowConstraint, @@ -30,8 +32,8 @@ export type UseSearchOptions< > = StrictOrFrom & UseSearchBaseOptions -export type UseSearchRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseSearchRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TThrow extends boolean = true, >( @@ -46,6 +48,28 @@ export type UseSearchRoute = < ThrowOrOptional, TThrow> > +/** + * The signature of `useSearch`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useSearch` of this type. + */ +export type UseSearchFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, +>( + opts: UseSearchOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected + >, +) => Accessor< + ThrowOrOptional, TThrow> +> + export function useSearch< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/solid-router/tests/blocker-server.test.tsx b/packages/solid-router/tests/blocker-server.test.tsx new file mode 100644 index 0000000000..899436d676 --- /dev/null +++ b/packages/solid-router/tests/blocker-server.test.tsx @@ -0,0 +1,32 @@ +import { afterEach, expect, test, vi } from 'vitest' +import { cleanup, render, screen } from '@solidjs/testing-library' +import { + RouterContextProvider, + createMemoryHistory, + createRootRoute, + createRouter, + useBlocker, +} from '../src' + +afterEach(cleanup) + +test('a server router does not register navigation blockers', async () => { + const history = createMemoryHistory({ initialEntries: ['/'] }) + const block = vi.spyOn(history, 'block') + const router = createRouter({ + routeTree: createRootRoute(), + history, + isServer: true, + }) + function Observer() { + const state = useBlocker({ shouldBlockFn: () => true, withResolver: true }) + return {state().status} + } + render(() => ( + + {() => } + + )) + await screen.findByText('idle') + expect(block).not.toHaveBeenCalled() +}) diff --git a/packages/solid-router/tests/navigate-options-parity.test.tsx b/packages/solid-router/tests/navigate-options-parity.test.tsx new file mode 100644 index 0000000000..287d5fc9ba --- /dev/null +++ b/packages/solid-router/tests/navigate-options-parity.test.tsx @@ -0,0 +1,74 @@ +import { createSignal } from 'solid-js' +import { afterEach, expect, test } from 'vitest' +import { + cleanup, + fireEvent, + render, + screen, + waitFor, +} from '@solidjs/testing-library' +import { + Navigate, + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +afterEach(cleanup) + +test('Navigate responds to option changes while mounted', async () => { + function component() { + const [id, setId] = createSignal('one') + const [q, setQ] = createSignal('first') + const [replace, setReplace] = createSignal(true) + return ( + <> + + + + + + ) + } + const root = createRootRoute({ component }) + const item = createRoute({ getParentRoute: () => root, path: '/items/$id' }) + const history = createMemoryHistory({ initialEntries: ['/'] }) + const router = createRouter({ routeTree: root.addChildren([item]), history }) + render(() => ) + await waitFor(() => + expect(router.state.location.href).toBe('/items/one?q=first'), + ) + const initialLength = history.length + await fireEvent.click(screen.getByText('Change params')) + await waitFor(() => + expect(router.state.location.href).toBe('/items/two?q=first'), + ) + expect(history.length).toBe(initialLength + 1) + await fireEvent.click(screen.getByText('Change search')) + await waitFor(() => + expect(router.state.location.href).toBe('/items/two?q=second'), + ) + expect(history.length).toBe(initialLength + 1) +}) diff --git a/packages/solid-router/tests/routeApi.test-d.tsx b/packages/solid-router/tests/routeApi.test-d.tsx index e6770e2652..1e19789806 100644 --- a/packages/solid-router/tests/routeApi.test-d.tsx +++ b/packages/solid-router/tests/routeApi.test-d.tsx @@ -124,7 +124,7 @@ describe('getRouteApi', () => { test('Link', () => { const Link = invoiceRouteApi.Link expectTypeOf(Link).toEqualTypeOf< - LinkComponentRoute<'/invoices/$invoiceId'> + LinkComponentRoute<'/invoices/$invoiceId', { router: DefaultRouter }> >() }) }) diff --git a/packages/solid-router/tests/routeModule.test.tsx b/packages/solid-router/tests/routeModule.test.tsx new file mode 100644 index 0000000000..f7596676f9 --- /dev/null +++ b/packages/solid-router/tests/routeModule.test.tsx @@ -0,0 +1,78 @@ +import { createSignal } from 'solid-js' +import { afterEach, expect, test } from 'vitest' +import { cleanup, render, screen, waitFor } from '@solidjs/testing-library' +import { + Outlet, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' +import { + bindCreateModuleRoot, + bindRouteScopeCreateLink, + bindRouteScopeLink, + mountRouteModule, +} from '../src/route-module-internal' + +afterEach(() => cleanup()) + +/** Renders an application whose root is `Home` and mounts module `@m` at `/shop`. */ +function renderApp(Home: () => any) { + const moduleRoot = bindCreateModuleRoot('@m')()({}) as any + moduleRoot.addChildren([ + createRoute({ + getParentRoute: () => moduleRoot, + path: '/item/$id', + component: () => item, + }), + ]) + const rootRoute = createRootRoute({ component: Home }) + const mounted = mountRouteModule(moduleRoot, { + parent: () => rootRoute, + at: '/shop', + } as any) + const router = createRouter({ + routeTree: rootRoute.addChildren([mounted]) as any, + history: createMemoryHistory({ initialEntries: ['/'] }), + }) + render(() => ) +} + +const ScopedLink = bindRouteScopeLink('@m') +const ScopedCustomLink = bindRouteScopeCreateLink('@m')((props: any) => ( +
+)) + +test.each([ + ['Link', ScopedLink], + ['createLink', ScopedCustomLink], +] as const)( + 'a scoped %s keeps the reactivity of each prop', + async (_, Component) => { + let childrenReads = 0 + const [id, setId] = createSignal('one') + const AnyComponent = Component as any + renderApp(() => ( + <> + + {(childrenReads++, (child))} + + + + )) + const child = await screen.findByTestId('child') + const anchor = child.parentElement as HTMLAnchorElement + expect(anchor.getAttribute('href')).toBe('/shop/item/one') + expect(childrenReads).toBe(1) + + setId('two') + await waitFor(() => + expect(anchor.getAttribute('href')).toBe('/shop/item/two'), + ) + // A params change neither re-creates the children nor the element. + expect(childrenReads).toBe(1) + expect(screen.getByTestId('child')).toBe(child) + }, +) diff --git a/packages/solid-router/tests/server/Navigate.test.tsx b/packages/solid-router/tests/server/Navigate.test.tsx new file mode 100644 index 0000000000..589b3e2b8c --- /dev/null +++ b/packages/solid-router/tests/server/Navigate.test.tsx @@ -0,0 +1,34 @@ +import { renderToString } from 'solid-js/web' +import { expect, test, vi } from 'vitest' +import { + Navigate, + RouterContextProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../../src' + +test('Navigate leaves the request location unchanged during server rendering', () => { + const root = createRootRoute() + const next = createRoute({ getParentRoute: () => root, path: '/next' }) + const router = createRouter({ + routeTree: root.addChildren([next]), + history: createMemoryHistory({ initialEntries: ['/'] }), + isServer: true, + }) + const navigate = vi.spyOn(router, 'navigate') + const html = renderToString(() => ( + + {() => ( + <> + + Request content + + )} + + )) + expect(html).toContain('Request content') + expect(navigate).not.toHaveBeenCalled() + expect(router.state.location.href).toBe('/') +}) diff --git a/packages/solid-router/vite.config.ts b/packages/solid-router/vite.config.ts index 3c9e49ec37..033f3da887 100644 --- a/packages/solid-router/vite.config.ts +++ b/packages/solid-router/vite.config.ts @@ -56,6 +56,7 @@ export default defineConfig((env) => tsconfigPath: './tsconfig.build.json', entry: [ './src/index.tsx', + './src/route-module-internal.ts', './src/index.dev.tsx', './src/ssr/client.ts', './src/ssr/server.ts', diff --git a/packages/solid-start/package.json b/packages/solid-start/package.json index 2f378426cc..51ed0cb30d 100644 --- a/packages/solid-start/package.json +++ b/packages/solid-start/package.json @@ -105,7 +105,13 @@ "default": "./dist/esm/client-only.js" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./_internal/route-module": { + "import": { + "types": "./dist/esm/route-module-internal.d.ts", + "default": "./dist/esm/route-module-internal.js" + } + } }, "sideEffects": false, "files": [ @@ -116,7 +122,7 @@ "!skills/_artifacts" ], "engines": { - "node": ">=22.12.0" + "node": ">=22.22.0" }, "dependencies": { "@tanstack/solid-router": "workspace:*", @@ -139,7 +145,9 @@ "eslint-plugin-react-hooks": "catalog:", "@arethetypeswrong/cli": "catalog:", "publint": "catalog:", - "rimraf": "catalog:" + "rimraf": "catalog:", + "@tanstack/router-generator": "workspace:*", + "vite-plugin-solid": "^2.11.11" }, "peerDependencies": { "@rsbuild/core": "^2.0.5", @@ -153,5 +161,15 @@ "vite": { "optional": true } + }, + "nx": { + "targets": { + "test:unit": { + "dependsOn": [ + "^build", + "build" + ] + } + } } } diff --git a/packages/solid-start/src/index.ts b/packages/solid-start/src/index.ts index bc5560978d..dd6cc74e07 100644 --- a/packages/solid-start/src/index.ts +++ b/packages/solid-start/src/index.ts @@ -1,5 +1,6 @@ export { useServerFn } from './useServerFn' export * from '@tanstack/start-client-core' +export type { StartModuleRequirements } from '@tanstack/start-client-core' // Explicit re-exports shadow `export *` above so these public-API names are // registered on the namespace at link time (via Vite SSR's `defineExport` // at fileStartIndex), surviving the cold-start SSR cycle through user diff --git a/packages/solid-start/src/route-module-internal.ts b/packages/solid-start/src/route-module-internal.ts new file mode 100644 index 0000000000..8642a07276 --- /dev/null +++ b/packages/solid-start/src/route-module-internal.ts @@ -0,0 +1 @@ +export { createStartModule } from '@tanstack/start-client-core/_internal/route-module' diff --git a/packages/solid-start/tests/route-module-build.test.ts b/packages/solid-start/tests/route-module-build.test.ts new file mode 100644 index 0000000000..e509bc9810 --- /dev/null +++ b/packages/solid-start/tests/route-module-build.test.ts @@ -0,0 +1,13 @@ +// @vitest-environment node +import { fileURLToPath } from 'node:url' +import { defineRouteModuleBuildTests } from '../../start-plugin-core/tests/route-module-build' + +// Builds a Start application that mounts a route module with this package's +// public Vite and Rsbuild plugins, then runs its server and client output. +defineRouteModuleBuildTests({ + framework: 'solid', + frameworkPackage: 'solid-js', + frameworkPlugins: ['vite-plugin-solid'], + pluginOptions: '{ ssr: true }', + packageRoot: fileURLToPath(new URL('..', import.meta.url)), +}) diff --git a/packages/solid-start/vite.config.ts b/packages/solid-start/vite.config.ts index 2c1a42d0e4..e7d97bb1ff 100644 --- a/packages/solid-start/vite.config.ts +++ b/packages/solid-start/vite.config.ts @@ -26,6 +26,7 @@ export default mergeConfig( exclude: ['./src/default-entry'], entry: [ './src/index.ts', + './src/route-module-internal.ts', './src/client.tsx', './src/hydration.ts', './src/client-rpc.ts', diff --git a/packages/start-client-core/package.json b/packages/start-client-core/package.json index c74dce13aa..f55b0256c5 100644 --- a/packages/start-client-core/package.json +++ b/packages/start-client-core/package.json @@ -78,7 +78,13 @@ "default": "./dist/esm/hydration/runtime.js" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./_internal/route-module": { + "import": { + "types": "./dist/esm/route-module-internal.d.ts", + "default": "./dist/esm/route-module-internal.js" + } + } }, "imports": { "#tanstack-start-entry": { diff --git a/packages/start-client-core/src/createMiddleware.ts b/packages/start-client-core/src/createMiddleware.ts index 9b19833d09..7345ebdf14 100644 --- a/packages/start-client-core/src/createMiddleware.ts +++ b/packages/start-client-core/src/createMiddleware.ts @@ -1,4 +1,8 @@ -import type { StartInstanceOptions } from './createStart' +import type { + StartModuleIdOf, + StartModuleRequiredContext, + ValidateModuleMiddlewareConsumer, +} from './createStartModule' import type { AnyServerFn, ConstrainValidator, @@ -67,7 +71,7 @@ export type CreateMiddlewareResult< export interface FunctionMiddleware< TRegister, -> extends FunctionMiddlewareAfterMiddleware { +> extends FunctionMiddlewareAfterMiddleware { middleware: ( middlewares: Constrain< TNewMiddlewares, @@ -134,6 +138,7 @@ export interface FunctionMiddlewareTypes< in out TClientSendContext, > { type: 'function' + startModule: StartModuleIdOf middlewares: TMiddlewares input: ResolveValidatorInput allInput: IntersectAllValidatorInputs @@ -303,11 +308,14 @@ export type GlobalFetchRequestContext = Register extends { ? TRequestContext : AnyContext -export type GlobalServerRequestContext = TRegister extends { - config: StartInstanceOptions -} - ? AssignAllMiddleware - : AnyContext +export type GlobalServerRequestContext = Assign< + StartModuleRequiredContext, 'requestContext'>, + TRegister extends { + config: { '~types': { requestMiddleware: infer TRequestMiddlewares } } + } + ? AssignAllMiddleware + : AnyContext +> type __AssignAllServerRequestContext< TMiddlewares, @@ -340,11 +348,14 @@ export type AssignAllServerFnContext< > > -type GlobalServerFnContext = TRegister extends { - config: StartInstanceOptions -} - ? AssignAllMiddleware - : AnyContext +type GlobalServerFnContext = Assign< + StartModuleRequiredContext, 'functionContext'>, + TRegister extends { + config: { '~types': { functionMiddleware: infer TFunctionMiddlewares } } + } + ? AssignAllMiddleware + : AnyContext +> type __AssignAllServerFnContext< TMiddlewares, @@ -420,7 +431,8 @@ export interface FunctionMiddlewareServer< TServerSendContext, TNewServerContext, TSendContext - >, + > & + ValidateModuleMiddlewareConsumer, ) => FunctionMiddlewareAfterServer< TRegister, TMiddlewares, @@ -726,6 +738,7 @@ export interface RequestMiddlewareTypes< TServerContext, > { type: 'request' + startModule: StartModuleIdOf // this only exists so we can use request middlewares in server functions allInput: undefined // this only exists so we can use request middlewares in server functions @@ -747,7 +760,8 @@ export interface RequestMiddlewareAfterMiddleware export interface RequestMiddlewareServer { server: ( - fn: RequestServerFn, + fn: RequestServerFn & + ValidateModuleMiddlewareConsumer, ) => RequestMiddlewareAfterServer } diff --git a/packages/start-client-core/src/createServerFn.ts b/packages/start-client-core/src/createServerFn.ts index ea1566aa37..fe72eb18fc 100644 --- a/packages/start-client-core/src/createServerFn.ts +++ b/packages/start-client-core/src/createServerFn.ts @@ -29,6 +29,7 @@ import type { IntersectAllValidatorInputs, IntersectAllValidatorOutputs, } from './createMiddleware' +import type { ValidateModuleMiddlewareConsumer } from './createStartModule' export type ServerFnStrict = boolean | { input?: boolean; output?: boolean } @@ -723,7 +724,8 @@ export interface ServerFnHandler< TInputValidator, TNewResponse, TStrict - >, + > & + ValidateModuleMiddlewareConsumer, ) => Fetcher } diff --git a/packages/start-client-core/src/createStart.ts b/packages/start-client-core/src/createStart.ts index 0929bc3b31..f2962752fa 100644 --- a/packages/start-client-core/src/createStart.ts +++ b/packages/start-client-core/src/createStart.ts @@ -7,6 +7,8 @@ import type { CreateMiddlewareFn, } from './createMiddleware' import type { CustomFetch } from './createServerFn' +import type { AnyStartModule, WithStartModules } from './createStartModule' +import type { StartOptionList } from './startOptionList' import type { AnySerializationAdapter, Register, @@ -18,12 +20,18 @@ export interface StartInstanceOptions< in out TDefaultSsr, in out TRequestMiddlewares, in out TFunctionMiddlewares, + in out TStartModules = [], + in out TOwnRequestMiddlewares = TRequestMiddlewares, + in out TOwnFunctionMiddlewares = TFunctionMiddlewares, > { '~types': StartInstanceTypes< TSerializationAdapters, TDefaultSsr, TRequestMiddlewares, - TFunctionMiddlewares + TFunctionMiddlewares, + TStartModules, + TOwnRequestMiddlewares, + TOwnFunctionMiddlewares > serializationAdapters?: TSerializationAdapters defaultSsr?: TDefaultSsr @@ -55,6 +63,9 @@ export interface StartInstance< in out TDefaultSsr, in out TRequestMiddlewares, in out TFunctionMiddlewares, + in out TStartModules = [], + in out TOwnRequestMiddlewares = TRequestMiddlewares, + in out TOwnFunctionMiddlewares = TFunctionMiddlewares, > { getOptions: () => | Promise< @@ -62,14 +73,20 @@ export interface StartInstance< TSerializationAdapters, TDefaultSsr, TRequestMiddlewares, - TFunctionMiddlewares + TFunctionMiddlewares, + TStartModules, + TOwnRequestMiddlewares, + TOwnFunctionMiddlewares > > | StartInstanceOptions< TSerializationAdapters, TDefaultSsr, TRequestMiddlewares, - TFunctionMiddlewares + TFunctionMiddlewares, + TStartModules, + TOwnRequestMiddlewares, + TOwnFunctionMiddlewares > createMiddleware: CreateMiddlewareFn } @@ -79,11 +96,17 @@ export interface StartInstanceTypes< in out TDefaultSsr, in out TRequestMiddlewares, in out TFunctionMiddlewares, + in out TStartModules = [], + in out TOwnRequestMiddlewares = TRequestMiddlewares, + in out TOwnFunctionMiddlewares = TFunctionMiddlewares, > { serializationAdapters: TSerializationAdapters defaultSsr: TDefaultSsr requestMiddleware: TRequestMiddlewares functionMiddleware: TFunctionMiddlewares + startModules: TStartModules + ownRequestMiddleware: TOwnRequestMiddlewares + ownFunctionMiddleware: TOwnFunctionMiddlewares } function dedupeSerializationAdapters( @@ -101,9 +124,45 @@ function dedupeSerializationAdapters( } } +const startModuleOptionKeys = [ + 'serializationAdapters', + 'requestMiddleware', + 'functionMiddleware', +] as const + +/** + * Returns the options with the contributions of the installed route modules + * appended: the application's own entries first, each entry once. Middleware + * requirements are type-only. The factory's options object is not changed, so + * repeated `getOptions()` calls never accumulate. + */ +function installStartModules>( + options: T, + modules: ReadonlyArray, +): T { + const installed: Record = { ...options } + const fragments = Array.from(new Set(modules), (module) => + module.getOptions(), + ) + for (const key of startModuleOptionKeys) { + const merged = new Set(options[key]) + for (const fragment of fragments) { + fragment[key]?.forEach((entry: any) => merged.add(entry)) + } + installed[key] = Array.from(merged) + } + return installed as T +} + function dedupeOptions< - T extends { serializationAdapters?: ReadonlyArray }, + T extends { + serializationAdapters?: ReadonlyArray + extends?: ReadonlyArray + }, >(options: T): T { + if (options.extends) { + options = installStartModules(options, options.extends) + } if (options.serializationAdapters) { const deduped = new Set() dedupeSerializationAdapters( @@ -115,39 +174,104 @@ function dedupeOptions< return options } +/** + * Options of `createStart`: the Start instance options plus the Start + * fragments of installed route modules (`extends`). + */ +export type CreateStartOptions< + TSerializationAdapters, + TDefaultSsr, + TRequestMiddlewares, + TFunctionMiddlewares, + TStartModules, +> = Omit< + StartInstanceOptions< + TSerializationAdapters, + TDefaultSsr, + TRequestMiddlewares, + TFunctionMiddlewares + >, + '~types' +> & { + /** + * Start fragments of route modules to install, usually `startModules` from + * the generated `startModules.gen.ts`. Their serialization adapters and + * middleware run after the application's own. + */ + extends?: TStartModules +} + +type AnyCreateStartOptions = CreateStartOptions< + ReadonlyArray, + SSROption, + ReadonlyArray, + ReadonlyArray, + ReadonlyArray +> + export const createStart = < const TSerializationAdapters extends ReadonlyArray = [], TDefaultSsr extends SSROption = SSROption, const TRequestMiddlewares extends ReadonlyArray = [], const TFunctionMiddlewares extends ReadonlyArray = [], + const TStartModules extends ReadonlyArray = [], + const TOptions extends + | AnyCreateStartOptions + | Promise = + | AnyCreateStartOptions + | Promise, >( - getOptions: () => + getOptions: (() => | Promise< - Omit< - StartInstanceOptions< - TSerializationAdapters, - TDefaultSsr, - TRequestMiddlewares, - TFunctionMiddlewares - >, - '~types' - > - > - | Omit< - StartInstanceOptions< + CreateStartOptions< TSerializationAdapters, TDefaultSsr, TRequestMiddlewares, - TFunctionMiddlewares - >, - '~types' - >, + TFunctionMiddlewares, + TStartModules + > + > + | CreateStartOptions< + TSerializationAdapters, + TDefaultSsr, + TRequestMiddlewares, + TFunctionMiddlewares, + TStartModules + >) & + (() => TOptions), ): StartInstance< - TSerializationAdapters, + WithStartModules< + StartOptionList< + Awaited, + 'serializationAdapters', + TSerializationAdapters + >, + StartOptionList, 'extends', TStartModules>, + 'serializationAdapters' + >, TDefaultSsr, - TRequestMiddlewares, - TFunctionMiddlewares + WithStartModules< + StartOptionList< + Awaited, + 'requestMiddleware', + TRequestMiddlewares + >, + StartOptionList, 'extends', TStartModules>, + 'requestMiddleware' + >, + WithStartModules< + StartOptionList< + Awaited, + 'functionMiddleware', + TFunctionMiddlewares + >, + StartOptionList, 'extends', TStartModules>, + 'functionMiddleware' + >, + StartOptionList, 'extends', TStartModules>, + StartOptionList, 'requestMiddleware', TRequestMiddlewares>, + StartOptionList, 'functionMiddleware', TFunctionMiddlewares> > => { return { // A synchronous factory returns synchronously so callers can skip a @@ -160,18 +284,21 @@ export const createStart = < : dedupeOptions(options) }, createMiddleware: createMiddleware, - } as StartInstance< - TSerializationAdapters, - TDefaultSsr, - TRequestMiddlewares, - TFunctionMiddlewares - > + } as StartInstance } -export type AnyStartInstance = StartInstance -export type AnyStartInstanceOptions = StartInstanceOptions +export type AnyStartInstance = StartInstance +export type AnyStartInstanceOptions = StartInstanceOptions< + any, + any, + any, + any, + any, + any, + any +> -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { interface SerializableExtensions { serverFn: { [TSS_SERVER_FUNCTION]: true } } diff --git a/packages/start-client-core/src/createStartModule.ts b/packages/start-client-core/src/createStartModule.ts new file mode 100644 index 0000000000..eab2ee509d --- /dev/null +++ b/packages/start-client-core/src/createStartModule.ts @@ -0,0 +1,818 @@ +import type { + AnyFunctionMiddleware, + AnyRequestMiddleware, + AssignAllServerFnContext, + AssignAllServerRequestContext, + GlobalFetchRequestContext, +} from './createMiddleware' +import type { + AnyStartInstance, + CreateStartOptions, + StartInstanceOptions, +} from './createStart' +import type { StartOptionList } from './startOptionList' +import type { + AnySerializationAdapter, + Assign, + SSROption, +} from '@tanstack/router-core' + +/** Type-only requirements of route modules, keyed by their package names. */ +export interface StartModuleRequirements {} + +/** A module's middleware register, independent of its contributed fragment. */ +export interface StartModuleRegister { + startModule: TModuleId +} + +export type StartModuleRequiredContext< + TModuleId extends string, + TKind extends 'requestContext' | 'functionContext', +> = [TModuleId] extends [never] + ? undefined + : TModuleId extends keyof StartModuleRequirements + ? TKind extends keyof StartModuleRequirements[TModuleId] + ? StartModuleRequirements[TModuleId][TKind] + : undefined + : undefined + +export type StartModuleIdOf = TRegister extends { + startModule: infer TModuleId extends string +} + ? TModuleId + : never + +/** Executable contributions; required context is declared in the registry. */ +export interface StartModuleOptions< + in out TSerializationAdapters, + in out TRequestMiddlewares, + in out TFunctionMiddlewares, +> { + serializationAdapters?: TSerializationAdapters + requestMiddleware?: TRequestMiddlewares + functionMiddleware?: TFunctionMiddlewares +} + +export interface StartModule< + in out TModuleId extends string, + in out TSerializationAdapters, + in out TRequestMiddlewares, + in out TFunctionMiddlewares, +> { + id: TModuleId + getOptions: () => StartModuleOptions< + TSerializationAdapters, + TRequestMiddlewares, + TFunctionMiddlewares + > +} + +export type AnyStartModule = StartModule + +/** Application settings cannot be applied by an executable module fragment. */ +type ApplicationOnlyOptions = { + [K in Exclude< + keyof CreateStartOptions, + StartModuleOptionKey + >]?: never +} + +export type CreateStartModuleFn = < + const TSerializationAdapters extends ReadonlyArray = + [], + const TRequestMiddlewares extends ReadonlyArray = [], + const TFunctionMiddlewares extends ReadonlyArray = [], + const TOptions extends { + serializationAdapters?: ReadonlyArray + requestMiddleware?: ReadonlyArray + functionMiddleware?: ReadonlyArray + } = StartModuleOptions< + TSerializationAdapters, + TRequestMiddlewares, + TFunctionMiddlewares + >, +>( + getOptions: (() => StartModuleOptions< + TSerializationAdapters, + TRequestMiddlewares, + TFunctionMiddlewares + > & + ApplicationOnlyOptions) & + (() => TOptions), +) => StartModule< + TModuleId, + StartOptionList, + StartOptionList, + StartOptionList +> + +/** @experimental Bound by generated scopes to the module's package name. */ +export function createStartModule( + moduleId: TModuleId, +): CreateStartModuleFn { + return ((getOptions) => ({ + id: moduleId, + getOptions, + })) as CreateStartModuleFn +} + +/** The contributions visible to a module's server functions and routes. */ +export type StartModuleConfig = + StartInstanceOptions< + StartModuleOption, + SSROption, + StartModuleOption, + StartModuleOption + > + +type StartModuleOptionKey = + | 'serializationAdapters' + | 'requestMiddleware' + | 'functionMiddleware' + +type StartModuleOption = + TModule extends StartModule< + any, + infer TSerializationAdapters, + infer TRequestMiddlewares, + infer TFunctionMiddlewares + > + ? { + serializationAdapters: TSerializationAdapters + requestMiddleware: TRequestMiddlewares + functionMiddleware: TFunctionMiddlewares + }[TKey] + : [] + +type Entries = TList extends ReadonlyArray ? TEntry : never + +type StartModulesEntries< + TModules, + TKey extends StartModuleOptionKey, + TEntries extends Array = [], +> = TModules extends readonly [infer TModule, ...infer TRest] + ? StartModuleOption extends infer TList extends + ReadonlyArray + ? StartModulesEntries + : TEntries + : TModules extends readonly [] + ? TEntries + : Array< + TEntries[number] | Entries, TKey>> + > + +export type WithStartModules< + TOwn extends ReadonlyArray, + TModules, + TKey extends StartModuleOptionKey, +> = TModules extends readonly [] + ? TOwn + : [...TOwn, ...StartModulesEntries] + +type InstanceTypes = Awaited< + ReturnType +>['~types'] + +type IsAny = 0 extends 1 & T ? true : false + +type UnionToIntersection = ( + T extends unknown ? (value: T) => void : never +) extends (value: infer TIntersection) => void + ? TIntersection + : never + +/** + * The id a module proves it installs: one literal, as the generated scopes + * pass their package name. `any`, `string` and unions prove nothing. + */ +type ProvenModuleId = [TModule] extends [AnyStartModule] + ? IsAny extends true + ? never + : string extends TModule['id'] + ? never + : [TModule['id']] extends [UnionToIntersection] + ? TModule['id'] + : never + : never + +/** The ids a module list proves installed, computed once per list. */ +type ProvenModuleIds> = { + [K in keyof TModules]: ProvenModuleId +}[number] + +type Installed = + IsAny extends true + ? 'Cannot establish route module installation from an unknown extends list' + : TModules extends ReadonlyArray + ? number extends TModules['length'] + ? 'Cannot establish route module installation from a non-tuple extends list' + : TId extends ProvenModuleIds + ? true + : `Route module '${TId}' is not installed: add 'extends: startModules' to createStart()` + : 'Cannot establish route module installation from an unknown extends list' + +type HasContributions = + Entries> extends never + ? false + : true + +type ValidateInstalled = TRequired extends readonly [ + infer TModule extends AnyStartModule, + ...infer TRest, +] + ? HasContributions extends false + ? ValidateInstalled + : Exclude, true> extends infer TError + ? [TError] extends [never] + ? ValidateInstalled + : TError + : never + : TRequired extends readonly [] + ? true + : 'Cannot establish required fragments from a non-tuple module list' + +type MissingKeys = Exclude & string + +type IncompatibleKeys = { + [K in keyof TNeed]-?: K extends keyof THave + ? [THave[K]] extends [TNeed[K]] + ? never + : K + : never +}[keyof TNeed] & + string + +/** Required fields the provided context cannot certify: typed `any` or `never`. */ +type UnprovableKeys = { + [K in keyof TNeed]-?: K extends keyof THave + ? IsAny extends true + ? K + : [THave[K]] extends [never] + ? K + : never + : never +}[keyof TNeed] & + string + +type ValidateContext< + TId extends string, + TPhase extends string, + TProvided, + TRequired, + TWhere extends string = '', +> = [TRequired] extends [never] + ? `Route module '${TId}' declares impossible ${TPhase} context${TWhere}` + : [TRequired] extends [undefined] + ? true + : IsAny extends true + ? `Cannot establish ${TPhase} context for route module '${TId}' from any${TWhere}` + : [UnprovableKeys] extends [never] + ? [TProvided] extends [TRequired] + ? true + : [MissingKeys] extends [never] + ? [IncompatibleKeys] extends [never] + ? `Route module '${TId}' requires compatible ${TPhase} context${TWhere}` + : `Route module '${TId}' requires ${TPhase} context with incompatible field '${IncompatibleKeys}'${TWhere}` + : `Route module '${TId}' requires ${TPhase} context '${MissingKeys}' that is not provided${TWhere}` + : `Cannot establish ${TPhase} context field '${UnprovableKeys}' for route module '${TId}' from any or never${TWhere}` + +type ValidateConsumer< + TId extends string, + TPhase extends 'request' | 'function', + TContext, + TWhere extends string = '', +> = [TId] extends [never] + ? true + : TId extends unknown + ? ValidateContext< + TId, + 'request', + TContext, + StartModuleRequiredContext, + TWhere + > extends infer TRequest + ? [TRequest] extends [true] + ? TPhase extends 'function' + ? ValidateContext< + TId, + 'function', + TContext, + StartModuleRequiredContext, + TWhere + > + : true + : TRequest + : never + : never + +type RequiredContextKeys = [T] extends [never] + ? 'impossible' + : [T] extends [undefined] + ? never + : T extends unknown + ? keyof NonNullable + : never + +type RequiredContextKeysFor = TId extends string + ? + | RequiredContextKeys> + | RequiredContextKeys> + : never + +/** The module ids among `TId` that require any context. */ +type ConsumerIds = TId extends string + ? [RequiredContextKeysFor] extends [never] + ? never + : TId + : never + +type MiddlewareWork = { + middleware: TMiddleware + moduleId: TId + expanded: TExpanded +} + +type TagList = + IsAny extends true + ? Array> + : TList extends undefined + ? [] + : TList extends ReadonlyArray + ? { [K in keyof TList]: MiddlewareWork } + : Array> + +type TaggedContributions< + TModules, + TKey extends 'requestMiddleware' | 'functionMiddleware', + TEntries extends ReadonlyArray> = [], +> = TModules extends readonly [ + infer TModule extends AnyStartModule, + ...infer TRest, +] + ? TagList< + StartModuleOption, + TModule['id'] + > extends infer TTagged extends ReadonlyArray< + MiddlewareWork + > + ? TaggedContributions + : never + : TModules extends readonly [] + ? TEntries + : Array> + +type MiddlewareTypes = T extends { '~types': infer TTypes } ? TTypes : never + +type MiddlewareOwner = + MiddlewareTypes extends { + startModule: infer TId extends string + } + ? [TId] extends [never] + ? TFallback + : TId + : TFallback + +type NestedMiddleware = + MiddlewareTypes extends { middlewares: infer TList } ? TList : undefined + +type ContextState< + TContext = unknown, + TSeen = unknown, + TWriter extends string = string, +> = { + context: TContext + seen: TSeen + writer: TWriter +} + +type ContextPropertyKey = TKey extends number + ? number extends TKey + ? `${number}` | 'NaN' | 'Infinity' | '-Infinity' + : `${TKey}` + : TKey + +/** Index signatures also include template patterns such as `${number}`. */ +type HasContextIndex = true extends ( + TKeys extends PropertyKey + ? {} extends Record + ? true + : false + : never +) + ? true + : false + +type OverlappingContextValues< + TContext, + TKey extends PropertyKey, +> = TContext[keyof TContext & + keyof { + [K in keyof TContext as [ + ContextPropertyKey & ContextPropertyKey, + ] extends [never] + ? never + : K]: unknown + }] + +type GuaranteedContextProperties = { + [K in keyof TContext as {} extends Pick ? never : K]: TContext[K] +} + +type HasOptionalContextProperties = + keyof TContext extends keyof GuaranteedContextProperties + ? false + : true + +type WidenOptionalContext = { + [K in keyof TContext]: {} extends Pick + ? TContext[K] | OverlappingContextValues + : TContext[K] +} + +type RetainedContext = { + [K in keyof TLeft as ContextPropertyKey extends ContextPropertyKey< + keyof GuaranteedContextProperties + > + ? never + : K]: TLeft[K] | OverlappingContextValues +} + +/** + * Runtime context merges use JavaScript property identity. Numeric and string + * spellings must overwrite, not intersect into a misleading `never` value. + * Optional fields and index signatures may leave old keys present. Retain the + * left-hand presence and both possible values unless the right guarantees a key. + * This proof can conservatively retain a widened index after a finite repair. + */ +type AssignRequiredContext = + IsAny extends true + ? Assign + : TLeft extends object + ? TRight extends object + ? true extends + | HasOptionalContextProperties + | HasOptionalContextProperties + ? RetainedContext & WidenOptionalContext + : Extract extends never + ? Assign + : RetainedContext & TRight + : Assign + : Assign + +/** + * This walk proves required context; callback inference retains the full context + * separately. Keep correlated union branches and complete required field values, + * but avoid enumerating execute/skip combinations for unrelated fields. + * Indexed objects stay whole: projecting their keys can invent a required named + * property, or discard a property that violates an indexed requirement. + */ +type RequiredContext = + HasContextIndex extends true + ? TContext + : IsAny extends true + ? TContext + : TContext extends object + ? HasContextIndex extends true + ? TContext + : { + [K in keyof TContext as ContextPropertyKey extends ContextPropertyKey + ? K + : never]: TContext[K] + } + : TContext + +type Advance< + TState extends ContextState, + TMiddleware, + TId extends string, + TKeys extends PropertyKey, +> = + MiddlewareTypes extends { serverContext: infer TOutput } + ? RequiredContext extends infer TRequiredOutput + ? ContextState< + // Type equality cannot prove object identity. A structurally matching + // earlier middleware may be this same object, so both outcomes matter. + unknown extends TState['seen'] + ? + | TState['context'] + | AssignRequiredContext + : [Extract] extends [never] + ? AssignRequiredContext + : + | TState['context'] + | AssignRequiredContext, + TState['seen'] | TMiddleware, + [TOutput] extends [undefined] ? TState['writer'] : TId + > + : never + : 'Cannot establish the context produced by a middleware' + +/** Tail-recursive work queue follows nested dependencies before their consumer. */ +type Walk< + TQueue, + TState extends ContextState, + TPhase extends 'request' | 'function', + TKeys extends PropertyKey, +> = TQueue extends readonly [ + infer THead extends MiddlewareWork, + ...infer TRest, +] + ? MiddlewareOwner< + THead['middleware'], + THead['moduleId'] + > extends infer TOwner extends string + ? THead['expanded'] extends true + ? MiddlewareTypes extends { method: unknown } + ? // Server-function builders only contribute their middleware lists. + Walk + : ValidateConsumer< + TOwner, + TPhase, + TState['context'], + ` before middleware from '${TOwner}' (after '${TState['writer']}')` + > extends infer TCheck + ? [TCheck] extends [true] + ? Advance< + TState, + THead['middleware'], + TOwner, + TKeys + > extends infer TNext + ? TNext extends ContextState + ? Walk + : TNext + : never + : TCheck + : never + : Walk< + [ + ...TagList, TOwner>, + MiddlewareWork, + ...TRest, + ], + TState, + TPhase, + TKeys + > + : never + : TQueue extends readonly [] + ? TState + : `Cannot establish ${TPhase} context from a non-tuple middleware list` + +type RegisteredMiddleware< + TRegister, + TKey extends 'requestMiddleware' | 'functionMiddleware', +> = TRegister extends { config: { '~types': infer TTypes } } + ? TTypes[keyof TTypes & TKey] + : undefined + +/** Include nested global entries when deciding whether a local entry may skip. */ +type KnownMiddleware = TQueue extends readonly [ + infer THead, + ...infer TRest, +] + ? NestedMiddleware extends infer TNested + ? TNested extends ReadonlyArray + ? KnownMiddleware<[...TNested, ...TRest], TSeen | THead> + : KnownMiddleware + : never + : TQueue extends undefined | readonly [] + ? TSeen + : unknown + +type LocalContextState< + TRegister, + TPhase extends 'request' | 'function', + TKeys extends PropertyKey, +> = ContextState< + RequiredContext< + TPhase extends 'request' + ? AssignAllServerRequestContext + : AssignAllServerFnContext, + TKeys + >, + | KnownMiddleware> + | (TPhase extends 'function' + ? KnownMiddleware> + : never), + 'global middleware' +> + +/** Owners anywhere in a local chain, including widened lists and dependencies. */ +type LocalMiddlewareOwners = + TList extends ReadonlyArray + ? IsAny extends true + ? never + : TMiddleware extends unknown + ? + | MiddlewareOwner + | LocalMiddlewareOwners> + : never + : never + +/** + * Check a completed local chain only when attaching its server-side consumer. + * Applications without any module requirement skip the walk entirely. + */ +export type ValidateModuleMiddlewareConsumer< + TRegister, + TMiddlewares, + TPhase extends 'request' | 'function', +> = [keyof StartModuleRequirements] extends [never] + ? unknown + : + | StartModuleIdOf + | LocalMiddlewareOwners extends infer TIds + ? [ConsumerIds] extends [never] + ? unknown + : Walk< + TagList, + LocalContextState>, + TPhase, + RequiredContextKeysFor + > extends infer TResult + ? [TResult] extends [ContextState] + ? ValidateConsumer< + StartModuleIdOf, + TPhase, + TResult['context'], + ' before the local server callback' + > extends infer TCheck + ? [TCheck] extends [true] + ? unknown + : TCheck + : never + : TResult + : never + : never + +type ValidateConsumers< + TIds, + TRequestContext, + TFunctionContext, + TWhere extends string, +> = TIds extends readonly [infer TId extends string, ...infer TRest] + ? ValidateHostConsumer< + TId, + TRequestContext, + TFunctionContext, + TWhere + > extends infer TResult + ? [TResult] extends [true] + ? ValidateConsumers + : TResult + : never + : true + +type ValidateHostConsumer< + TId extends string, + TRequestContext, + TFunctionContext, + TWhere extends string, +> = TId extends unknown + ? ValidateContext< + TId, + 'request', + TRequestContext, + StartModuleRequiredContext, + TWhere + > extends infer TRequest + ? [TRequest] extends [true] + ? ValidateConsumer< + TId, + 'function', + TFunctionContext, + TWhere + > extends infer TFunction + ? [TFunction] extends [true] + ? true + : TFunction + : never + : TRequest + : never + : never + +type ValidateEffectiveContext< + TTypes, + TIds extends ReadonlyArray, + TKeys extends PropertyKey = RequiredContextKeysFor< + TIds[number] | ExecutedMiddlewareOwners + >, +> = + Walk< + TagList, + ContextState< + RequiredContext, + never, + 'handler.fetch' + >, + 'request', + TKeys + > extends infer TOwnRequest + ? [TOwnRequest] extends [ContextState] + ? Walk< + TagList< + TTypes[keyof TTypes & 'ownFunctionMiddleware'], + 'application' + >, + TOwnRequest, + 'function', + TKeys + > extends infer TOwnFunction + ? [TOwnFunction] extends [ContextState] + ? ValidateConsumers< + TIds, + TOwnRequest['context'], + TOwnFunction['context'], + ' from application middleware' + > extends infer THost + ? [THost] extends [true] + ? Walk< + TaggedContributions< + TTypes[keyof TTypes & 'startModules'], + 'requestMiddleware' + >, + TOwnRequest, + 'request', + TKeys + > extends infer TRequest + ? [TRequest] extends [ContextState] + ? Walk< + [ + ...TagList< + TTypes[keyof TTypes & 'ownFunctionMiddleware'], + 'application' + >, + ...TaggedContributions< + TTypes[keyof TTypes & 'startModules'], + 'functionMiddleware' + >, + ], + TRequest, + 'function', + TKeys + > extends infer TFunction + ? [TFunction] extends [ContextState] + ? ValidateConsumers< + TIds, + TRequest['context'], + TFunction['context'], + ' at terminal consumers' + > + : TFunction + : never + : TRequest + : never + : THost + : never + : TOwnFunction + : never + : TOwnRequest + : never + +/** Owners of executable entries, whether or not their routes are installed. */ +type ExecutedMiddlewareOwners = + | LocalMiddlewareOwners< + TTypes[keyof TTypes & ('requestMiddleware' | 'functionMiddleware')] + > + | (Entries< + TTypes[keyof TTypes & 'startModules'] + > extends infer TModule extends AnyStartModule + ? TModule['id'] + : never) + +/** + * Generated contracts supply installed package IDs separately from executable + * fragments, so requirement-only modules need no runtime witness. + */ +export type ValidateStartModules< + TInstance extends AnyStartInstance, + TModules extends ReadonlyArray, + TInstalledModuleIds extends ReadonlyArray = { + [K in keyof TModules]: TModules[K]['id'] + }, +> = + ValidateInstalled< + InstanceTypes['startModules'], + TModules + > extends infer TInstalled + ? [TInstalled] extends [true] + ? number extends TInstalledModuleIds['length'] + ? 'Cannot establish installed route modules from a non-tuple contract list' + : string extends TInstalledModuleIds[number] + ? 'Cannot establish installed route module requirements from unknown package identities' + : [ + ConsumerIds< + | TInstalledModuleIds[number] + | ExecutedMiddlewareOwners> + >, + ] extends [never] + ? true + : ValidateEffectiveContext< + InstanceTypes, + TInstalledModuleIds + > + : TInstalled + : never + +export type AssertStartModules = TResult diff --git a/packages/start-client-core/src/index.tsx b/packages/start-client-core/src/index.tsx index e9a8b92d85..f263afa8a1 100644 --- a/packages/start-client-core/src/index.tsx +++ b/packages/start-client-core/src/index.tsx @@ -22,6 +22,7 @@ export { export { createServerFn } from './createServerFn' export { createMiddleware, + type CreateMiddlewareFn, type IntersectAllValidatorInputs, type IntersectAllValidatorOutputs, type FunctionMiddlewareServerFn, @@ -62,6 +63,7 @@ export { type RequestServerResult, } from './createMiddleware' export type { + CreateServerFn, CompiledFetcherFnOptions, CompiledFetcherFn, CustomFetch, @@ -122,9 +124,22 @@ export { createStart } from './createStart' export type { AnyStartInstance, AnyStartInstanceOptions, + CreateStartOptions, StartInstance, StartInstanceOptions, } from './createStart' +export type { + AnyStartModule, + AssertStartModules, + CreateStartModuleFn, + StartModule, + StartModuleConfig, + StartModuleOptions, + StartModuleRegister, + StartModuleRequirements, + ValidateStartModules, + WithStartModules, +} from './createStartModule' export type { Register } from '@tanstack/router-core' export { getRouterInstance } from './getRouterInstance' diff --git a/packages/start-client-core/src/route-module-internal.ts b/packages/start-client-core/src/route-module-internal.ts new file mode 100644 index 0000000000..10b5a8c973 --- /dev/null +++ b/packages/start-client-core/src/route-module-internal.ts @@ -0,0 +1 @@ +export { createStartModule } from './createStartModule' diff --git a/packages/start-client-core/src/serverRoute.ts b/packages/start-client-core/src/serverRoute.ts index 511412683e..c70b8aa599 100644 --- a/packages/start-client-core/src/serverRoute.ts +++ b/packages/start-client-core/src/serverRoute.ts @@ -12,7 +12,7 @@ import type { AssignAllServerRequestContext, } from './createMiddleware' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { interface FilebaseRouteOptionsInterface< TRegister, TParentRoute extends AnyRoute = AnyRoute, diff --git a/packages/start-client-core/src/startOptionList.ts b/packages/start-client-core/src/startOptionList.ts new file mode 100644 index 0000000000..970796bca2 --- /dev/null +++ b/packages/start-client-core/src/startOptionList.ts @@ -0,0 +1,11 @@ +/** Absent or undefined factory options cannot prove their entries always run. */ +export type StartOptionList< + TOptions, + TKey extends PropertyKey, + TList extends ReadonlyArray, +> = + TOptions extends Record + ? undefined extends TOptions[TKey] + ? [] | TList + : TList + : [] | TList diff --git a/packages/start-client-core/src/tests/createStartModule.test-d.ts b/packages/start-client-core/src/tests/createStartModule.test-d.ts new file mode 100644 index 0000000000..8af1080f6a --- /dev/null +++ b/packages/start-client-core/src/tests/createStartModule.test-d.ts @@ -0,0 +1,331 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createServerFn } from '../createServerFn' +import { createStart } from '../createStart' +import { createStartModule } from '../createStartModule' +import type { CreateMiddlewareFn } from '../createMiddleware' +import type { CreateServerFn } from '../createServerFn' +import type { + StartModuleConfig, + StartModuleRegister, + ValidateStartModules, +} from '../createStartModule' + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/products': { + requestContext: { userId: string } + functionContext: { locale: string } + } + '@review/reader': { requestContext: { value: string } } + '@review/numeric': { requestContext: { value: number } } + '@review/function-only': { functionContext: { value: string } } + '@review/requirement-only': { requestContext: { userId: string } } + '@review/unused': { requestContext: { unrelated: never } } + } +} + +const createProductsMiddleware = + createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/products'> + > +const catalog = createProductsMiddleware({ type: 'function' }).server( + ({ context, next }) => { + expectTypeOf(context.userId).toEqualTypeOf() + expectTypeOf(context.locale).toEqualTypeOf() + return next({ context: { catalog: 'main' } }) + }, +) +const products = createStartModule('@review/products')(() => ({ + functionMiddleware: [catalog], +})) +interface ProductsRegister extends StartModuleRegister<'@review/products'> { + ssr: true + config: StartModuleConfig +} +const createProductsServerFn = + createServerFn as unknown as CreateServerFn +const auth = createMiddleware().server(({ next }) => { + return next({ context: { userId: 'u1' } }) +}) +const locale = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { locale: 'en' } }) +}) +const value = createMiddleware().server(({ next }) => { + return next({ context: { value: 'valid' } }) +}) + +test('module context is independent of fragment inference and survives into server functions', () => { + createProductsMiddleware().server(({ context, next }) => { + expectTypeOf(context).toEqualTypeOf<{ userId: string }>() + return next() + }) + createProductsServerFn().handler(({ context }) => { + expectTypeOf(context.userId).toEqualTypeOf() + expectTypeOf(context.locale).toEqualTypeOf() + expectTypeOf(context.catalog).toEqualTypeOf() + }) +}) + +test('createStart preserves application and fragment types without runtime requirement entries', () => { + const start = createStart(() => ({ + extends: [products], + requestMiddleware: [auth], + functionMiddleware: [locale], + })) + type Types = Awaited>['~types'] + expectTypeOf().toEqualTypeOf< + readonly [typeof products] + >() + expectTypeOf().toEqualTypeOf< + readonly [typeof auth] + >() + expectTypeOf().toEqualTypeOf< + [typeof locale, typeof catalog] + >() + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('an application without route modules retains its middleware inference', () => { + const start = createStart(() => ({ requestMiddleware: [auth] })) + type Types = Awaited>['~types'] + expectTypeOf().toEqualTypeOf< + readonly [typeof auth] + >() +}) + +test('request and function requirements are checked independently against host providers', () => { + const missingRequest = createStart(() => ({ + extends: [products], + functionMiddleware: [locale], + })) + const missingFunction = createStart(() => ({ + extends: [products], + requestMiddleware: [auth], + })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() + const onlyFunctionProvider = createStart(() => ({ + functionMiddleware: [ + createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 'valid' } }), + ), + ], + })) + expectTypeOf< + ValidateStartModules< + typeof onlyFunctionProvider, + [], + ['@review/function-only'] + > + >().toEqualTypeOf() + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) + +test('requirements-only modules need no runtime fragment and unrelated augmentations stay inactive', () => { + const start = createStart(() => ({ requestMiddleware: [auth] })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() + const missing = createStart(() => ({})) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() + expectTypeOf>().toEqualTypeOf() +}) + +test('all installed contracts remain obligations, including overlapping context keys', () => { + const start = createStart(() => ({ requestMiddleware: [value] })) + expectTypeOf< + ValidateStartModules< + typeof start, + [], + ['@review/reader', '@review/function-only'] + > + >().toEqualTypeOf() + expectTypeOf< + ValidateStartModules< + typeof start, + [], + ['@review/reader', '@review/numeric'] + > + >().not.toEqualTypeOf() +}) + +const createReaderMiddleware = + createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/reader'> + > +const reader = createReaderMiddleware({ type: 'function' }).server( + ({ context, next }) => { + expectTypeOf(context.value).toEqualTypeOf() + return next() + }, +) +const readerModule = createStartModule('@review/reader')(() => ({ + functionMiddleware: [reader], +})) +const overwrite = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 1 } }), +) +const restore = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 'restored', restored: true } }), +) +const overwriteModule = createStartModule('@review/overwrite')(() => ({ + functionMiddleware: [overwrite], +})) +const restoreModule = createStartModule('@review/restore')(() => ({ + functionMiddleware: [restore], +})) + +test('request requirements remain valid at function middleware consumers', () => { + const broken = createStart(() => ({ + requestMiddleware: [value], + extends: [overwriteModule, readerModule], + })) + expectTypeOf< + ValidateStartModules< + typeof broken, + [typeof readerModule], + ['@review/reader'] + > + >().not.toEqualTypeOf() +}) + +test('restoring context before a reader is valid, but restoration after it cannot hide the error', () => { + const before = createStart(() => ({ + requestMiddleware: [value], + extends: [overwriteModule, restoreModule, readerModule], + })) + const after = createStart(() => ({ + requestMiddleware: [value], + extends: [overwriteModule, readerModule, restoreModule], + })) + expectTypeOf< + ValidateStartModules< + typeof before, + [typeof readerModule], + ['@review/reader'] + > + >().toEqualTypeOf() + expectTypeOf< + ValidateStartModules< + typeof after, + [typeof readerModule], + ['@review/reader'] + > + >().not.toEqualTypeOf() +}) + +test('terminal requirement-only consumers see the completed request and function context', () => { + const requestOverwrite = createMiddleware().server(({ next }) => + next({ context: { value: 1 } }), + ) + const module = createStartModule('@review/overwrite-request')(() => ({ + requestMiddleware: [requestOverwrite], + })) + const brokenRequest = createStart(() => ({ + requestMiddleware: [value], + extends: [module], + })) + const brokenFunction = createStart(() => ({ + requestMiddleware: [value], + extends: [overwriteModule], + })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) + +test('a module contribution cannot provide an otherwise missing host requirement', () => { + const provider = createStartModule('@review/provider')(() => ({ + requestMiddleware: [value], + })) + const start = createStart(() => ({ extends: [provider, readerModule] })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) + +test('nested middleware dependencies execute before their consumer', () => { + const nested = createMiddleware({ type: 'function' }) + .middleware([overwrite, reader]) + // @ts-expect-error nested reader observes the overwritten context + .server(({ next }) => next()) + const nestedModule = createStartModule('@review/reader')(() => ({ + functionMiddleware: [nested], + })) + const start = createStart(() => ({ + requestMiddleware: [value], + extends: [nestedModule], + })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) + +test('a deduplicated contribution cannot be assumed to restore overwritten context', () => { + const start = createStart(() => ({ + requestMiddleware: [value], + functionMiddleware: [restore], + extends: [overwriteModule, restoreModule, readerModule], + })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() + const valid = createStart(() => ({ + requestMiddleware: [value], + functionMiddleware: [reader], + extends: [readerModule], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('widened providers cannot establish required context but safe tuple alternatives can', () => { + const providers = [auth] + const uncertain = createStart(() => ({ requestMiddleware: providers })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() + const conditional = + Math.random() > 0.5 ? ([auth] as const) : ([auth, value] as const) + const safe = createStart(() => ({ requestMiddleware: conditional })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('a module fragment only takes module options', () => { + // @ts-expect-error defaultSsr belongs to the application + createStartModule('@review/products')(() => ({ defaultSsr: false })) +}) + +test('many installed fragments preserve context and installation proof', () => { + type Repeat< + T, + TCount extends number, + TAcc extends Array = [], + > = TAcc['length'] extends TCount ? TAcc : Repeat + type Modules = Repeat + const modules = Array.from({ length: 100 }, () => readerModule) as Modules + const start = createStart(() => ({ + requestMiddleware: [value], + extends: modules, + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) diff --git a/packages/start-client-core/src/tests/moduleMiddlewareConsumers.test-d.ts b/packages/start-client-core/src/tests/moduleMiddlewareConsumers.test-d.ts new file mode 100644 index 0000000000..80c02876be --- /dev/null +++ b/packages/start-client-core/src/tests/moduleMiddlewareConsumers.test-d.ts @@ -0,0 +1,111 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createServerFn } from '../createServerFn' +import { createStartModule } from '../createStartModule' +import type { CreateMiddlewareFn } from '../createMiddleware' +import type { CreateServerFn } from '../createServerFn' +import type { + StartModuleConfig, + StartModuleRegister, +} from '../createStartModule' + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/local-consumer': { requestContext: { value: string } } + } +} + +const moduleMiddleware = createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/local-consumer'> +> +const moduleServerFn = createServerFn as unknown as CreateServerFn< + StartModuleRegister<'@review/local-consumer'> +> +const overwrite = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { value: 1 } }) +}) +const restore = createMiddleware({ type: 'function' }).server(({ next }) => { + return next({ context: { value: 'restored' } }) +}) +const reader = moduleMiddleware({ type: 'function' }).server( + ({ context, next }) => { + expectTypeOf(context.value).toEqualTypeOf() + return next() + }, +) + +test('server-function local middleware must preserve context before a module consumer', () => { + moduleServerFn() + .middleware([overwrite, reader]) + .handler( + // @ts-expect-error the reader receives the overwritten value + ({ context }) => context.value, + ) + moduleServerFn() + .middleware([overwrite, reader, restore]) + .handler( + // @ts-expect-error restoring after the reader cannot repair its input + ({ context }) => context.value, + ) +}) + +test('middleware-local dependencies must establish the context of their consumer', () => { + moduleMiddleware({ type: 'function' }) + .middleware([overwrite]) + .server( + // @ts-expect-error this consumer requires the original string context + ({ next }) => next(), + ) + const requestOverwrite = createMiddleware().server(({ next }) => + next({ context: { value: 1 } }), + ) + moduleMiddleware() + .middleware([requestOverwrite]) + .server( + // @ts-expect-error request consumers also need their required context + ({ next }) => next(), + ) +}) + +test('local restoration cannot rely on middleware already executed globally', () => { + const fragment = createStartModule('@review/local-consumer')(() => ({ + functionMiddleware: [restore], + })) + interface Register extends StartModuleRegister<'@review/local-consumer'> { + config: StartModuleConfig + } + const createScopedServerFn = + createServerFn as unknown as CreateServerFn + createScopedServerFn() + .middleware([overwrite, restore, reader]) + .handler( + // @ts-expect-error the previously executed restoration can be deduplicated + ({ context }) => context.value, + ) +}) + +test('intermediate builder steps can restore context before attaching a consumer', () => { + moduleServerFn() + .middleware([overwrite]) + .middleware([restore, reader]) + .handler(({ context }) => { + expectTypeOf(context.value).toEqualTypeOf() + return context.value + }) + moduleMiddleware({ type: 'function' }) + .middleware([overwrite, restore]) + .server(({ context, next }) => { + expectTypeOf(context.value).toEqualTypeOf() + return next() + }) +}) + +test('server-function middleware builders contribute their lists without executing a handler', () => { + const factory = moduleServerFn().middleware([overwrite]) + moduleServerFn() + .middleware([factory, restore, reader]) + .handler(({ context }) => { + expectTypeOf(context.value).toEqualTypeOf() + return context.value + }) +}) diff --git a/packages/start-client-core/src/tests/startModuleConditionalEntry.test-d.ts b/packages/start-client-core/src/tests/startModuleConditionalEntry.test-d.ts new file mode 100644 index 0000000000..00702ade5b --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleConditionalEntry.test-d.ts @@ -0,0 +1,40 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createStart } from '../createStart' +import { createStartModule } from '../createStartModule' +import type { + AssertStartModules, + ValidateStartModules, +} from '../createStartModule' + +const audit = createMiddleware({ type: 'function' }).server(({ next }) => + next(), +) +const auditModule = createStartModule('@review/conditional-audit')(() => ({ + functionMiddleware: [audit], +})) +const unrelatedModule = createStartModule('@review/conditional-unrelated')( + () => ({ functionMiddleware: [audit] }), +) + +test('a union inside a fixed fragment tuple does not prove required installation', () => { + const chosen = Math.random() > 0.5 ? auditModule : unrelatedModule + const start = createStart(() => ({ extends: [chosen] })) + type Result = ValidateStartModules< + typeof start, + readonly [typeof auditModule] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the generated assertion must reject an optionally installed fragment + type InvalidApp = AssertStartModules +}) + +test('a fixed required fragment can accompany an unrelated union entry', () => { + const chosen = Math.random() > 0.5 ? auditModule : unrelatedModule + const start = createStart(() => ({ extends: [auditModule, chosen] })) + expectTypeOf< + AssertStartModules< + ValidateStartModules + > + >().toEqualTypeOf() +}) diff --git a/packages/start-client-core/src/tests/startModuleConditionalOptions.test-d.ts b/packages/start-client-core/src/tests/startModuleConditionalOptions.test-d.ts new file mode 100644 index 0000000000..9a00e0c836 --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleConditionalOptions.test-d.ts @@ -0,0 +1,331 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createStart } from '../createStart' +import { createStartModule } from '../createStartModule' +import type { + AssertStartModules, + ValidateStartModules, +} from '../createStartModule' + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/optional-request-provider': { requestContext: { userId: string } } + '@review/optional-function-provider': { + functionContext: { permission: string } + } + } +} + +const user = createMiddleware().server(({ next }) => + next({ context: { userId: 'user' } }), +) +const permission = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { permission: 'read' } }), +) +const audit = createMiddleware().server(({ next }) => next()) +const functionAudit = createMiddleware({ type: 'function' }).server( + ({ next }) => next(), +) +const required = createStartModule('@review/optional-fragment')(() => ({ + requestMiddleware: [audit], +})) +const firstExtra = createStartModule('@review/optional-first-extra')(() => ({ + requestMiddleware: [audit], +})) +const secondExtra = createStartModule('@review/optional-second-extra')(() => ({ + requestMiddleware: [audit], +})) +const enabled: boolean = Math.random() > 0.5 + +test('an explicitly undefined extends value cannot prove fragment installation', () => { + const conditional = createStart(() => ({ + extends: enabled ? ([required] as const) : undefined, + })) + type Conditional = ValidateStartModules + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the false branch does not install the executable fragment + type _Conditional = AssertStartModules + const installed = createStart(() => ({ extends: [required] })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('an explicitly undefined request middleware value cannot prove required context', () => { + const conditional = createStart(() => ({ + requestMiddleware: enabled ? ([user] as const) : undefined, + })) + type Conditional = ValidateStartModules< + typeof conditional, + [], + ['@review/optional-request-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the false branch has no request context provider + type _Conditional = AssertStartModules + const supplied = createStart(() => ({ requestMiddleware: [user] })) + expectTypeOf< + ValidateStartModules< + typeof supplied, + [], + ['@review/optional-request-provider'] + > + >().toEqualTypeOf() +}) + +test('an explicitly undefined function middleware value cannot prove required context', () => { + const conditional = createStart(() => ({ + functionMiddleware: enabled ? ([permission] as const) : undefined, + })) + type Conditional = ValidateStartModules< + typeof conditional, + [], + ['@review/optional-function-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the false branch has no function context provider + type _Conditional = AssertStartModules + const supplied = createStart(() => ({ functionMiddleware: [permission] })) + expectTypeOf< + ValidateStartModules< + typeof supplied, + [], + ['@review/optional-function-provider'] + > + >().toEqualTypeOf() +}) + +test('a factory branch that omits extends cannot prove fragment installation', () => { + const conditional = createStart(() => + enabled ? { extends: [required] as const } : {}, + ) + type Conditional = ValidateStartModules + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the false branch does not install the executable fragment + type _Conditional = AssertStartModules + const spread = createStart(() => ({ + ...(enabled ? { extends: [required] as const } : {}), + })) + type Spread = ValidateStartModules + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error an optional property is not proof of installation + type _Spread = AssertStartModules +}) + +test('asynchronous factories preserve both required and conditional options', () => { + const conditional = createStart(async () => + enabled ? { extends: [required] as const } : {}, + ) + type Conditional = ValidateStartModules + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error awaiting options does not guarantee their extends property + type _Conditional = AssertStartModules + const optionalProvider = createStart(async () => ({ + ...(enabled ? { requestMiddleware: [user] as const } : {}), + })) + type OptionalProvider = ValidateStartModules< + typeof optionalProvider, + [], + ['@review/optional-request-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error awaiting options does not guarantee their request provider + type _OptionalProvider = AssertStartModules + const fixed = createStart(async () => ({ + extends: [required], + requestMiddleware: [user], + })) + expectTypeOf< + ValidateStartModules< + typeof fixed, + [typeof required], + ['@review/optional-request-provider'] + > + >().toEqualTypeOf() +}) + +test('explicit list generics do not prove options whose return shape was erased', () => { + const conditional = createStart<[], true, [], [], [typeof required]>(() => + enabled ? { extends: [required] } : {}, + ) + type Conditional = ValidateStartModules + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the callback may omit the explicitly typed extends list + type _Conditional = AssertStartModules +}) + +test('fixed required siblings and required fragments present in every branch remain valid', () => { + const fixedSibling = createStart(() => ({ + extends: [required, enabled ? firstExtra : secondExtra], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() + const modules: + | readonly [typeof required, typeof firstExtra] + | readonly [typeof required, typeof secondExtra] = enabled + ? [required, firstExtra] + : [required, secondExtra] + const bothBranches = createStart(() => ({ extends: modules })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('conditionally omitted application request middleware cannot prove required context', () => { + const conditional = createStart(() => + enabled ? { requestMiddleware: [user] as const } : {}, + ) + type Conditional = ValidateStartModules< + typeof conditional, + [], + ['@review/optional-request-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the false branch has no request context provider + type _Conditional = AssertStartModules + const spread = createStart(() => ({ + ...(enabled ? { requestMiddleware: [user] as const } : {}), + })) + type Spread = ValidateStartModules< + typeof spread, + [], + ['@review/optional-request-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the optional requestMiddleware field may be absent + type _Spread = AssertStartModules + const providers: + | readonly [typeof user] + | readonly [typeof user, typeof audit] = enabled ? [user] : [user, audit] + const fixed = createStart(() => ({ requestMiddleware: providers })) + expectTypeOf< + ValidateStartModules< + typeof fixed, + [], + ['@review/optional-request-provider'] + > + >().toEqualTypeOf() +}) + +test('conditionally omitted application function middleware cannot prove required context', () => { + const conditional = createStart(() => + enabled ? { functionMiddleware: [permission] as const } : {}, + ) + type Conditional = ValidateStartModules< + typeof conditional, + [], + ['@review/optional-function-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the false branch has no function context provider + type _Conditional = AssertStartModules + const spread = createStart(() => ({ + ...(enabled ? { functionMiddleware: [permission] as const } : {}), + })) + type Spread = ValidateStartModules< + typeof spread, + [], + ['@review/optional-function-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the optional functionMiddleware field may be absent + type _Spread = AssertStartModules + const providers: + | readonly [typeof permission] + | readonly [typeof permission, typeof functionAudit] = enabled + ? [permission] + : [permission, functionAudit] + const fixed = createStart(() => ({ functionMiddleware: providers })) + expectTypeOf< + ValidateStartModules< + typeof fixed, + [], + ['@review/optional-function-provider'] + > + >().toEqualTypeOf() +}) + +test('alternating request and function providers need a common provable context source', () => { + const requestPermission = createMiddleware().server(({ next }) => + next({ context: { permission: 'read' } }), + ) + const alternating = createStart(() => + enabled + ? { requestMiddleware: [requestPermission] as const } + : { functionMiddleware: [permission] as const }, + ) + type Alternating = ValidateStartModules< + typeof alternating, + [], + ['@review/optional-function-provider'] + > + // Both runtime branches provide permission before a server function runs. + // The contract conservatively checks these two optional lists independently; + // it cannot prove the relationship between their presence in this factory. + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error correlated providers do not establish this global contract + type _Alternating = AssertStartModules + const common = createStart(() => ({ requestMiddleware: [requestPermission] })) + expectTypeOf< + ValidateStartModules< + typeof common, + [], + ['@review/optional-function-provider'] + > + >().toEqualTypeOf() +}) + +test('optional fragment contributions cannot prove a later restoration always executes', () => { + const overwrite = createMiddleware().server(({ next }) => + next({ context: { userId: 1 } }), + ) + const restoreUser = createMiddleware().server(({ next }) => + next({ context: { userId: 'restored', restored: true } }), + ) + const destroy = createStartModule('@review/optional-destroy')(() => ({ + requestMiddleware: [overwrite], + })) + const restore = createStartModule('@review/optional-restore')(() => + enabled ? { requestMiddleware: [restoreUser] as const } : {}, + ) + const start = createStart(() => ({ + requestMiddleware: [user], + extends: [destroy, restore], + })) + type Result = ValidateStartModules< + typeof start, + [typeof destroy, typeof restore], + ['@review/optional-request-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the optional restoration leaves a numeric context on one runtime path + type _Result = AssertStartModules +}) + +test('optional fragment function middleware cannot prove a later restoration always executes', () => { + const overwrite = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { permission: 1 } }), + ) + const restorePermission = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { permission: 'restored', restored: true } }), + ) + const destroy = createStartModule('@review/optional-function-destroy')( + () => ({ functionMiddleware: [overwrite] }), + ) + const restore = createStartModule('@review/optional-function-restore')(() => + enabled ? { functionMiddleware: [restorePermission] as const } : {}, + ) + const start = createStart(() => ({ + functionMiddleware: [permission], + extends: [destroy, restore], + })) + type Result = ValidateStartModules< + typeof start, + [typeof destroy, typeof restore], + ['@review/optional-function-provider'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the optional restoration leaves a numeric context on one runtime path + type _Result = AssertStartModules +}) diff --git a/packages/start-client-core/src/tests/startModuleContextProjectionEdges.test-d.ts b/packages/start-client-core/src/tests/startModuleContextProjectionEdges.test-d.ts new file mode 100644 index 0000000000..82c6354994 --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleContextProjectionEdges.test-d.ts @@ -0,0 +1,363 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware, createStart } from '../index' +import type { AssertStartModules, ValidateStartModules } from '../index' +import type { CreateMiddlewareFn } from '../createMiddleware' +import type { StartModuleRegister } from '../createStartModule' + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/string-property-context': { functionContext: { '0': string } } + '@review/number-property-context': { functionContext: { 0: string } } + '@review/numeric-index-context': { + functionContext: Record<`${number}`, string> + } + '@review/number-index-context': { functionContext: Record } + '@review/optional-property-context': { functionContext: { value?: number } } + '@review/required-property-presence': { + functionContext: { value: string | undefined } + } + '@review/independent-optional-fields': { + functionContext: { value: string; other?: string } + } + '@review/any-field': { requestContext: { user: { id: string } } } + '@review/never-field': { requestContext: { token: string } } + } +} + +// `any` and `never` are assignable to every field: a field so typed cannot +// certify a requirement, at the application and before a local consumer. +const anyField = createMiddleware().server(({ next }) => + next({ context: { user: undefined as any } }), +) +const neverField = createMiddleware().server(({ next }) => + next({ context: { token: null as never } }), +) + +test('an any or never field cannot establish a required field', () => { + const anyStart = createStart(() => ({ requestMiddleware: [anyField] })) + const neverStart = createStart(() => ({ requestMiddleware: [neverField] })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf<"Cannot establish request context field 'user' for route module '@review/any-field' from any or never from application middleware">() + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf<"Cannot establish request context field 'token' for route module '@review/never-field' from any or never from application middleware">() + const typed = createMiddleware().server(({ next }) => + next({ context: { user: { id: 'u1' }, token: 't' } }), + ) + const typedStart = createStart(() => ({ requestMiddleware: [typed] })) + expectTypeOf< + ValidateStartModules< + typeof typedStart, + [], + ['@review/any-field', '@review/never-field'] + > + >().toEqualTypeOf() +}) + +test('local middleware cannot establish a consumer field from any', () => { + const moduleMiddleware = createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/any-field'> + > + moduleMiddleware() + .middleware([anyField]) + .server( + // @ts-expect-error an any field does not establish the required context + ({ next }) => next(), + ) +}) + +// JavaScript has the same own property for these two spellings. Each provider +// must satisfy either spelling of the requirement, without changing its value. +const numericProperty = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { 0: 'credential' } }), +) +const stringProperty = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { '0': 'credential' } }), +) + +test('a numeric property satisfies the same string-keyed requirement', () => { + const start = createStart(() => ({ + functionMiddleware: [numericProperty], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('a string property satisfies the same numeric-keyed requirement', () => { + const start = createStart(() => ({ + functionMiddleware: [stringProperty], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('equivalent property spellings still require compatible values', () => { + const wrongNumeric = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { 0: 42 } }), + ) + const wrongString = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { '0': 42 } }), + ) + const numericStart = createStart(() => ({ + functionMiddleware: [wrongNumeric], + })) + const stringStart = createStart(() => ({ + functionMiddleware: [wrongString], + })) + type WrongNumeric = ValidateStartModules< + typeof numericStart, + [], + ['@review/string-property-context'] + > + type WrongString = ValidateStartModules< + typeof stringStart, + [], + ['@review/number-property-context'] + > + expectTypeOf().not.toEqualTypeOf() + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the existing property contains a number, not a string + type _WrongNumeric = AssertStartModules + // @ts-expect-error the existing property contains a number, not a string + type _WrongString = AssertStartModules +}) + +test('equivalent property spellings cannot hide an incompatible overwrite', () => { + const wrongString = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { '0': 42 } }), + ) + const wrongNumeric = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { 0: 42 } }), + ) + const numericThenString = createStart(() => ({ + functionMiddleware: [numericProperty, wrongString], + })) + const stringThenNumeric = createStart(() => ({ + functionMiddleware: [stringProperty, wrongNumeric], + })) + type NumericThenString = ValidateStartModules< + typeof numericThenString, + [], + ['@review/number-property-context'] + > + type StringThenNumeric = ValidateStartModules< + typeof stringThenNumeric, + [], + ['@review/string-property-context'] + > + expectTypeOf().not.toEqualTypeOf() + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the later string-spelled property overwrites the numeric one + type _NumericThenString = AssertStartModules + // @ts-expect-error the later numeric property overwrites the string-spelled one + type _StringThenNumeric = AssertStartModules +}) + +test('a numeric template index checks finite numeric property values', () => { + const valid = createStart(() => ({ + functionMiddleware: [numericProperty], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() + const wrong = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { '0': 42 } }), + ) + const invalid = createStart(() => ({ functionMiddleware: [wrong] })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) + +test('numeric template indexes cannot hide an incompatible overwrite', () => { + const context: Record<`${number}`, number> = { '0': 42 } + const indexed = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context }), + ) + const start = createStart(() => ({ + functionMiddleware: [stringProperty, indexed], + })) + type Invalid = ValidateStartModules< + typeof start, + [], + ['@review/string-property-context'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the indexed middleware can overwrite '0' with a number + type _Invalid = AssertStartModules +}) + +test('a numeric index cannot hide an incompatible finite-property overwrite', () => { + const context: Record = { 0: 42 } + const indexed = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context }), + ) + const start = createStart(() => ({ + functionMiddleware: [stringProperty, indexed], + })) + type Invalid = ValidateStartModules< + typeof start, + [], + ['@review/string-property-context'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the numeric index can overwrite the string-spelled field + type _Invalid = AssertStartModules +}) + +test('a finite overwrite cannot retain an incompatible earlier index guarantee', () => { + const context: Record = { 0: 'first', 1: 'second' } + const indexed = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context }), + ) + const compatible = createStart(() => ({ + functionMiddleware: [indexed, stringProperty], + })) + expectTypeOf< + ValidateStartModules< + typeof compatible, + [], + ['@review/number-index-context'] + > + >().toEqualTypeOf() + const wrong = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { '0': 42 } }), + ) + const incompatible = createStart(() => ({ + functionMiddleware: [indexed, wrong], + })) + type Invalid = ValidateStartModules< + typeof incompatible, + [], + ['@review/number-index-context'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error one indexed value has been overwritten with a number + type _Invalid = AssertStartModules +}) + +test('a later index signature cannot prove every earlier indexed key was replaced', () => { + const strings: Record = { 0: 'first' } + const otherStrings: Record = { 1: 'second' } + const numbers: Record = { 1: 42 } + const stringIndex = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: strings }), + ) + const numberIndex = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: numbers }), + ) + const otherStringIndex = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: otherStrings }), + ) + const compatible = createStart(() => ({ + functionMiddleware: [stringIndex, otherStringIndex], + })) + expectTypeOf< + ValidateStartModules< + typeof compatible, + [], + ['@review/number-index-context'] + > + >().toEqualTypeOf() + const incompatible = createStart(() => ({ + functionMiddleware: [numberIndex, stringIndex], + })) + type Invalid = ValidateStartModules< + typeof incompatible, + [], + ['@review/number-index-context'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error stringIndex need not replace numeric key 1 + type _Invalid = AssertStartModules +}) + +test('an optional context field cannot prove an earlier incompatible value was replaced', () => { + const oldValue = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 'old' } }), + ) + const context: { value?: number } = {} + const optionalNumber = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context }), + ) + const start = createStart(() => ({ + functionMiddleware: [oldValue, optionalNumber], + })) + type Invalid = ValidateStartModules< + typeof start, + [], + ['@review/optional-property-context'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the optional output may leave the earlier string present + type _Invalid = AssertStartModules + + const requiredNumber = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { value: 42 } }), + ) + const repaired = createStart(() => ({ + functionMiddleware: [oldValue, optionalNumber, requiredNumber], + })) + expectTypeOf< + ValidateStartModules< + typeof repaired, + [], + ['@review/optional-property-context'] + > + >().toEqualTypeOf() +}) + +test('an optional compatible writer retains an already present context field', () => { + const oldValue = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 'old' } }), + ) + const context: { value?: string } = {} + const optionalString = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context }), + ) + const start = createStart(() => ({ + functionMiddleware: [oldValue, optionalString], + })) + expectTypeOf< + ValidateStartModules< + typeof start, + [], + ['@review/required-property-presence'] + > + >().toEqualTypeOf() + + const optionalOnly = createStart(() => ({ + functionMiddleware: [optionalString], + })) + type Missing = ValidateStartModules< + typeof optionalOnly, + [], + ['@review/required-property-presence'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the optional output alone does not establish presence + type _Missing = AssertStartModules +}) + +test('an unrelated optional field cannot weaken an existing required field', () => { + const requiredValue = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { value: 'required' } }), + ) + const context: { other?: string } = {} + const optionalOther = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context }), + ) + const start = createStart(() => ({ + functionMiddleware: [requiredValue, optionalOther], + })) + expectTypeOf< + ValidateStartModules< + typeof start, + [], + ['@review/independent-optional-fields'] + > + >().toEqualTypeOf() +}) diff --git a/packages/start-client-core/src/tests/startModuleContextScaling.test-d.ts b/packages/start-client-core/src/tests/startModuleContextScaling.test-d.ts new file mode 100644 index 0000000000..fd010ac49a --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleContextScaling.test-d.ts @@ -0,0 +1,211 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware, createStart } from '../index' +import type { ValidateStartModules } from '../index' + +type Credentials = + | { kind: 'user'; user: string } + | { kind: 'token'; token: string } + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/scalable-context-walk': { requestContext: { viewer: string } } + '@review/indexed-context-walk': { functionContext: Record } + '@review/correlated-context-walk': { functionContext: Credentials } + } +} + +const viewer = createMiddleware().server(({ next }) => + next({ context: { viewer: 'benchmark' } }), +) +const sharedAudit = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { auditTag: 'host' } }), +) + +// This object differs from sharedAudit at runtime but has the same type. +const independentAudit0 = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { auditTag: 'fragment' } }), +) +const dependency0 = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit0]) + .server(({ next }) => next({ context: { step0: true } })) +const middleware0 = createMiddleware({ type: 'function' }) + .middleware([dependency0, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends 1 & typeof context.auditTag + ? never + : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + }) + +// This object differs from sharedAudit at runtime but has the same type. +const independentAudit1 = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { auditTag: 'fragment' } }), +) +const dependency1 = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit1]) + .server(({ next }) => next({ context: { step1: true } })) +const middleware1 = createMiddleware({ type: 'function' }) + .middleware([dependency1, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends 1 & typeof context.auditTag + ? never + : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + }) + +// This object differs from sharedAudit at runtime but has the same type. +const independentAudit2 = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { auditTag: 'fragment' } }), +) +const dependency2 = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit2]) + .server(({ next }) => next({ context: { step2: true } })) +const middleware2 = createMiddleware({ type: 'function' }) + .middleware([dependency2, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends 1 & typeof context.auditTag + ? never + : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + }) + +// This object differs from sharedAudit at runtime but has the same type. +const independentAudit3 = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { auditTag: 'fragment' } }), +) +const dependency3 = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit3]) + .server(({ next }) => next({ context: { step3: true } })) +const middleware3 = createMiddleware({ type: 'function' }) + .middleware([dependency3, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends 1 & typeof context.auditTag + ? never + : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + }) + +// This object differs from sharedAudit at runtime but has the same type. +const independentAudit4 = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { auditTag: 'fragment' } }), +) +const dependency4 = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit4]) + .server(({ next }) => next({ context: { step4: true } })) +const middleware4 = createMiddleware({ type: 'function' }) + .middleware([dependency4, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends 1 & typeof context.auditTag + ? never + : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + }) + +// This object differs from sharedAudit at runtime but has the same type. +const independentAudit5 = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { auditTag: 'fragment' } }), +) +const dependency5 = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit5]) + .server(({ next }) => next({ context: { step5: true } })) +const middleware5 = createMiddleware({ type: 'function' }) + .middleware([dependency5, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends 1 & typeof context.auditTag + ? never + : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + }) + +// This object differs from sharedAudit at runtime but has the same type. +const independentAudit6 = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { auditTag: 'fragment' } }), +) +const dependency6 = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit6]) + .server(({ next }) => next({ context: { step6: true } })) +const middleware6 = createMiddleware({ type: 'function' }) + .middleware([dependency6, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends 1 & typeof context.auditTag + ? never + : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + }) + +// This object differs from sharedAudit at runtime but has the same type. +const independentAudit7 = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { auditTag: 'fragment' } }), +) +const dependency7 = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit7]) + .server(({ next }) => next({ context: { step7: true } })) +const middleware7 = createMiddleware({ type: 'function' }) + .middleware([dependency7, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends 1 & typeof context.auditTag + ? never + : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + }) + +test('nested middleware chains do not enumerate unrelated context combinations', () => { + const start = createStart(() => ({ + requestMiddleware: [viewer], + functionMiddleware: [ + sharedAudit, + middleware0, + middleware1, + middleware2, + middleware3, + middleware4, + middleware5, + middleware6, + middleware7, + ], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('indexed requirements retain every supplied property', () => { + const incompatible = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { visible: 'value', unexpected: 42 } }), + ) + const start = createStart(() => ({ functionMiddleware: [incompatible] })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) + +test('an index signature does not establish a required named property', () => { + const context: Record = {} + const indexed = createMiddleware().server(({ next }) => next({ context })) + const start = createStart(() => ({ requestMiddleware: [indexed] })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) + +test('required context projections preserve correlated union alternatives', () => { + const credentials: Credentials = + Math.random() > 0.5 + ? { kind: 'user', user: 'user' } + : { kind: 'token', token: 'token' } + const provider = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: credentials }), + ) + const start = createStart(() => ({ functionMiddleware: [provider] })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) diff --git a/packages/start-client-core/src/tests/startModuleGlobalOwner.test-d.ts b/packages/start-client-core/src/tests/startModuleGlobalOwner.test-d.ts new file mode 100644 index 0000000000..22723e09f3 --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleGlobalOwner.test-d.ts @@ -0,0 +1,106 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createStart } from '../createStart' +import type { CreateMiddlewareFn } from '../createMiddleware' +import type { + AssertStartModules, + StartModuleRegister, + ValidateStartModules, +} from '../createStartModule' + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/installed-with-context': { requestContext: { tenantId: string } } + '@review/mixed-use-request': { requestContext: { userId: string } } + '@review/mixed-use-function': { functionContext: { permission: string } } + } +} + +const user = createMiddleware().server(({ next }) => + next({ context: { userId: 'user' } }), +) +const tenant = createMiddleware().server(({ next }) => + next({ context: { tenantId: 'tenant' } }), +) +const permission = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { permission: 'read' } }), +) +const createRequestReader = createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/mixed-use-request'> +> +const requestReader = createRequestReader().server(({ context, next }) => { + expectTypeOf(context.userId).toEqualTypeOf() + return next() +}) +const createFunctionReader = createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/mixed-use-function'> +> +const functionReader = createFunctionReader({ type: 'function' }).server( + ({ context, next }) => { + expectTypeOf(context.permission).toEqualTypeOf() + return next() + }, +) + +test('a global middleware consumer is validated when its package routes are not installed', () => { + const missing = createStart(() => ({ requestMiddleware: [requestReader] })) + type Missing = ValidateStartModules< + typeof missing, + [], + ['@review/unrelated-installed'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error an executed mixed-use package reader needs its request context + type _Missing = AssertStartModules + const valid = createStart(() => ({ + requestMiddleware: [user, requestReader], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() + const unused = createStart(() => ({})) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('a global function consumer is validated independently of installed route package identities', () => { + const missing = createStart(() => ({ functionMiddleware: [functionReader] })) + type Missing = ValidateStartModules< + typeof missing, + [], + ['@review/unrelated-installed'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error an executed mixed-use package reader needs its function context + type _Missing = AssertStartModules + const valid = createStart(() => ({ + functionMiddleware: [permission, functionReader], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('the global walk checks readers before execution even when another installed package already needs validation', () => { + const overwrite = createMiddleware().server(({ next }) => + next({ context: { userId: 42 } }), + ) + const wrong = createStart(() => ({ + requestMiddleware: [tenant, user, overwrite, requestReader], + })) + type Wrong = ValidateStartModules< + typeof wrong, + [], + ['@review/installed-with-context'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the request reader runs after its context is overwritten + type _Wrong = AssertStartModules + const valid = createStart(() => ({ + requestMiddleware: [tenant, user, requestReader], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) diff --git a/packages/start-client-core/src/tests/startModuleImpossibleRequirement.test-d.ts b/packages/start-client-core/src/tests/startModuleImpossibleRequirement.test-d.ts new file mode 100644 index 0000000000..f6d1c5d5eb --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleImpossibleRequirement.test-d.ts @@ -0,0 +1,26 @@ +import { expectTypeOf, test } from 'vitest' +import { createStart } from '../createStart' +import type { + AssertStartModules, + ValidateStartModules, +} from '../createStartModule' + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/impossible-requirement': { + requestContext: { role: 'admin' } & { role: 'guest' } + } + } +} + +test('an intersection-derived impossible requirement cannot be treated as absent', () => { + const start = createStart(() => ({})) + type Result = ValidateStartModules< + typeof start, + [], + ['@review/impossible-requirement'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error no application context can satisfy the impossible requirement + type InvalidApp = AssertStartModules +}) diff --git a/packages/start-client-core/src/tests/startModuleInstallation.test-d.ts b/packages/start-client-core/src/tests/startModuleInstallation.test-d.ts new file mode 100644 index 0000000000..e83cb25cc4 --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleInstallation.test-d.ts @@ -0,0 +1,56 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createStart } from '../createStart' +import { createStartModule } from '../createStartModule' +import type { ValidateStartModules } from '../createStartModule' + +const audit = createMiddleware({ type: 'function' }).server(({ next }) => { + return next() +}) +const unrelated = createMiddleware({ type: 'function' }).server(({ next }) => { + return next() +}) +const auditModule = createStartModule('@review/audit')(() => ({ + functionMiddleware: [audit], +})) + +test('structurally identical middleware does not install a required fragment', () => { + const start = createStart(() => ({ functionMiddleware: [unrelated] })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf<"Route module '@review/audit' is not installed: add 'extends: startModules' to createStart()">() +}) + +test('asynchronous options preserve the actual installed fragments', () => { + const missing = createStart(async () => ({ functionMiddleware: [unrelated] })) + const installed = createStart(async () => ({ extends: [auditModule] })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf<"Route module '@review/audit' is not installed: add 'extends: startModules' to createStart()">() + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('an array element type cannot prove a fragment is installed', () => { + const fragments: Array = [] + const start = createStart(() => ({ + extends: fragments, + functionMiddleware: [unrelated], + })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) + +test('every conditional fragment list must install the required fragment', () => { + const condition: boolean = Math.random() > 0.5 + const fragments = condition ? ([auditModule] as const) : ([] as const) + const start = createStart(() => ({ + extends: fragments, + functionMiddleware: [unrelated], + })) + expectTypeOf< + ValidateStartModules + >().not.toEqualTypeOf() +}) diff --git a/packages/start-client-core/src/tests/startModuleRequirementFreeArray.test-d.ts b/packages/start-client-core/src/tests/startModuleRequirementFreeArray.test-d.ts new file mode 100644 index 0000000000..693bd0b6c6 --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleRequirementFreeArray.test-d.ts @@ -0,0 +1,34 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createServerFn } from '../createServerFn' +import { createStart } from '../createStart' +import type { CreateServerFn } from '../createServerFn' +import type { + AssertStartModules, + StartModuleRegister, + ValidateStartModules, +} from '../createStartModule' + +const ordinary = createMiddleware().server(({ next }) => + next({ context: { ordinary: 'value' } }), +) +const providers = [ordinary] +const createRequirementFreeServerFn = + createServerFn as unknown as CreateServerFn< + StartModuleRegister<'@review/no-requirements'> + > + +test('requirement-free modules do not demand tuple proof for ordinary arrays', () => { + const start = createStart(() => ({ requestMiddleware: providers })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() + expectTypeOf< + AssertStartModules< + ValidateStartModules + > + >().toEqualTypeOf() + createRequirementFreeServerFn() + .middleware(providers) + .handler(() => 'result') +}) diff --git a/packages/start-client-core/src/tests/startModuleUnionRequirement.test-d.ts b/packages/start-client-core/src/tests/startModuleUnionRequirement.test-d.ts new file mode 100644 index 0000000000..52b4ebe675 --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleUnionRequirement.test-d.ts @@ -0,0 +1,178 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createServerFn } from '../createServerFn' +import { createStart } from '../createStart' +import type { CreateMiddlewareFn } from '../createMiddleware' +import type { + AssertStartModules, + StartModuleRegister, + ValidateStartModules, +} from '../createStartModule' + +const userContext = Symbol('user context') +type Authentication = { user: { id: string } } | { apiKey: string } + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/union-request': { requestContext: Authentication } + '@review/union-function': { functionContext: Authentication } + '@review/symbol-request': { requestContext: { [userContext]: string } } + } +} + +const user = createMiddleware().server(({ next }) => + next({ context: { user: { id: 'user' } } }), +) +const apiKey = createMiddleware().server(({ next }) => + next({ context: { apiKey: 'key' } }), +) +const functionUser = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { user: { id: 'user' } } }), +) +const functionApiKey = createMiddleware({ type: 'function' }).server( + ({ next }) => next({ context: { apiKey: 'key' } }), +) + +const createRequestReader = createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/union-request'> +> +const requestReader = createRequestReader().server(({ context, next }) => { + const credential = 'user' in context ? context.user.id : context.apiKey + expectTypeOf(credential).toEqualTypeOf() + return next() +}) +const createFunctionReader = createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/union-function'> +> +const functionReader = createFunctionReader({ type: 'function' }).server( + ({ context, next }) => { + const credential = 'user' in context ? context.user.id : context.apiKey + expectTypeOf(credential).toEqualTypeOf() + return next() + }, +) + +test('a union request requirement needs a host provider for one alternative', () => { + const missing = createStart(() => ({})) + type Missing = ValidateStartModules< + typeof missing, + [], + ['@review/union-request'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error neither authentication alternative is provided + type _Missing = AssertStartModules + const withUser = createStart(() => ({ requestMiddleware: [user] })) + const withApiKey = createStart(() => ({ requestMiddleware: [apiKey] })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('a union function requirement needs a host provider for one alternative', () => { + const missing = createStart(() => ({})) + type Missing = ValidateStartModules< + typeof missing, + [], + ['@review/union-function'] + > + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error neither authentication alternative is provided + type _Missing = AssertStartModules + const withUser = createStart(() => ({ functionMiddleware: [functionUser] })) + const withApiKey = createStart(() => ({ + functionMiddleware: [functionApiKey], + })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() +}) + +test('local middleware consumers check union requirements before running', () => { + createMiddleware() + .middleware([requestReader]) + .server( + // @ts-expect-error the imported request consumer has no authentication provider + ({ next }) => next(), + ) + createMiddleware() + .middleware([user, requestReader]) + .server(({ next }) => next()) + createMiddleware() + .middleware([apiKey, requestReader]) + .server(({ next }) => next()) + createServerFn() + .middleware([functionReader]) + .handler( + // @ts-expect-error the imported function consumer has no authentication provider + () => 'result', + ) + createServerFn() + .middleware([functionUser, functionReader]) + .handler(() => 'result') + createServerFn() + .middleware([functionApiKey, functionReader]) + .handler(() => 'result') +}) + +const symbolProvider = createMiddleware().server(({ next }) => + next({ context: { [userContext]: 'user' } }), +) +const wrongSymbolProvider = createMiddleware().server(({ next }) => + next({ context: { [userContext]: 42 } }), +) +const createSymbolReader = createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/symbol-request'> +> +const symbolReader = createSymbolReader().server(({ context, next }) => { + expectTypeOf(context[userContext]).toEqualTypeOf() + return next() +}) + +test('symbol-keyed required fields cannot disappear from diagnostics and validation', () => { + const missing = createStart(() => ({})) + const wrong = createStart(() => ({ + requestMiddleware: [wrongSymbolProvider], + })) + type Missing = ValidateStartModules< + typeof missing, + [], + ['@review/symbol-request'] + > + type Wrong = ValidateStartModules< + typeof wrong, + [], + ['@review/symbol-request'] + > + expectTypeOf().not.toEqualTypeOf() + expectTypeOf().not.toEqualTypeOf() + // @ts-expect-error the symbol-keyed field is absent + type _Missing = AssertStartModules + // @ts-expect-error the symbol-keyed field has the wrong type + type _Wrong = AssertStartModules + const valid = createStart(() => ({ requestMiddleware: [symbolProvider] })) + expectTypeOf< + ValidateStartModules + >().toEqualTypeOf() + createMiddleware() + .middleware([symbolReader]) + .server( + // @ts-expect-error the symbol-keyed field is absent before this consumer + ({ next }) => next(), + ) + createMiddleware() + .middleware([wrongSymbolProvider, symbolReader]) + .server( + // @ts-expect-error the symbol-keyed field has the wrong type before this consumer + ({ next }) => next(), + ) + createMiddleware() + .middleware([symbolProvider, symbolReader]) + .server(({ next }) => next()) +}) diff --git a/packages/start-client-core/src/tests/startModuleUnscopedConsumer.test-d.ts b/packages/start-client-core/src/tests/startModuleUnscopedConsumer.test-d.ts new file mode 100644 index 0000000000..b27d452ff1 --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleUnscopedConsumer.test-d.ts @@ -0,0 +1,70 @@ +import { expectTypeOf, test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createServerFn } from '../createServerFn' +import type { CreateMiddlewareFn } from '../createMiddleware' +import type { CreateServerFn } from '../createServerFn' +import type { StartModuleRegister } from '../createStartModule' + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/cross-module-reader': { requestContext: { value: string } } + } +} + +const createReaderMiddleware = + createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/cross-module-reader'> + > +const createRequirementFreeServerFn = + createServerFn as unknown as CreateServerFn< + StartModuleRegister<'@review/requirement-free'> + > +const provider = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 'valid' } }), +) +const overwrite = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 1 } }), +) +const reader = createReaderMiddleware({ type: 'function' }).server( + ({ context, next }) => { + expectTypeOf(context.value).toEqualTypeOf() + context.value.toUpperCase() + return next() + }, +) + +test('an unscoped host function checks scoped middleware consumers', () => { + createServerFn() + .middleware([provider, overwrite, reader]) + .handler( + // @ts-expect-error the imported reader consumes a number after the overwrite + () => 'result', + ) +}) + +test('a module without its own requirements checks imported middleware consumers', () => { + createRequirementFreeServerFn() + .middleware([provider, overwrite, reader]) + .handler( + // @ts-expect-error the imported reader consumes a number after the overwrite + () => 'result', + ) +}) + +test('an unscoped middleware checks scoped nested consumers', () => { + createMiddleware({ type: 'function' }) + .middleware([provider, overwrite, reader]) + .server( + // @ts-expect-error the imported reader consumes a number after the overwrite + ({ next }) => next(), + ) +}) + +test('a valid imported middleware remains usable', () => { + createServerFn() + .middleware([provider, reader]) + .handler(() => 'result') + createRequirementFreeServerFn() + .middleware([provider, reader]) + .handler(() => 'result') +}) diff --git a/packages/start-client-core/src/tests/startModuleWidenedGlobalDedupe.test-d.ts b/packages/start-client-core/src/tests/startModuleWidenedGlobalDedupe.test-d.ts new file mode 100644 index 0000000000..f917c5a3d7 --- /dev/null +++ b/packages/start-client-core/src/tests/startModuleWidenedGlobalDedupe.test-d.ts @@ -0,0 +1,43 @@ +import { test } from 'vitest' +import { createMiddleware } from '../createMiddleware' +import { createServerFn } from '../createServerFn' +import { createStart } from '../createStart' +import type { CreateMiddlewareFn } from '../createMiddleware' +import type { CreateServerFn } from '../createServerFn' +import type { StartModuleRegister } from '../createStartModule' + +declare module '../createStartModule' { + interface StartModuleRequirements { + '@review/widened-global-reader': { requestContext: { value: string } } + } +} +const createReaderMiddleware = + createMiddleware as unknown as CreateMiddlewareFn< + StartModuleRegister<'@review/widened-global-reader'> + > +const overwrite = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 1 } }), +) +const restore = createMiddleware({ type: 'function' }).server(({ next }) => + next({ context: { value: 'restored' } }), +) +const reader = createReaderMiddleware({ type: 'function' }).server( + ({ context, next }) => { + context.value.toUpperCase() + return next() + }, +) + +test('unknown global membership cannot prove a local restoration executes', () => { + const globals = [restore] + const start = createStart(() => ({ functionMiddleware: globals })) + type Register = { config: Awaited> } + const createHostServerFn = + createServerFn as unknown as CreateServerFn + createHostServerFn() + .middleware([overwrite, restore, reader]) + .handler( + // @ts-expect-error restore may already execute globally and skip after local overwrite + () => 'result', + ) +}) diff --git a/packages/start-client-core/tests/createStartModule.test.ts b/packages/start-client-core/tests/createStartModule.test.ts new file mode 100644 index 0000000000..0b423c63ac --- /dev/null +++ b/packages/start-client-core/tests/createStartModule.test.ts @@ -0,0 +1,175 @@ +import { expect, test } from 'vitest' +import { createSerializationAdapter } from '@tanstack/router-core' +import { runWithStartContext } from '@tanstack/start-storage-context' +import { createMiddleware } from '../src/createMiddleware' +import { executeMiddleware, flattenMiddlewares } from '../src/createServerFn' +import { createStart } from '../src/createStart' +import { createStartModule } from '../src/createStartModule' + +const decimal = createSerializationAdapter({ + key: 'decimal', + test: (value): value is { decimal: string } => + typeof value === 'object' && value !== null && 'decimal' in value, + toSerializable: (value) => value.decimal, + fromSerializable: (value) => ({ decimal: value }), +}) +const money = createSerializationAdapter({ + key: 'money', + extends: [decimal], + test: (value): value is { money: string } => + typeof value === 'object' && value !== null && 'money' in value, + toSerializable: (value) => value.money, + fromSerializable: (value) => ({ money: value }), +}) + +const auth = createMiddleware().server(({ next }) => + next({ context: { userId: 'u1' } }), +) +const productsLogging = createMiddleware({ type: 'function' }).server( + ({ next }) => next(), +) +const accountAudit = createMiddleware({ type: 'function' }).server(({ next }) => + next(), +) +const appLogging = createMiddleware({ type: 'function' }).server(({ next }) => + next(), +) + +const products = createStartModule('@acme/products')(() => ({ + serializationAdapters: [decimal], + functionMiddleware: [productsLogging], +})) +const account = createStartModule('@acme/account')(() => ({ + serializationAdapters: [money], + functionMiddleware: [accountAudit, productsLogging], +})) + +test('createStartModule binds the module id', () => { + expect(products.id).toBe('@acme/products') + expect(products.getOptions().functionMiddleware).toEqual([productsLogging]) +}) + +test('createStart installs the contributions of route modules after its own', () => { + const options = createStart(() => ({ + extends: [products, account], + requestMiddleware: [auth], + functionMiddleware: [appLogging], + })).getOptions() as any + + expect(flattenMiddlewares(options.requestMiddleware)).toEqual([auth]) + expect(flattenMiddlewares(options.functionMiddleware)).toEqual([ + appLogging, + productsLogging, + accountAudit, + ]) + expect(options.serializationAdapters).toEqual([decimal, money]) +}) + +test('createStart installs a module that several modules include once', () => { + let calls = 0 + const shared = createStartModule('@acme/shared')(() => { + calls++ + return { functionMiddleware: [productsLogging] } + }) + const options = createStart(() => ({ + extends: [shared, products, shared], + })).getOptions() as any + + expect(calls).toBe(1) + expect(flattenMiddlewares(options.functionMiddleware)).toEqual([ + productsLogging, + ]) +}) + +test('the application can place a module contribution itself', () => { + const options = createStart(() => ({ + extends: [products], + functionMiddleware: [productsLogging, appLogging], + })).getOptions() as any + + expect(flattenMiddlewares(options.functionMiddleware)).toEqual([ + productsLogging, + appLogging, + ]) +}) + +test('an installed contribution placed earlier executes once in the middleware pipeline', async () => { + const calls: Array = [] + const audit = createMiddleware({ type: 'function' }).server(({ next }) => { + calls.push('audit') + return next() + }) + const following = createMiddleware({ type: 'function' }).server( + ({ next }) => { + calls.push('following') + return next() + }, + ) + const fragment = createStartModule('@acme/audit')(() => ({ + functionMiddleware: [audit], + })) + const options = await createStart(() => ({ + extends: [fragment], + functionMiddleware: [audit, following], + })).getOptions() + + await runWithStartContext( + { + getRouter() { + throw new Error('This middleware does not use the router') + }, + request: new Request('http://localhost/'), + startOptions: options, + contextAfterGlobalMiddlewares: {}, + executedRequestMiddlewares: new Set(), + handlerType: 'serverFn', + }, + () => + executeMiddleware([], 'server', { + method: 'POST', + data: undefined, + headers: {}, + context: {}, + sendContext: {}, + serverFnMeta: { id: 'audit' }, + signal: new AbortController().signal, + }), + ) + expect(calls).toEqual(['audit', 'following']) +}) + +test('createStart installs route modules from an asynchronous factory', async () => { + const options = await createStart(async () => ({ + extends: [account], + })).getOptions() + + expect(flattenMiddlewares(options.functionMiddleware as any)).toEqual([ + accountAudit, + productsLogging, + ]) + expect(options.serializationAdapters).toEqual([money, decimal]) +}) + +test('repeated getOptions calls do not accumulate module entries', async () => { + // A fragment that creates its entries on every call, like inline middleware. + const inline = createStartModule('@acme/inline')(() => ({ + functionMiddleware: [ + createMiddleware({ type: 'function' }).server(({ next }) => next()), + ], + })) + const options = { extends: [inline], requestMiddleware: [auth] } + const reused = createStart(() => options) + const cached = Promise.resolve({ ...options }) + const cachedInstance = createStart(() => cached) + + for (let call = 0; call < 3; call++) { + const fromObject = reused.getOptions() as any + const fromPromise = (await cachedInstance.getOptions()) as any + for (const result of [fromObject, fromPromise]) { + expect(result.requestMiddleware).toHaveLength(1) + expect(result.functionMiddleware).toHaveLength(1) + } + } + expect(options.requestMiddleware).toEqual([auth]) + expect(options).not.toHaveProperty('functionMiddleware') +}) diff --git a/packages/start-client-core/vite.config.ts b/packages/start-client-core/vite.config.ts index 71e163a1ed..507bbecf4d 100644 --- a/packages/start-client-core/vite.config.ts +++ b/packages/start-client-core/vite.config.ts @@ -23,6 +23,7 @@ export default defineConfig(({ command }) => srcDir: './src', entry: [ './src/index.tsx', + './src/route-module-internal.ts', './src/client/index.ts', './src/client-rpc/index.ts', './src/hydration/constants.ts', diff --git a/packages/start-plugin-core/package.json b/packages/start-plugin-core/package.json index 1945ab7ba6..f4b309fbf7 100644 --- a/packages/start-plugin-core/package.json +++ b/packages/start-plugin-core/package.json @@ -105,7 +105,7 @@ "src" ], "engines": { - "node": ">=22.12.0" + "node": ">=22.22.0" }, "dependencies": { "@babel/code-frame": "7.29.7", diff --git a/packages/start-plugin-core/src/import-protection/adapterUtils.ts b/packages/start-plugin-core/src/import-protection/adapterUtils.ts index 4893c504e4..a7aca0de3a 100644 --- a/packages/start-plugin-core/src/import-protection/adapterUtils.ts +++ b/packages/start-plugin-core/src/import-protection/adapterUtils.ts @@ -17,6 +17,11 @@ export interface ImportProtectionEnvRules { export interface ImportProtectionAdapterConfig { root: string srcDirectory: string + /** + * Package roots of installed route modules: their files are application + * source as much as `srcDirectory`. + */ + routeModuleDirectories: Array compiledRules: { client: ImportProtectionEnvRules server: ImportProtectionEnvRules @@ -55,6 +60,7 @@ export function shouldCheckImportProtectionImporter( ImportProtectionAdapterConfig, | 'root' | 'srcDirectory' + | 'routeModuleDirectories' | 'includeMatchers' | 'excludeMatchers' | 'ignoreImporterMatchers' @@ -84,7 +90,11 @@ export function shouldCheckImportProtectionImporter( } else if (config.includeMatchers.length > 0) { result = !!matchesAny(relativePath, config.includeMatchers) } else if (config.srcDirectory) { - result = isInsideDirectory(normalizedImporter, config.srcDirectory) + result = + isInsideDirectory(normalizedImporter, config.srcDirectory) || + config.routeModuleDirectories.some((directory) => + isInsideDirectory(normalizedImporter, directory), + ) } else { result = true } diff --git a/packages/start-plugin-core/src/prerender.ts b/packages/start-plugin-core/src/prerender.ts index 9510a9ab37..39a45886e4 100644 --- a/packages/start-plugin-core/src/prerender.ts +++ b/packages/start-plugin-core/src/prerender.ts @@ -29,12 +29,17 @@ export async function prerender({ let pages = startConfig.pages.length ? startConfig.pages : [{ path: '/' }] if (startConfig.prerender.autoStaticPathsDiscovery ?? true) { - const pagesMap = new Map(pages.map((item) => [item.path, item])) + // Requests use a trailing slash. Use that same URL identity for merging + // parent/index discoveries and preserving explicit per-page overrides. + const pagesMap = new Map( + pages.map((item) => [withTrailingSlash(item.path), item]), + ) const discoveredPages = globalThis.TSS_PRERENDABLE_PATHS || [] for (const page of discoveredPages) { - if (!pagesMap.has(page.path)) { - pagesMap.set(page.path, page) + const key = withTrailingSlash(page.path) + if (!pagesMap.has(key)) { + pagesMap.set(key, page) } } diff --git a/packages/start-plugin-core/src/rsbuild/import-protection.ts b/packages/start-plugin-core/src/rsbuild/import-protection.ts index f9d46505e3..c3aaf31855 100644 --- a/packages/start-plugin-core/src/rsbuild/import-protection.ts +++ b/packages/start-plugin-core/src/rsbuild/import-protection.ts @@ -1,6 +1,7 @@ import { writeFileSync } from 'node:fs' import { dirname, extname, resolve as resolvePath } from 'node:path' import { fileURLToPath } from 'node:url' +import { getRouteModuleDirectories } from '../start-router-plugin/route-module-directories' import { getDefaultImportProtectionRules, @@ -100,7 +101,15 @@ type ImportProtectionRsbuildPluginAPI = { processAssets: RsbuildPluginAPI['processAssets'] } type ImportProtectionGetConfigFn = () => { - startConfig: Pick['startConfig'], 'importProtection'> + startConfig: Pick< + ReturnType['startConfig'], + 'importProtection' + > & { + router?: Pick< + ReturnType['startConfig']['router'], + 'routeModules' + > + } resolvedStartConfig: Pick< ReturnType['resolvedStartConfig'], 'root' | 'srcDirectory' @@ -207,6 +216,8 @@ export interface PluginConfig { root: string command: 'build' | 'serve' srcDirectory: string + /** Package roots of installed route modules (application source too). */ + routeModuleDirectories: Array framework: CompileStartFrameworkOptions effectiveBehavior: ImportProtectionBehavior mockAccess: 'error' | 'warn' | 'off' @@ -1348,6 +1359,7 @@ export function registerImportProtection( root: '', command: api.context.action === 'dev' ? 'serve' : 'build', srcDirectory: '', + routeModuleDirectories: [], framework: opts.framework, effectiveBehavior: 'error', mockAccess: 'error', @@ -1389,6 +1401,10 @@ export function registerImportProtection( config.root = resolvedStartConfig.root config.srcDirectory = resolvedStartConfig.srcDirectory + config.routeModuleDirectories = getRouteModuleDirectories( + resolvedStartConfig.root, + startConfig.router?.routeModules, + ) shared.root = resolvedStartConfig.root const userOpts: ImportProtectionOptions | undefined = diff --git a/packages/start-plugin-core/src/rsbuild/plugin.ts b/packages/start-plugin-core/src/rsbuild/plugin.ts index c4660728b4..3353ffe8c9 100644 --- a/packages/start-plugin-core/src/rsbuild/plugin.ts +++ b/packages/start-plugin-core/src/rsbuild/plugin.ts @@ -89,14 +89,36 @@ export function tanStackStartRsbuild( // RSC plugin instances — created lazily when rspack namespace is available let rscPlugins: RscPluginPair | undefined - // Reference to the dev server for RSC HMR socket writes + // Shared dev server owner for topology reloads and RSC HMR socket writes. let devServerRef: Pick | null = null + let pendingRouteTreeReload = false const serverFnsById: Record = {} let updateServerFnResolver: (() => void) | undefined return { name: 'tanstack-start-rsbuild', setup(api: RsbuildPluginAPI) { + if (api.context.action === 'dev') { + api.onBeforeStartDevServer(({ server }) => { + devServerRef = server + }) + api.onAfterDevCompile(({ isFirstCompile, stats }) => { + if (!pendingRouteTreeReload || stats.hasErrors()) { + return + } + // Wait for all environments to publish their new assets. Route HMR + // preserves the live router, so topology changes need a fresh tree. + pendingRouteTreeReload = false + if (!isFirstCompile) { + devServerRef?.sockWrite('full-reload') + } + }) + api.onCloseDevServer(() => { + devServerRef = null + pendingRouteTreeReload = false + }) + } + const startCompilerEnvironments = [ { name: RSBUILD_ENVIRONMENT_NAMES.client, type: 'client' as const }, { name: RSBUILD_ENVIRONMENT_NAMES.server, type: 'server' as const }, @@ -440,6 +462,12 @@ export function tanStackStartRsbuild( getConfig, corePluginOpts, startPluginOpts, + onClientTreeInvalidated: + api.context.action === 'dev' + ? () => { + pendingRouteTreeReload = true + } + : undefined, }) // --------------------------------------------------------------- @@ -644,13 +672,6 @@ export function tanStackStartRsbuild( enableSwcReactServerComponents(config, 'all') } }) - - // Capture dev server reference for RSC HMR socket writes - if (api.context.action === 'dev') { - api.onBeforeStartDevServer(({ server }) => { - devServerRef = server - }) - } } // --------------------------------------------------------------- diff --git a/packages/start-plugin-core/src/rsbuild/start-compiler-host.ts b/packages/start-plugin-core/src/rsbuild/start-compiler-host.ts index 3cd1725fa0..77ac8e3c25 100644 --- a/packages/start-plugin-core/src/rsbuild/start-compiler-host.ts +++ b/packages/start-plugin-core/src/rsbuild/start-compiler-host.ts @@ -41,6 +41,7 @@ type WarnableRsbuildTransformContext = RsbuildTransformContext & { emitWarning?: (warning: Error) => void } type RsbuildInputFileSystem = NonNullable +type RspackResolver = ReturnType type ServerFnMetadataById = Map type StartCompilerEnvironment = { name: string @@ -141,6 +142,11 @@ export function registerStartCompilerTransforms( // Serialize access to each StartCompiler's mutable per-environment caches. const compilerQueues = new Map>() const inputFileSystems = new Map() + // The compiler follows the `import`s of a module (for example through a + // module that re-exports `createServerFn`). The transform context's + // `resolve` is the loader's base resolver, which applies no dependency + // type, so package exports that only list `import` would not resolve. + const esmResolvers = new Map() const transformContextStorage = new AsyncLocalStorage() const serverFnMetadataByEnvironment = new Map() @@ -344,20 +350,37 @@ export function registerStartCompilerTransforms( ? importer.replace(/[/\\][^/\\]*$/, '') : getRoot() + const resolver = esmResolvers.get(env.name) + if (!resolver) { + throw new Error( + `could not resolve ${source}: missing rspack resolver for ${env.name}`, + ) + } + return await new Promise((resolve, reject) => { - activeCtx.resolve(context, source, (error, resolved) => { - if (error) { - reject(error) - return - } + resolver.resolve( + {}, + context, + source, + { + fileDependencies: { + add: (file: string) => activeCtx.addDependency(file), + }, + }, + (error, resolved) => { + if (error) { + reject(error) + return + } - if (!resolved) { - resolve(null) - return - } + if (!resolved) { + resolve(null) + return + } - resolve(cleanId(resolved)) - }) + resolve(cleanId(resolved)) + }, + ) }) }, }) @@ -411,10 +434,16 @@ export function registerStartCompilerTransforms( if (compiler.inputFileSystem) { inputFileSystems.set(utils.environment.name, compiler.inputFileSystem) } - compiler.hooks.compilation.tap( 'TanStackStartCompilerMetadataLoaderContext', (compilation) => { + // Rspack applies dependency conditions before compilation. Creating + // this resolver in apply would cache the unexpanded conditions. + esmResolvers.set( + utils.environment.name, + compiler.resolverFactory.get('normal', { dependencyType: 'esm' }), + ) + utils.rspack.NormalModule.getCompilationHooks( compilation, ).loader.tap( diff --git a/packages/start-plugin-core/src/rsbuild/start-router-plugin.ts b/packages/start-plugin-core/src/rsbuild/start-router-plugin.ts index 7c3106be28..ba2fcfa5cc 100644 --- a/packages/start-plugin-core/src/rsbuild/start-router-plugin.ts +++ b/packages/start-plugin-core/src/rsbuild/start-router-plugin.ts @@ -1,9 +1,12 @@ +import path from 'pathe' import { createRouterPluginContext } from '@tanstack/router-plugin/context' import { TanStackRouterCodeSplitterRspack, TanStackRouterGeneratorRspack, } from '@tanstack/router-plugin/rspack' import { startGeneratorConfig } from '../start-router-plugin/generator-config' +import { createClientRouteTree } from '../start-router-plugin/client-route-tree' +import { cleanId } from '../start-compiler/utils' import { RSBUILD_ENVIRONMENT_NAMES } from './planning' import type { RsbuildPluginAPI } from '@rsbuild/core' import type { GetConfigFn, TanStackStartCoreOptions } from '../types' @@ -23,9 +26,31 @@ export function registerRouterPlugins( getConfig: GetConfigFn corePluginOpts: TanStackStartCoreOptions startPluginOpts: TanStackStartRsbuildInputConfig + onClientTreeInvalidated?: () => void }, ): void { const routerPluginContext = createRouterPluginContext() + const clientTree = createClientRouteTree(opts.onClientTreeInvalidated) + let generatedRouteTreePath: string | undefined + + api.transform( + { + test: (id: string) => + path.normalize(cleanId(id)) === + (generatedRouteTreePath ??= path.resolve( + opts.getConfig().startConfig.router.generatedRouteTree, + )), + environments: [RSBUILD_ENVIRONMENT_NAMES.client], + order: 'pre', + }, + async ({ addDependency }) => { + const result = await clientTree.build() + for (const file of result.dependencies) { + addDependency(file) + } + return result.code + }, + ) api.modifyRspackConfig((config, utils) => { const envName = utils.environment.name @@ -39,10 +64,26 @@ export function registerRouterPlugins( getConfig: opts.getConfig, corePluginOpts: opts.corePluginOpts, prerender: opts.startPluginOpts.prerender?.enabled === true, + clientRouteTree: clientTree.generatorPlugin, }), routerPluginContext, ) utils.appendPlugins(generatorPlugin) + utils.appendPlugins( + new utils.rspack.NormalModuleReplacementPlugin(/./, (data) => { + // afterResolve provides the physical resource; beforeResolve only has + // the request. Leave package/alias resolution to Rspack itself. + if (!data.createData || !clientTree.hasModuleTrees()) { + return + } + const clientId = clientTree.getModuleClientTree( + data.createData.resource, + ) + if (clientId) { + data.createData.resource = clientId + } + }), + ) } if ( diff --git a/packages/start-plugin-core/src/start-router-plugin/client-route-tree.ts b/packages/start-plugin-core/src/start-router-plugin/client-route-tree.ts new file mode 100644 index 0000000000..0401e2d188 --- /dev/null +++ b/packages/start-plugin-core/src/start-router-plugin/client-route-tree.ts @@ -0,0 +1,102 @@ +import { existsSync, readFileSync } from 'node:fs' +import { + isServerOnlyNode, + pruneServerOnlySubtrees, +} from '@tanstack/router-generator' +import { normalize } from 'pathe' +import type { Generator, GeneratorPlugin } from '@tanstack/router-generator' + +/** Shared client-tree generation and provider views for both bundlers. */ +export function createClientRouteTree(invalidate: () => void = () => {}) { + let generator: Generator | undefined + let moduleTrees = new Map() + let clientShape: string | undefined + + const generatorPlugin: GeneratorPlugin = { + name: 'start-client-tree-plugin', + init({ generator: instance }) { + generator = instance + }, + afterTransform({ node, prevNode }) { + if (isServerOnlyNode(node) !== isServerOnlyNode(prevNode)) { + invalidate() + } + }, + onRouteTreeChanged({ rootRouteNode, acc }) { + moduleTrees = new Map( + generator! + .getRouteModuleClientTrees() + .map(({ filePath, clientFilePath }) => [ + normalize(filePath), + clientFilePath, + ]), + ) + // Reload only when the client keeps a different set of routes: its own + // or a provider's, whose pruned tree bundlers may not watch. Other route + // changes reach the client through HMR. + const nextShape = JSON.stringify([ + pruneServerOnlySubtrees({ rootRouteNode, acc }).routeNodes.map( + (node) => node.variableName, + ), + [...moduleTrees].map(([filePath, clientFilePath]) => [ + filePath, + clientFilePath, + existsSync(clientFilePath) + ? readFileSync(clientFilePath, 'utf8') + : null, + ]), + ]) + if (clientShape !== undefined && clientShape !== nextShape) { + invalidate() + } + clientShape = nextShape + }, + } + + return { + generatorPlugin, + /** Whether any mounted module has a client view to resolve imports to. */ + hasModuleTrees() { + return moduleTrees.size > 0 + }, + getModuleClientTree(id: string) { + // The suffix belongs to the bundler's module identity. Only the physical + // filename participates in matching the provider's generated tree. + const suffixAt = id.search(/[?#]/) + const filePath = suffixAt === -1 ? id : id.slice(0, suffixAt) + const clientFilePath = moduleTrees.get(normalize(filePath)) + return clientFilePath === undefined + ? undefined + : `${clientFilePath}${suffixAt === -1 ? '' : id.slice(suffixAt)}` + }, + async build() { + if (!generator) { + throw new Error('Generator instance not initialized') + } + const crawlingResult = await generator.getCrawlingResult() + if (!crawlingResult) { + throw new Error('Crawling result not available') + } + const result = generator.buildRouteTree({ + ...crawlingResult, + acc: { + ...crawlingResult.acc, + ...pruneServerOnlySubtrees(crawlingResult), + }, + config: { + disableTypes: true, + enableRouteTreeFormatting: false, + routeTreeFileHeader: [], + routeTreeFileFooter: [], + }, + }) + return { + code: result.routeTreeContent, + dependencies: [ + ...generator.getRoutesByFileMap().keys(), + ...generator.getRouteModuleWatchFiles(), + ], + } + }, + } +} diff --git a/packages/start-plugin-core/src/start-router-plugin/constants.ts b/packages/start-plugin-core/src/start-router-plugin/constants.ts deleted file mode 100644 index 645c550aac..0000000000 --- a/packages/start-plugin-core/src/start-router-plugin/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const SERVER_PROP = 'server' diff --git a/packages/start-plugin-core/src/start-router-plugin/generator-config.ts b/packages/start-plugin-core/src/start-router-plugin/generator-config.ts index 3d3e5ea086..370c739ce5 100644 --- a/packages/start-plugin-core/src/start-router-plugin/generator-config.ts +++ b/packages/start-plugin-core/src/start-router-plugin/generator-config.ts @@ -12,7 +12,7 @@ import type { GetConfigFn, TanStackStartCoreOptions } from '../types' * them, the framework's target, Start's route tree footer (the router and * Start config types, then the app's own lines; computed at every print, as * a router app's function-form `routeTreeFileFooter` is), and the generator - * plugins: the client route tree (Vite), the routes manifest, prerendering + * plugins: the client route tree, the routes manifest, prerendering * when enabled, and the app's own (#7768). */ export function startGeneratorConfig(opts: { diff --git a/packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts b/packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts index b614ae4afa..4030023839 100644 --- a/packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts +++ b/packages/start-plugin-core/src/start-router-plugin/generator-plugins/prerender-routes-plugin.ts @@ -1,38 +1,20 @@ -import { inferFullPath } from '@tanstack/router-generator' -import type { GeneratorPlugin, RouteNode } from '@tanstack/router-generator' +import type { Generator, GeneratorPlugin } from '@tanstack/router-generator' /** * this plugin gets the prerenderable paths and stores it on globalThis * so that it can be accessed later (e.g. from a vite plugin) */ export function prerenderRoutesPlugin(): GeneratorPlugin { + let generator: Generator return { name: 'prerender-routes-plugin', - onRouteTreeChanged: ({ routeNodes }) => { - globalThis.TSS_PRERENDABLE_PATHS = getPrerenderablePaths(routeNodes) + init({ generator: instance }) { + generator = instance + }, + onRouteTreeChanged: () => { + globalThis.TSS_PRERENDABLE_PATHS = [ + ...new Set(['/', ...generator.getPrerenderableRoutePaths()]), + ].map((path) => ({ path })) }, } } - -function getPrerenderablePaths( - routeNodes: Array, -): Array<{ path: string }> { - const paths = new Set(['/']) - - for (const route of routeNodes) { - if (!route.routePath) continue - // filter routes that are layout - if (route.isNonPath === true) continue - - // filter dynamic routes - // if routePath contains $ it is dynamic - if (route.routePath.includes('$')) continue - - // filter routes that do not have a component, i.e api routes - if (!route.createFileRouteProps?.has('component')) continue - - paths.add(inferFullPath(route)) - } - - return Array.from(paths).map((path) => ({ path })) -} diff --git a/packages/start-plugin-core/src/start-router-plugin/generator-plugins/routes-manifest-plugin.ts b/packages/start-plugin-core/src/start-router-plugin/generator-plugins/routes-manifest-plugin.ts index 34cb7aded1..fa75bdb6f6 100644 --- a/packages/start-plugin-core/src/start-router-plugin/generator-plugins/routes-manifest-plugin.ts +++ b/packages/start-plugin-core/src/start-router-plugin/generator-plugins/routes-manifest-plugin.ts @@ -1,42 +1,81 @@ import { rootRouteId } from '@tanstack/router-core' -import type { GeneratorPlugin } from '@tanstack/router-generator' +import type { + Generator, + GeneratorPlugin, + RouteNode, +} from '@tanstack/router-generator' + +type RoutesManifest = Record< + string, + { + filePath: string + children?: Array + } +> + +/** + * The route id of a child in the route tree: mounted module roots are + * `:`, or `#:` for one of several installations. + */ +function childRouteId(node: RouteNode) { + return node._routeModuleMount + ? `${node._routeModuleMount.installation}:` + : node.routePath +} /** * this plugin builds the routes manifest and stores it on globalThis * so that it can be accessed later (e.g. from a vite plugin) */ export function routesManifestPlugin(): GeneratorPlugin { + let generator: Generator | undefined return { name: 'routes-manifest-plugin', + init: ({ generator: instance }) => { + generator = instance + }, onRouteTreeChanged: ({ routeTree, rootRouteNode, routeNodes }) => { - const allChildren = routeTree.map((d) => d.routePath) - const routes: Record< - string, - { - filePath: string - children: Array - } - > = { + const allChildren = routeTree.map(childRouteId) + const routes: RoutesManifest = { [rootRouteId]: { filePath: rootRouteNode.fullPath, - children: allChildren, + children: allChildren as Array, }, ...Object.fromEntries( - routeNodes.map((d) => { - const filePathId = d.routePath + routeNodes + .filter((d) => !d._routeModuleMount) + .map((d) => { + const filePathId = d.routePath - return [ - filePathId, - { - filePath: d.fullPath, - children: d.children?.map((childRoute) => childRoute.routePath), - }, - ] - }), + return [ + filePathId, + { + filePath: d.fullPath, + children: d.children?.map( + (childRoute) => childRouteId(childRoute) as string, + ), + }, + ] + }), ), } + // Routes of mounted route modules, with their qualified ids. + for (const route of generator?.getMountedRouteModuleRoutes() ?? []) { + if (route.filePath) { + const entry = (routes[route.id] ??= { filePath: route.filePath }) + entry.filePath = route.filePath + } + const parent = routes[route.parent] + if (parent) { + const children = (parent.children ??= []) + if (!children.includes(route.id)) { + children.push(route.id) + } + } + } + globalThis.TSS_ROUTES_MANIFEST = routes }, } diff --git a/packages/start-plugin-core/src/start-router-plugin/route-module-directories.ts b/packages/start-plugin-core/src/start-router-plugin/route-module-directories.ts new file mode 100644 index 0000000000..244ffc3ab2 --- /dev/null +++ b/packages/start-plugin-core/src/start-router-plugin/route-module-directories.ts @@ -0,0 +1,25 @@ +import { + getInstalledRouteModuleDirectories, + resolveRouteModuleContext, +} from '@tanstack/router-generator' +import type { RouteModulesOption } from '@tanstack/router-generator' + +/** + * Package roots of the route modules an application installs. Start treats + * their files as application source (import protection, entries). + * + * Composition errors are reported by the route generation; here a broken or + * missing module simply contributes no directory. + */ +export function getRouteModuleDirectories( + root: string, + routeModules: RouteModulesOption | undefined, +): Array { + try { + return getInstalledRouteModuleDirectories( + resolveRouteModuleContext({ root, routeModules }), + ) + } catch { + return [] + } +} diff --git a/packages/start-plugin-core/src/vite/import-protection-plugin/plugin.ts b/packages/start-plugin-core/src/vite/import-protection-plugin/plugin.ts index dcbec56655..9954b0d208 100644 --- a/packages/start-plugin-core/src/vite/import-protection-plugin/plugin.ts +++ b/packages/start-plugin-core/src/vite/import-protection-plugin/plugin.ts @@ -1,6 +1,7 @@ import { writeFileSync } from 'node:fs' import { normalizePath } from 'vite' import { dirname, relative } from 'pathe' +import { getRouteModuleDirectories } from '../../start-router-plugin/route-module-directories' import { escapeRegExp, resolveViteId } from '../../utils' import { SERVER_FN_LOOKUP, VITE_ENVIRONMENT_NAMES } from '../../constants' @@ -280,6 +281,7 @@ export function importProtectionPlugin( command: 'build', bundledDev: false, srcDirectory: '', + routeModuleDirectories: [], framework: opts.framework, effectiveBehavior: 'error', mockAccess: 'error', @@ -1209,7 +1211,9 @@ export function importProtectionPlugin( edgeSurvivalApplied || (pv.info.type === 'file' && !!pv.info.resolved && - isInsideDirectory(pv.info.resolved, config.srcDirectory)) + [config.srcDirectory, ...config.routeModuleDirectories].some( + (directory) => isInsideDirectory(pv.info.resolved!, directory), + )) if (shouldEmit) { emittedAny = @@ -1423,6 +1427,10 @@ export function importProtectionPlugin( const { startConfig, resolvedStartConfig } = opts.getConfig() config.srcDirectory = resolvedStartConfig.srcDirectory + config.routeModuleDirectories = getRouteModuleDirectories( + viteConfig.root, + startConfig.router.routeModules, + ) const userOpts: ImportProtectionOptions | undefined = startConfig.importProtection @@ -1616,7 +1624,12 @@ export function importProtectionPlugin( const routesDirectory = normalizePath( `${config.srcDirectory}/routes`, ) - if (isInsideDirectory(normalizedImporter, routesDirectory)) { + if ( + isInsideDirectory(normalizedImporter, routesDirectory) || + config.routeModuleDirectories.some((directory) => + isInsideDirectory(normalizedImporter, directory), + ) + ) { env.graph.addEntry(normalizedImporter) } } diff --git a/packages/start-plugin-core/src/vite/import-protection-plugin/types.ts b/packages/start-plugin-core/src/vite/import-protection-plugin/types.ts index 21691783ea..3b6207a478 100644 --- a/packages/start-plugin-core/src/vite/import-protection-plugin/types.ts +++ b/packages/start-plugin-core/src/vite/import-protection-plugin/types.ts @@ -21,6 +21,8 @@ export interface PluginConfig { command: 'build' | 'serve' bundledDev: boolean srcDirectory: string + /** Package roots of installed route modules (application source too). */ + routeModuleDirectories: Array framework: CompileStartFrameworkOptions effectiveBehavior: ImportProtectionBehavior mockAccess: 'error' | 'warn' | 'off' diff --git a/packages/start-plugin-core/src/vite/start-router-plugin/plugin.ts b/packages/start-plugin-core/src/vite/start-router-plugin/plugin.ts index 8df06af4f5..78ee790f61 100644 --- a/packages/start-plugin-core/src/vite/start-router-plugin/plugin.ts +++ b/packages/start-plugin-core/src/vite/start-router-plugin/plugin.ts @@ -1,3 +1,4 @@ +import { existsSync } from 'node:fs' import { createRouterPluginContext } from '@tanstack/router-plugin/context' import { tanStackRouterCodeSplitter, @@ -7,29 +8,13 @@ import path from 'pathe' import { normalizePath } from 'vite' import { VITE_ENVIRONMENT_NAMES } from '../../constants' import { startGeneratorConfig } from '../../start-router-plugin/generator-config' -import { pruneServerOnlySubtrees } from '../../start-router-plugin/pruneServerOnlySubtrees' -import { SERVER_PROP } from '../../start-router-plugin/constants' +import { createClientRouteTree } from '../../start-router-plugin/client-route-tree' import { escapeRegExp } from '../../utils' import type { GetConfigFn } from '../../types' import type { TanStackStartVitePluginCoreOptions } from '../types' -import type { - Generator, - GeneratorPlugin, - RouteNode, -} from '@tanstack/router-generator' import type { DevEnvironment, Plugin, PluginOption } from 'vite' import type { TanStackStartInputConfig } from '../../schema' -function isServerOnlyNode(node: RouteNode | undefined) { - if (!node?.createFileRouteProps) { - return false - } - return ( - node.createFileRouteProps.has(SERVER_PROP) && - node.createFileRouteProps.size === 1 - ) -} - export function tanStackStartRouter( startPluginOpts: TanStackStartInputConfig, getConfig: GetConfigFn, @@ -57,19 +42,7 @@ export function tanStackStartRouter( clientEnvironment.hot.send({ type: 'full-reload', path: '*' }) } - let generatorInstance: Generator | null = null - - const clientTreeGeneratorPlugin: GeneratorPlugin = { - name: 'start-client-tree-plugin', - init({ generator }) { - generatorInstance = generator - }, - afterTransform({ node, prevNode }) { - if (isServerOnlyNode(node) !== isServerOnlyNode(prevNode)) { - invalidate() - } - }, - } + const clientTree = createClientRouteTree(invalidate) let resolvedGeneratedRouteTreePath: string | null = null const clientTreePlugin: Plugin = { @@ -97,6 +70,26 @@ export function tanStackStartRouter( } }, + async resolveId(source, importer, options) { + // Only relative imports of a mounted module's route tree are redirected + // to its client view; without route modules nothing is resolved twice. + if ( + !clientTree.hasModuleTrees() || + (!source.startsWith('.') && !path.isAbsolute(source)) + ) { + return null + } + const resolved = await this.resolve(source, importer, { + ...options, + skipSelf: true, + }) + if (!resolved) { + return null + } + const clientId = clientTree.getModuleClientTree(resolved.id) + return clientId ? { ...resolved, id: clientId } : null + }, + load: { filter: { // this will be set in the config hook above since it relies on `config` hook being called first @@ -108,31 +101,15 @@ export function tanStackStartRouter( ) { return null } - if (!generatorInstance) { - throw new Error('Generator instance not initialized') + const result = await clientTree.build() + for (const file of result.dependencies) { + // The generator watches missing discovery candidates. Vite also + // resolves load-hook watch files as module dependencies. + if (existsSync(file)) { + this.addWatchFile(file) + } } - const crawlingResult = await generatorInstance.getCrawlingResult() - if (!crawlingResult) { - throw new Error('Crawling result not available') - } - const prunedAcc = pruneServerOnlySubtrees(crawlingResult) - const acc = { - ...crawlingResult.acc, - ...prunedAcc, - } - const buildResult = generatorInstance.buildRouteTree({ - ...crawlingResult, - acc, - config: { - // importRoutesUsingAbsolutePaths: true, - // addExtensions: true, - disableTypes: true, - enableRouteTreeFormatting: false, - routeTreeFileHeader: [], - routeTreeFileFooter: [], - }, - }) - return { code: buildResult.routeTreeContent, map: null } + return { code: result.code, map: null } }, }, } @@ -144,7 +121,7 @@ export function tanStackStartRouter( getConfig, corePluginOpts, prerender: startPluginOpts.prerender?.enabled === true, - clientRouteTree: clientTreeGeneratorPlugin, + clientRouteTree: clientTree.generatorPlugin, }), routerPluginContext, ), diff --git a/packages/start-plugin-core/tests/route-module-build.ts b/packages/start-plugin-core/tests/route-module-build.ts new file mode 100644 index 0000000000..3ff804a54d --- /dev/null +++ b/packages/start-plugin-core/tests/route-module-build.ts @@ -0,0 +1,387 @@ +import { execFileSync } from 'node:child_process' +import { createRequire } from 'node:module' +import { promises as fs, realpathSync } from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import { pathToFileURL } from 'node:url' +import { afterEach, expect, it } from 'vitest' +import { Generator, getConfig } from '@tanstack/router-generator' + +export interface RouteModuleBuildTarget { + framework: 'react' | 'solid' | 'vue' + /** The framework's runtime package, linked into the fixture. */ + frameworkPackage: string + /** The framework's Vite plugins and the options literal they are called with. */ + frameworkPlugins: Array + pluginOptions: string + /** Root of the Start package under test, whose public plugins build the fixture. */ + packageRoot: string +} + +/** + * Builds a Start application that mounts a route module with the public Vite + * and Rsbuild plugins of the Start package under test, then runs its server + * and client output. Each Start package defines these tests for itself. + */ +export function defineRouteModuleBuildTests(target: RouteModuleBuildTarget) { + const { + framework, + frameworkPackage, + frameworkPlugins, + pluginOptions, + packageRoot, + } = target + const routerPackage = `@tanstack/${framework}-router` + const startPackage = `@tanstack/${framework}-start` + let workspace: string | undefined + afterEach(async () => { + if (workspace) { + await fs.rm(workspace, { recursive: true, force: true }) + } + }) + + /** A dependency as the Start package installed it. */ + function installed(name: string) { + return realpathSync(path.join(packageRoot, 'node_modules', name)) + } + + async function link(root: string, name: string, linkTarget: string) { + const destination = path.join(root, 'node_modules', name) + await fs.mkdir(path.dirname(destination), { recursive: true }) + await fs.symlink(linkTarget, destination, 'dir') + } + + async function fixtures() { + workspace = realpathSync( + await fs.mkdtemp(path.join(os.tmpdir(), 'start-module-build-')), + ) + const feature = path.join(workspace, 'feature') + const app = path.join(workspace, 'app') + for (const root of [feature, app]) { + await fs.mkdir(path.join(root, 'src/routes'), { recursive: true }) + await link(root, routerPackage, installed(routerPackage)) + await link(root, startPackage, packageRoot) + await link(root, frameworkPackage, installed(frameworkPackage)) + } + await fs.writeFile( + path.join(feature, 'package.json'), + JSON.stringify({ + name: '@review/feature', + type: 'module', + dependencies: { + [routerPackage]: '*', + [startPackage]: '*', + [frameworkPackage]: '*', + }, + exports: { + './package.json': './package.json', + './route-module': './src/routeModule.gen.ts', + }, + tanstack: { router: { module: {} } }, + }), + ) + await fs.writeFile( + path.join(app, 'package.json'), + JSON.stringify({ + name: '@review/app', + type: 'module', + dependencies: { + '@review/feature': '*', + [routerPackage]: '*', + [startPackage]: '*', + [frameworkPackage]: '*', + }, + }), + ) + await link(app, '@review/feature', feature) + await fs.writeFile( + path.join(feature, 'src/routes/__root.tsx'), + `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({}) +`, + ) + await fs.writeFile( + path.join(feature, 'src/routes/about.tsx'), + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@review/feature:/about')({ component: () => 'module page' }) +`, + ) + await fs.writeFile( + path.join(feature, 'src/routes/api.tsx'), + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@review/feature:/api')({ server: { handlers: { GET: () => new Response('module api') } } }) +`, + ) + await fs.writeFile( + path.join(app, 'src/routes/__root.tsx'), + `import { createRootRoute } from '${routerPackage}' +export const Route = createRootRoute() +`, + ) + await fs.writeFile( + path.join(app, 'src/routes/about.tsx'), + `import { createFileRoute } from '${routerPackage}' +export const Route = createFileRoute('/about')({ component: () => 'app page' }) +`, + ) + await fs.writeFile( + path.join(app, 'src/routes/api.tsx'), + `import { createFileRoute } from '${routerPackage}' +export const Route = createFileRoute('/api')({ server: { handlers: { GET: () => new Response('app api') } } }) +`, + ) + await fs.writeFile( + path.join(app, 'src/router.ts'), + `import { createRouter, createMemoryHistory } from '${routerPackage}' +import { routeTree } from './routeTree.gen' +export function getRouter() { + return createRouter({ routeTree, history: createMemoryHistory() }) +} +`, + ) + for (const [root, moduleId] of [ + [feature, '@review/feature'], + [app, ''], + ] as const) { + const factory = moduleId ? '../routeScope.gen' : routerPackage + for (const [name, routePath, options] of [ + ['index', '/', "component: () => 'index'"], + ['parent', '/parent', "component: () => 'parent'"], + ['parent.index', '/parent/', "component: () => 'parent index'"], + ['parent.child', '/parent/child', "component: () => 'child'"], + ['_layout', '/_layout', "component: () => 'layout'"], + ['_layout.page', '/_layout/page', "component: () => 'pathless child'"], + ['$id', '/$id', "component: () => 'dynamic'"], + [ + 'mixed', + '/mixed', + "component: () => 'mixed', server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + [ + 'branch', + '/branch', + "server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + [ + 'branch.page', + '/branch/page', + "component: () => 'child needs its parent'", + ], + [ + 'branch.api', + '/branch/api', + "server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + [ + 'only', + '/only', + "server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + [ + 'only.child', + '/only/child', + "server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + ]) { + await fs.writeFile( + path.join(root, `src/routes/${name}.tsx`), + `import { createFileRoute } from '${factory}' +export const Route = createFileRoute('${moduleId ? `${moduleId}:` : ''}${routePath}')({ ${options} }) +`, + ) + } + } + const moduleConfig = getConfig( + { + disableLogging: true, + target: framework, + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + tmpDir: path.join(workspace, '.tmp'), + }, + feature, + ) + await new Generator({ root: feature, config: moduleConfig }).run() + return { app } + } + + it.each(['vite', 'rsbuild'] as const)( + '%s prunes application and module endpoints from the client', + async (bundler) => { + const { app } = await fixtures() + const outputRoot = path.join(app, 'dist') + const outDir = path.join(outputRoot, 'client') + await fs.writeFile( + path.join(app, 'src/client.ts'), + `import { getRouter } from './router' +globalThis.__routeModuleBuildRouter = getRouter() +`, + ) + // Use each public Start plugin, including its compiler, environment + // resolution and default server entry. The custom client entry exposes + // the actual browser router without starting hydration in this probe. + const buildScript = path.join(app, 'build.mjs') + if (bundler === 'vite') { + for (const tool of ['vite', ...frameworkPlugins]) { + await link(app, tool, installed(tool)) + } + await fs.writeFile( + buildScript, + `import { createBuilder } from 'vite' +import { tanstackStart } from '${startPackage}/plugin/vite' +${frameworkPlugins.map((plugin, index) => `import frameworkPlugin${index} from '${plugin}'`).join('\n')} + +const builder = await createBuilder({ + configFile: false, + root: process.cwd(), + logLevel: 'warn', + plugins: [ + tanstackStart({ + router: { + routeModules: { includes: [{ module: '@review/feature', at: '/feature' }] }, + tmpDir: ${JSON.stringify(path.join(workspace!, '.tmp'))}, + }, + }), + ${frameworkPlugins.map((_, index) => `frameworkPlugin${index}(${pluginOptions})`).join(',\n ')}, + ], + build: { outDir: ${JSON.stringify(outputRoot)}, minify: false }, + environments: { + client: { build: { rolldownOptions: { output: { entryFileNames: 'assets/[name].js' } } } }, + ssr: { build: { rolldownOptions: { output: { entryFileNames: 'index.js' } } } }, + }, +}) +await builder.buildApp() +`, + ) + } else { + await link(app, '@rsbuild/core', installed('@rsbuild/core')) + await fs.writeFile( + buildScript, + `import { createRsbuild } from '@rsbuild/core' +import { tanstackStart } from '${startPackage}/plugin/rsbuild' + +const rsbuild = await createRsbuild({ + cwd: process.cwd(), + config: { + plugins: [tanstackStart({ + router: { + routeModules: { includes: [{ module: '@review/feature', at: '/feature' }] }, + tmpDir: ${JSON.stringify(path.join(workspace!, '.tmp'))}, + }, + })], + output: { + distPath: { root: ${JSON.stringify(outputRoot)} }, + filename: { js: '[name].js' }, + filenameHash: false, + minify: false, + }, + environments: { ssr: { output: { module: true } } }, + }, +}) +await rsbuild.build() +`, + ) + } + execFileSync(process.execPath, [buildScript], { + cwd: app, + encoding: 'utf8', + maxBuffer: 16 * 1024 * 1024, + }) + + const serverResult = JSON.parse( + execFileSync( + process.execPath, + [ + '--input-type=module', + '-e', + `const { default: server } = await import(${JSON.stringify(pathToFileURL(path.join(outputRoot, 'server/index.js')).href)}); +const paths = ['/api', '/feature/api', '/mixed', '/feature/mixed', '/only/child', '/feature/only/child']; +const responses = await Promise.all(paths.map(async path => { + const response = await server.fetch(new Request('http://localhost' + path)); + return [path, { status: response.status, body: await response.text() }]; +})); +console.log(JSON.stringify(Object.fromEntries(responses))); +`, + ], + { cwd: app, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024 }, + ), + ) + expect(serverResult['/api']).toEqual({ status: 200, body: 'app api' }) + expect(serverResult['/feature/api']).toEqual({ + status: 200, + body: 'module api', + }) + for (const route of [ + '/mixed', + '/feature/mixed', + '/only/child', + '/feature/only/child', + ]) { + expect(serverResult[route]).toEqual({ + status: 200, + body: 'server-only-sentinel', + }) + } + const jsdom = createRequire( + path.join(packageRoot, 'package.json'), + ).resolve('jsdom') + const result = JSON.parse( + execFileSync( + process.execPath, + [ + '--input-type=module', + '-e', + ` + import { JSDOM } from ${JSON.stringify(pathToFileURL(jsdom).href)}; + const dom = new JSDOM('', {url: 'http://localhost/'}); + globalThis.window = dom.window; + globalThis.self = dom.window; + globalThis.document = dom.window.document; + await import(${JSON.stringify(pathToFileURL(path.join(outDir, bundler === 'rsbuild' ? 'assets/js/index.js' : 'assets/index.js')).href)}); + const router = globalThis.__routeModuleBuildRouter; + const summarize = (url) => router.matchRoutes(url).map(match => ({routeId: match.routeId, globalNotFound: match.globalNotFound})); + console.log(JSON.stringify({ + routes: Object.keys(router.routesById), + moduleHasServer: !!router.routesById['@review/feature:/api']?.options.server, + appMatches: summarize('/api'), + moduleMatches: summarize('/feature/api'), + matches: Object.fromEntries(['/about', '/mixed', '/branch/page', '/only', '/only/child', '/feature/about', '/feature/mixed', '/feature/branch/page', '/feature/only', '/feature/only/child'].map(url => [url, summarize(url).at(-1)?.routeId])), + mixedHasServer: !!router.routesById['@review/feature:/mixed']?.options.server, + })); + dom.window.close(); + `, + ], + { encoding: 'utf8' }, + ), + ) + expect(result.appMatches.at(-1)?.routeId).not.toBe('/api') + expect(result.moduleMatches.at(-1)?.routeId).not.toBe( + '@review/feature:/api', + ) + expect(result.matches).toMatchObject({ + '/about': '/about', + '/mixed': '/mixed', + '/branch/page': '/branch/page', + '/feature/about': '@review/feature:/about', + '/feature/mixed': '@review/feature:/mixed', + '/feature/branch/page': '@review/feature:/branch/page', + }) + for (const [url, id] of [ + ['/only', '/only'], + ['/only/child', '/only/child'], + ['/feature/only', '@review/feature:/only'], + ['/feature/only/child', '@review/feature:/only/child'], + ] as const) { + expect(result.matches[url]).not.toBe(id) + } + expect(result.mixedHasServer).toBe(false) + const files = await fs.readdir(outDir, { recursive: true }) + for (const file of files.filter((file) => file.endsWith('.js'))) { + expect( + await fs.readFile(path.join(outDir, file), 'utf8'), + ).not.toContain('server-only-sentinel') + } + }, + 60000, + ) +} diff --git a/packages/start-plugin-core/tests/route-module-start-build.test.ts b/packages/start-plugin-core/tests/route-module-start-build.test.ts new file mode 100644 index 0000000000..be410649bc --- /dev/null +++ b/packages/start-plugin-core/tests/route-module-start-build.test.ts @@ -0,0 +1,535 @@ +import { promises as fs, realpathSync } from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import { afterEach, expect, it } from 'vitest' +import { + Generator, + getConfig, + pruneServerOnlySubtrees, +} from '@tanstack/router-generator' +import { parseStartConfig } from '../src/schema' +import { prerender } from '../src/prerender' +import { prerenderRoutesPlugin } from '../src/start-router-plugin/generator-plugins/prerender-routes-plugin' +import { routesManifestPlugin } from '../src/start-router-plugin/generator-plugins/routes-manifest-plugin' + +type Framework = 'react' | 'solid' | 'vue' +const frameworks = ['react', 'solid', 'vue'] as const +let workspace: string | undefined +afterEach(async () => { + delete globalThis.TSS_PRERENDABLE_PATHS + Reflect.deleteProperty(globalThis, 'TSS_ROUTES_MANIFEST') + if (workspace) { + await fs.rm(workspace, { recursive: true, force: true }) + } +}) + +async function fixtures(framework: Framework) { + const routerPackage = `@tanstack/${framework}-router` + const startPackage = `@tanstack/${framework}-start` + const frameworkPackage = framework === 'solid' ? 'solid-js' : framework + workspace = realpathSync( + await fs.mkdtemp(path.join(os.tmpdir(), 'start-module-build-')), + ) + const feature = path.join(workspace, 'feature') + const app = path.join(workspace, 'app') + const repository = path.resolve(import.meta.dirname, '../../..') + for (const root of [feature, app]) { + await fs.mkdir(path.join(root, 'src/routes'), { recursive: true }) + await fs.mkdir(path.join(root, 'node_modules/@tanstack'), { + recursive: true, + }) + await fs.symlink( + path.join(repository, `packages/${framework}-router`), + path.join(root, 'node_modules', routerPackage), + ) + await fs.symlink( + path.join(repository, `packages/${framework}-start`), + path.join(root, 'node_modules', startPackage), + ) + await fs.symlink( + path.join( + repository, + `packages/${framework}-router/node_modules`, + frameworkPackage, + ), + path.join(root, 'node_modules', frameworkPackage), + ) + } + await fs.writeFile( + path.join(feature, 'package.json'), + JSON.stringify({ + name: '@review/feature', + type: 'module', + dependencies: { + [routerPackage]: '*', + [startPackage]: '*', + [frameworkPackage]: '*', + }, + exports: { + './package.json': './package.json', + './route-module': './src/routeModule.gen.ts', + }, + tanstack: { router: { module: {} } }, + }), + ) + await fs.writeFile( + path.join(app, 'package.json'), + JSON.stringify({ + name: '@review/app', + type: 'module', + dependencies: { + '@review/feature': '*', + [routerPackage]: '*', + [startPackage]: '*', + [frameworkPackage]: '*', + }, + }), + ) + await fs.mkdir(path.join(app, 'node_modules/@review'), { recursive: true }) + await fs.symlink(feature, path.join(app, 'node_modules/@review/feature')) + await fs.writeFile( + path.join(feature, 'src/routes/__root.tsx'), + `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({}) +`, + ) + await fs.writeFile( + path.join(feature, 'src/routes/about.tsx'), + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@review/feature:/about')({ component: () => 'module page' }) +`, + ) + await fs.writeFile( + path.join(feature, 'src/routes/api.tsx'), + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@review/feature:/api')({ server: { handlers: { GET: () => new Response('module api') } } }) +`, + ) + await fs.writeFile( + path.join(app, 'src/routes/__root.tsx'), + `import { createRootRoute } from '${routerPackage}' +export const Route = createRootRoute() +`, + ) + await fs.writeFile( + path.join(app, 'src/routes/about.tsx'), + `import { createFileRoute } from '${routerPackage}' +export const Route = createFileRoute('/about')({ component: () => 'app page' }) +`, + ) + await fs.writeFile( + path.join(app, 'src/routes/api.tsx'), + `import { createFileRoute } from '${routerPackage}' +export const Route = createFileRoute('/api')({ server: { handlers: { GET: () => new Response('app api') } } }) +`, + ) + await fs.writeFile( + path.join(app, 'src/router.ts'), + `import { createRouter, createMemoryHistory } from '${routerPackage}' +import { routeTree } from './routeTree.gen' +export function getRouter() { + return createRouter({ routeTree, history: createMemoryHistory() }) +} +`, + ) + for (const [root, moduleId] of [ + [feature, '@review/feature'], + [app, ''], + ] as const) { + const factory = moduleId ? '../routeScope.gen' : routerPackage + for (const [name, routePath, options] of [ + ['index', '/', "component: () => 'index'"], + ['parent', '/parent', "component: () => 'parent'"], + ['parent.index', '/parent/', "component: () => 'parent index'"], + ['parent.child', '/parent/child', "component: () => 'child'"], + ['_layout', '/_layout', "component: () => 'layout'"], + ['_layout.page', '/_layout/page', "component: () => 'pathless child'"], + ['$id', '/$id', "component: () => 'dynamic'"], + [ + 'mixed', + '/mixed', + "component: () => 'mixed', server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + [ + 'branch', + '/branch', + "server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + [ + 'branch.page', + '/branch/page', + "component: () => 'child needs its parent'", + ], + [ + 'branch.api', + '/branch/api', + "server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + [ + 'only', + '/only', + "server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + [ + 'only.child', + '/only/child', + "server: { handlers: { GET: () => new Response('server-only-sentinel') } }", + ], + ]) { + await fs.writeFile( + path.join(root, `src/routes/${name}.tsx`), + `import { createFileRoute } from '${factory}' +export const Route = createFileRoute('${moduleId ? `${moduleId}:` : ''}${routePath}')({ ${options} }) +`, + ) + } + } + const moduleConfig = getConfig( + { + disableLogging: true, + target: framework, + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + tmpDir: path.join(workspace, '.tmp'), + }, + feature, + ) + const providerGenerator = new Generator({ + root: feature, + config: moduleConfig, + }) + await providerGenerator.run() + return { app, feature, providerGenerator } +} + +it.each(frameworks)( + '%s discovers and renders static mounted module pages without crawling links', + async (framework) => { + const { app } = await fixtures(framework) + const config = getConfig( + { + disableLogging: true, + target: framework, + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + routeModules: { + includes: [{ module: '@review/feature', at: '/feature' }], + }, + tmpDir: path.join(workspace!, '.tmp'), + plugins: [prerenderRoutesPlugin(), routesManifestPlugin()], + }, + app, + ) + await new Generator({ root: app, config }).run() + expect(globalThis.TSS_ROUTES_MANIFEST).toHaveProperty( + '@review/feature:/about', + ) + const startConfig = parseStartConfig( + { + prerender: { enabled: true, crawlLinks: false }, + router: { + routeModules: { + includes: [{ module: '@review/feature', at: '/feature' }], + }, + }, + }, + { framework }, + app, + ) + const requested: Array = [] + await prerender({ + startConfig, + handler: { + getClientOutputDirectory: () => path.join(workspace!, 'html'), + request: async (url) => { + requested.push(url) + return new Response('page', { + headers: { 'content-type': 'text/html' }, + }) + }, + }, + }) + expect(requested.map((pathname) => pathname.replace(/\/$/, ''))).toContain( + '/feature/about', + ) + await expect( + fs.readFile( + path.join(workspace!, 'html/feature/about/index.html'), + 'utf8', + ), + ).resolves.toContain('page') + const paths = requested + .map((pathname) => pathname.replace(/\/$/, '')) + .sort() + expect(paths).toEqual( + [ + '', + '/about', + '/branch/page', + '/feature', + '/feature/about', + '/feature/branch/page', + '/feature/mixed', + '/feature/page', + '/feature/parent', + '/feature/parent/child', + '/mixed', + '/page', + '/parent', + '/parent/child', + ].sort(), + ) + }, +) + +it('refreshes module page eligibility after a provider option edit without a path change', async () => { + const { app, feature, providerGenerator } = await fixtures('react') + const config = getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace!, '.tmp'), + routeModules: { + includes: [{ module: '@review/feature', at: '/feature' }], + }, + plugins: [prerenderRoutesPlugin()], + }, + app, + ) + const consumerGenerator = new Generator({ root: app, config }) + await consumerGenerator.run() + expect(globalThis.TSS_PRERENDABLE_PATHS).toContainEqual({ + path: '/feature/about', + }) + + const routeFile = path.join(feature, 'src/routes/about.tsx') + await fs.writeFile( + routeFile, + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('@review/feature:/about')({ server: { handlers: { GET: () => new Response('endpoint') } } }) +`, + ) + await providerGenerator.run({ type: 'update', path: routeFile }) + await consumerGenerator.run({ + type: 'update', + path: path.join(feature, '.tanstack/route-module.json'), + }) + const requested: Array = [] + await prerender({ + startConfig: parseStartConfig( + { prerender: { enabled: true, crawlLinks: false } }, + { framework: 'react' }, + app, + ), + handler: { + getClientOutputDirectory: () => path.join(workspace!, 'updated-pages'), + request: async (url) => { + requested.push(url) + return new Response('updated', { + headers: { 'content-type': 'text/html' }, + }) + }, + }, + }) + expect(requested).not.toContain('/feature/about/') + expect(requested).toContain('/feature/mixed/') +}) + +it('respects explicit page overrides, filters, basepath and disabled discovery for module pages', async () => { + const { app } = await fixtures('react') + await new Generator({ + root: app, + config: getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace!, '.tmp'), + routeModules: { + includes: [{ module: '@review/feature', at: '/feature' }], + }, + plugins: [prerenderRoutesPlugin()], + }, + app, + ), + }).run() + const requested: Array = [] + const output = path.join(workspace!, 'controlled-pages') + const run = async (autoStaticPathsDiscovery: boolean) => { + requested.length = 0 + await prerender({ + startConfig: parseStartConfig( + { + router: { basepath: '/base' }, + prerender: { + enabled: true, + crawlLinks: false, + autoStaticPathsDiscovery, + filter: (page) => page.path !== '/feature/parent', + }, + pages: [ + { path: '/feature/about/', prerender: { enabled: false } }, + { path: '/feature/mixed', prerender: { outputPath: '/selected' } }, + ], + }, + { framework: 'react' }, + app, + ), + handler: { + getClientOutputDirectory: () => output, + request: async (url) => { + requested.push(url) + return new Response('selected', { + headers: { 'content-type': 'text/html' }, + }) + }, + }, + }) + } + await run(true) + expect(requested).toContain('/base/feature/mixed/') + expect(requested).not.toContain('/base/feature/about/') + expect(requested).not.toContain('/base/feature/parent/') + await expect( + fs.readFile(path.join(output, 'selected/index.html'), 'utf8'), + ).resolves.toContain('selected') + await run(false) + expect(requested).toEqual(['/base/feature/mixed/']) +}) + +it('discovers nested and named installations while excluding dynamic host URLs', async () => { + const { app } = await fixtures('react') + const wrapper = path.join(workspace!, 'wrapper') + await fs.mkdir(path.join(wrapper, 'src/routes'), { recursive: true }) + await fs.symlink( + path.join(app, 'node_modules'), + path.join(wrapper, 'node_modules'), + 'dir', + ) + await fs.symlink( + wrapper, + path.join(app, 'node_modules/@review/wrapper'), + 'dir', + ) + const appPackagePath = path.join(app, 'package.json') + const appPackage = JSON.parse(await fs.readFile(appPackagePath, 'utf8')) + appPackage.dependencies['@review/wrapper'] = '*' + await fs.writeFile(appPackagePath, JSON.stringify(appPackage)) + await fs.writeFile( + path.join(wrapper, 'package.json'), + JSON.stringify({ + name: '@review/wrapper', + type: 'module', + dependencies: { + '@review/feature': '*', + '@tanstack/react-router': '*', + '@tanstack/react-start': '*', + }, + exports: { + './route-module': './src/routeModule.gen.ts', + './package.json': './package.json', + }, + tanstack: { + router: { + module: { includes: [{ module: '@review/feature', at: '/nested' }] }, + }, + }, + }), + ) + await fs.writeFile( + path.join(wrapper, 'src/routes/__root.tsx'), + `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({}) +`, + ) + await new Generator({ + root: wrapper, + config: getConfig( + { disableLogging: true, tmpDir: path.join(workspace!, '.tmp') }, + wrapper, + ), + }).run() + await new Generator({ + root: app, + config: getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace!, '.tmp'), + plugins: [prerenderRoutesPlugin()], + routeModules: { + includes: [{ module: '@review/wrapper', at: '/outer' }], + }, + }, + app, + ), + }).run() + expect(globalThis.TSS_PRERENDABLE_PATHS).toContainEqual({ + path: '/outer/nested/about', + }) + + await fs.writeFile( + path.join(app, 'src/routes/orgs.$orgId.tsx'), + `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/orgs/$orgId')({ component: () => 'organization' }) +`, + ) + await new Generator({ + root: app, + config: getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace!, '.tmp'), + plugins: [prerenderRoutesPlugin()], + routeModules: { + includes: [ + { module: '@review/feature', at: '/first', as: 'first' }, + { module: '@review/feature', at: '/second', as: 'second' }, + { + module: '@review/feature', + parent: '/orgs/$orgId', + at: '/third', + as: 'third', + }, + ], + }, + }, + app, + ), + }).run() + const requested: Array = [] + await prerender({ + startConfig: parseStartConfig( + { prerender: { enabled: true, crawlLinks: false } }, + { framework: 'react' }, + app, + ), + handler: { + getClientOutputDirectory: () => path.join(workspace!, 'installations'), + request: async (url) => { + requested.push(url) + return new Response('installed', { + headers: { 'content-type': 'text/html' }, + }) + }, + }, + }) + expect(requested).toContain('/first/about/') + expect(requested).toContain('/second/about/') + expect(requested.some((url) => url.includes('$'))).toBe(false) + expect(new Set(requested).size).toBe(requested.length) +}) + +it('can rebuild full and pruned trees repeatedly from the same generated provider', async () => { + const { providerGenerator } = await fixtures('react') + const crawl = await providerGenerator.getCrawlingResult() + expect(crawl).toBeDefined() + const original = providerGenerator.buildRouteTree(crawl!).routeTreeContent + const client = () => + providerGenerator.buildRouteTree({ + ...crawl!, + acc: { ...crawl!.acc, ...pruneServerOnlySubtrees(crawl!) }, + config: { disableTypes: true }, + }).routeTreeContent + const first = client() + expect(client()).toBe(first) + expect(providerGenerator.buildRouteTree(crawl!).routeTreeContent).toBe( + original, + ) +}) diff --git a/packages/vue-router/package.json b/packages/vue-router/package.json index 93ae8fdeed..0c050abfbc 100644 --- a/packages/vue-router/package.json +++ b/packages/vue-router/package.json @@ -59,7 +59,13 @@ "default": "./dist/esm/ssr/client.js" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./_internal/route-module": { + "import": { + "types": "./dist/esm/route-module-internal.d.ts", + "default": "./dist/esm/route-module-internal.js" + } + } }, "sideEffects": false, "files": [ diff --git a/packages/vue-router/src/Match.tsx b/packages/vue-router/src/Match.tsx index 0c3ff40f1d..f508ca7a2b 100644 --- a/packages/vue-router/src/Match.tsx +++ b/packages/vue-router/src/Match.tsx @@ -1,3 +1,4 @@ +import { routeModules } from '@tanstack/router-core/_internal/route-module' import * as Vue from 'vue' import { isNotFound, rootRouteId } from '@tanstack/router-core' import { isServer } from '@tanstack/router-core/isServer' @@ -92,7 +93,10 @@ export const Match = Vue.defineComponent({ fallback: (error: any) => { error.routeId ??= routeId - if (error.routeId !== routeId) { + if ( + (routeModules?.resolveRouteId(router, error.routeId, routeId) ?? + error.routeId) !== routeId + ) { throw error } diff --git a/packages/vue-router/src/Matches.tsx b/packages/vue-router/src/Matches.tsx index a22ec82e82..e5343a8964 100644 --- a/packages/vue-router/src/Matches.tsx +++ b/packages/vue-router/src/Matches.tsx @@ -16,15 +16,18 @@ import type { MakeRouteMatchUnion, MaskOptions, MatchRouteOptions, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveRoute, + RouteModuleScope, ToSubOptionsProps, } from '@tanstack/router-core' // Define a type for the error component function type ErrorRouteComponentType = (props: ErrorComponentProps) => Vue.VNode -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface RouteMatchExtensions { meta?: Array links?: Array @@ -135,6 +138,22 @@ export type UseMatchRouteOptions< MaskOptions & MatchRouteOptions +/** + * The signature of `useMatchRoute`, typed against the router of `TDefaultRegister` unless a + * router type is passed explicitly. Route modules export a `useMatchRoute` of + * this type. + */ +export type UseMatchRouteFn = < + TRouter extends AnyRouter = RegisteredRouterOf, +>() => < + const TFrom extends string = string, + const TTo extends string | undefined = undefined, + const TMaskFrom extends string = TFrom, + const TMaskTo extends string = '', +>( + opts: UseMatchRouteOptions, +) => Vue.Ref['types']['allParams']> + export function useMatchRoute() { const router = useRouter() @@ -188,24 +207,14 @@ export type MakeMatchRouteOptions< } // Create a type for the MatchRoute component that includes the generics -export interface MatchRouteComponentType { +export interface MatchRouteComponentType { < - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, TFrom extends string = string, TTo extends string | undefined = undefined, >( props: MakeMatchRouteOptions, ): Vue.VNode - new (): { - $props: { - from?: string - to?: string - fuzzy?: boolean - caseSensitive?: boolean - includeSearch?: boolean - pending?: boolean - } - } } export const MatchRoute = Vue.defineComponent({ @@ -236,6 +245,16 @@ export const MatchRoute = Vue.defineComponent({ type: Boolean, required: false, }, + // Internal route-module scope, set by the `MatchRoute` of a route module: + // a module id, or an object for options that resolve their scope later. + _module: { + type: [String, Object] as Vue.PropType, + required: false, + }, + _nearestRoute: { + type: String, + required: false, + }, }, setup(props, { slots }) { const params = useMatchRoute()(props) @@ -269,6 +288,17 @@ export type UseMatchesResult< TSelected, > = unknown extends TSelected ? Array> : TSelected +/** + * The signature of `useMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useMatches` of this type. + */ +export type UseMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseMatchesBaseOptions, +) => Vue.Ref> + export function useMatches< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, @@ -283,6 +313,17 @@ export function useMatches< }) } +/** + * The signature of `useParentMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useParentMatches` of this type. + */ +export type UseParentMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseMatchesBaseOptions, +) => Vue.Ref> + export function useParentMatches< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, @@ -302,6 +343,17 @@ export function useParentMatches< } as any) } +/** + * The signature of `useChildMatches`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useChildMatches` of this type. + */ +export type UseChildMatchesFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseMatchesBaseOptions, +) => Vue.Ref> + export function useChildMatches< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, diff --git a/packages/vue-router/src/fileRoute.ts b/packages/vue-router/src/fileRoute.ts index 69334b79ee..13f347ee7c 100644 --- a/packages/vue-router/src/fileRoute.ts +++ b/packages/vue-router/src/fileRoute.ts @@ -53,6 +53,81 @@ export function createFileRoute< } } +/** + * The route factory returned by `createFileRoute(path)`. `TDefaultRegister` + * is the scope of the created route: the application's `Register`, or the + * scope register of a route module. + */ +export type FileRouteFactory< + TFilePath extends string, + TParentRoute extends AnyRoute, + TId extends RouteConstraints['TId'], + TPath extends RouteConstraints['TPath'], + TFullPath extends RouteConstraints['TFullPath'], + TDefaultRegister = Register, +> = < + TRegister = TDefaultRegister, + TSearchValidator = undefined, + TParams = ResolveParams, + TRouteContextFn = AnyContext, + TBeforeLoadFn = AnyContext, + TLoaderDeps extends Record = {}, + TLoaderFn = undefined, + TChildren = unknown, + TSSR = unknown, + TMiddlewares = unknown, + THandlers = undefined, +>( + options?: FileBaseRouteOptions< + TRegister, + TParentRoute, + TId, + TPath, + TSearchValidator, + TParams, + TLoaderDeps, + TLoaderFn, + AnyContext, + TRouteContextFn, + TBeforeLoadFn, + AnyContext, + TSSR, + TMiddlewares, + THandlers + > & + UpdatableRouteOptions< + TParentRoute, + TId, + TFullPath, + TParams, + TSearchValidator, + TLoaderFn, + TLoaderDeps, + AnyContext, + TRouteContextFn, + TBeforeLoadFn + >, +) => Route< + TRegister, + TParentRoute, + TPath, + TFullPath, + TFilePath, + TId, + TSearchValidator, + TParams, + AnyContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + TChildren, + unknown, + TSSR, + TMiddlewares, + THandlers +> + /** @deprecated It's no longer recommended to use the `FileRoute` class directly. Instead, use `createFileRoute('/path/to/file')(options)` to create a file route. @@ -74,68 +149,13 @@ export class FileRoute< this.silent = _opts?.silent } - createRoute = < - TRegister = Register, - TSearchValidator = undefined, - TParams = ResolveParams, - TRouteContextFn = AnyContext, - TBeforeLoadFn = AnyContext, - TLoaderDeps extends Record = {}, - TLoaderFn = undefined, - TChildren = unknown, - TSSR = unknown, - TMiddlewares = unknown, - THandlers = undefined, - >( - options?: FileBaseRouteOptions< - TRegister, - TParentRoute, - TId, - TPath, - TSearchValidator, - TParams, - TLoaderDeps, - TLoaderFn, - AnyContext, - TRouteContextFn, - TBeforeLoadFn, - AnyContext, - TSSR, - TMiddlewares, - THandlers - > & - UpdatableRouteOptions< - TParentRoute, - TId, - TFullPath, - TParams, - TSearchValidator, - TLoaderFn, - TLoaderDeps, - AnyContext, - TRouteContextFn, - TBeforeLoadFn - >, - ): Route< - TRegister, - TParentRoute, - TPath, - TFullPath, + createRoute: FileRouteFactory< TFilePath, + TParentRoute, TId, - TSearchValidator, - TParams, - AnyContext, - TRouteContextFn, - TBeforeLoadFn, - TLoaderDeps, - TLoaderFn, - TChildren, - unknown, - TSSR, - TMiddlewares, - THandlers - > => { + TPath, + TFullPath + > = (options) => { if (process.env.NODE_ENV !== 'production') { if (!this.silent) { console.warn( @@ -182,7 +202,7 @@ export function FileRouteLoader< return (loaderFn) => loaderFn as any } -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface LazyRoute { useMatch: UseMatchRoute useRouteContext: UseRouteContextRoute diff --git a/packages/vue-router/src/index.tsx b/packages/vue-router/src/index.tsx index f63a763e25..f6ef9ce137 100644 --- a/packages/vue-router/src/index.tsx +++ b/packages/vue-router/src/index.tsx @@ -180,6 +180,8 @@ export type { ResolvedRedirect, MakeRouteMatch, MakeRouteMatchUnion, + KnownRouteMatchUnion, + ForeignRouteMatch, RouteMatch, AnyRouteMatch, RouteContextFn, @@ -265,9 +267,50 @@ export type { ErrorRouteComponent, NotFoundRouteComponent, } from './route' +// `createFileRoute` returns router-core's `Route`, and `Route` above is this +// package's class: declarations name the type of file routes through this +// export, so they need no import of `@tanstack/router-core`. +export type { Route as RouteCore } from '@tanstack/router-core' export { createRouter, Router } from './router' +export type { FileRouteScope, RouteScope } from './routeModule' +export type { FileRouteFactory } from './fileRoute' +export type { + HostedRouter, + InstallationRoutesById, + MountedRoutesById, + ModuleRootRoute, + ModuleRootRouteOptions, + MountRouteModuleOptions, + RedirectFn, + RegisteredRouterOf, + ScopeRouter, + ScopedRouter, + ScopedRouterView, + ValidateRouteModuleMount, + ValidateRouteModuleMountPath, +} from '@tanstack/router-core' +export type { GetRouteApiFn } from './route' +export type { CreateLinkFn, LinkOptionsFn } from './link' +export type { NavigateComponentFn, UseNavigateFn } from './useNavigate' +export type { + MatchRouteComponentType, + UseChildMatchesFn, + UseMatchRouteFn, + UseMatchesFn, + UseParentMatchesFn, +} from './Matches' +export type { UseRouterFn } from './useRouter' +export type { UseMatchFn } from './useMatch' +export type { UseLoaderDataFn } from './useLoaderData' +export type { UseLoaderDepsFn } from './useLoaderDeps' +export type { UseSearchFn } from './useSearch' +export type { UseParamsFn } from './useParams' +export type { UseRouteContextFn } from './useRouteContext' +export type { UseLocationFn } from './useLocation' +export type { UseRouterStateFn } from './useRouterState' + export { lazyFn, SearchParamError } from '@tanstack/router-core' export { RouterProvider, RouterContextProvider } from './RouterProvider' diff --git a/packages/vue-router/src/link.tsx b/packages/vue-router/src/link.tsx index 34666743e3..eaeb03d1c4 100644 --- a/packages/vue-router/src/link.tsx +++ b/packages/vue-router/src/link.tsx @@ -9,18 +9,22 @@ import { } from '@tanstack/router-core' import { isServer } from '@tanstack/router-core/isServer' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import { useRouter } from './useRouter' -import { linkLocationContext } from './matchContext' +import { linkLocationContext, routeIdContext } from './matchContext' import { useIntersectionObserver } from './utils' - import type { AnyRouter, Constrain, LinkOptions, ParsedLocation, + Register, RegisteredRouter, + RegisteredRouterOf, RoutePaths, + ScopedRouteOptions, } from '@tanstack/router-core' + import type { AnchorHTMLAttributes, ReservedProps } from '@vue/runtime-dom' import type { ValidateLinkOptions, @@ -87,6 +91,16 @@ type AnyLinkPropsOptions = UseLinkPropsOptions & { } type LinkEventOptions = AnyLinkPropsOptions & Partial +export type UseLinkPropsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TFrom extends string = string, + TTo extends string = '', + TMaskFrom extends string = TFrom, + TMaskTo extends string = '', +>( + options: UseLinkPropsOptions, +) => Vue.Ref + export function useLinkProps< TRouter extends AnyRouter = RegisteredRouter, TFrom extends RoutePaths | string = string, @@ -95,20 +109,21 @@ export function useLinkProps< TMaskTo extends string = '', >( options: UseLinkPropsOptions, -): LinkHTMLAttributes { +): Vue.Ref { return useLinkPropsImpl(() => options as AnyLinkPropsOptions) } -function useLinkPropsImpl( +/** @internal Shared by the scoped hook, which supplies live scoped options. */ +export function useLinkPropsImpl( getOptions: () => AnyLinkPropsOptions, -): LinkHTMLAttributes { +): Vue.Ref { const router = useRouter() let renderFetchedHref: string | undefined // Ensure router is defined before proceeding if (!router) { console.warn('useRouter must be used inside a component!') - return {} + return Vue.shallowRef({}) } // During SSR we render exactly once and do not need reactivity. @@ -118,10 +133,17 @@ function useLinkPropsImpl( if (getUrlScheme(`${options.to}`)) { return Vue.shallowRef( getExternalLinkProps(options, router), - ) as unknown as LinkHTMLAttributes + ) as Vue.Ref } - const next = router.buildLocation(options as any) + const next = router.buildLocation( + (options._module === undefined + ? options + : { + ...options, + _nearestRoute: Vue.inject(routeIdContext, undefined), + }) as any, + ) const href = getHref(options, router, next) const isActive = @@ -150,7 +172,7 @@ function useLinkPropsImpl( return Vue.shallowRef( result as LinkHTMLAttributes, - ) as unknown as LinkHTMLAttributes + ) as Vue.Ref } const ref = Vue.ref(null) @@ -172,6 +194,12 @@ function useLinkPropsImpl( // place, so a reactive option value (checked one level deep, not nested) // gets a fresh object per location instead, re-read at each navigation. A // mask holds destination options of its own, so its values are checked too. + // The nearest route resolves module destinations to the installation the + // Link renders under. Only the route-module translation reads it, which + // route modules install before any component sets up. + const routeId = routeModules + ? Vue.inject(routeIdContext, undefined) + : undefined const dest = Vue.computed((prev?: Record) => { const options = getOptions() as Record const dest: Record = {} @@ -187,6 +215,9 @@ function useLinkPropsImpl( } same &&= prev![key] === value } + if (routeModules) { + dest._nearestRoute = routeId + } return same ? prev! : dest }) @@ -424,7 +455,7 @@ function useLinkPropsImpl( }) // Return the computed ref itself - callers should access .value - return computedProps as unknown as LinkHTMLAttributes + return computedProps } // [href, active] of an internal Link. @@ -447,7 +478,7 @@ const NAVIGATION_KEYS = [ 'unsafeRelative', 'from', 'href', -] as const +] function resolveStyleProps(options: AnyLinkPropsOptions, isActive: boolean) { const props = @@ -638,6 +669,17 @@ const LINK_OPTION_KEYS = new Set([ 'additionalProps', ]) +/** + * Called by route-module code: its scopes pass these internal options, which + * decide where a Link navigates (see `scopeLocationOptions` in router-core). + */ +export function addRouteModuleLinkOptions(): void { + if (!LINK_OPTION_KEYS.has('_module')) { + NAVIGATION_KEYS.push('_module', '_fromRoute') + LINK_OPTION_KEYS.add('_module').add('_fromRoute') + } +} + const getPropsSafeToSpread = (options: AnyLinkPropsOptions) => { const propsSafeToSpread: Record = {} for (const key in options) { @@ -811,8 +853,9 @@ export type CreateLinkProps = LinkProps< export type LinkComponent< in out TComp, in out TDefaultFrom extends string = string, + in out TDefaultRegister = Register, > = < - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, const TFrom extends string = TDefaultFrom, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, @@ -823,10 +866,11 @@ export type LinkComponent< export interface LinkComponentRoute< in out TDefaultFrom extends string = string, + in out TDefaultRegister = Register, > { defaultFrom: TDefaultFrom; < - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, const TTo extends string | undefined = undefined, const TMaskTo extends string = '', >( @@ -841,6 +885,14 @@ export interface LinkComponentRoute< ): Vue.VNode } +/** + * The signature of `createLink`, creating links typed against the router of `TDefaultRegister`. + * Route modules export a `createLink` of this type. + */ +export type CreateLinkFn = ( + Comp: Constrain Vue.VNode>, +) => LinkComponent + export function createLink( Comp: Constrain Vue.VNode>, ): LinkComponent { @@ -916,7 +968,7 @@ const LinkImpl = Vue.defineComponent({ (isServer ?? useRouter()?.isServer) ? () => ({ ...props, ...attrs }) : useLinkPropsSnapshot(props, attrs), - ) as LinkHTMLAttributes | Vue.ComputedRef + ) return () => { const Component = props._asChild || 'a' @@ -968,12 +1020,12 @@ export type LinkOptionsFnOptions< ? ValidateLinkOptionsArray : ValidateLinkOptions -export type LinkOptionsFn = < +export type LinkOptionsFn = < const TOptions, - TRouter extends AnyRouter = RegisteredRouter, + TRouter extends AnyRouter = RegisteredRouterOf, >( options: LinkOptionsFnOptions, -) => TOptions +) => ScopedRouteOptions export const linkOptions: LinkOptionsFn<'a'> = (options) => { return options as any diff --git a/packages/vue-router/src/route-module-internal.ts b/packages/vue-router/src/route-module-internal.ts new file mode 100644 index 0000000000..3ac86d6306 --- /dev/null +++ b/packages/vue-router/src/route-module-internal.ts @@ -0,0 +1,6 @@ +// Internal generated/framework wiring; use generated scopes to author modules. +export * from './routeModule' +export { + mountRouteModule, + getRouteModuleId, +} from '@tanstack/router-core/_internal/route-module' diff --git a/packages/vue-router/src/route.ts b/packages/vue-router/src/route.ts index 7c931ecdf9..db36e0e464 100644 --- a/packages/vue-router/src/route.ts +++ b/packages/vue-router/src/route.ts @@ -4,6 +4,7 @@ import { BaseRouteApi, notFound, } from '@tanstack/router-core' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import * as Vue from 'vue' import { Link } from './link' import { useLoaderData } from './useLoaderData' @@ -24,6 +25,7 @@ import type { NotFoundRouteProps, Register, RegisteredRouter, + RegisteredRouterOf, ResolveFullPath, ResolveId, ResolveParams, @@ -57,7 +59,7 @@ export type VueSFC = { render?: Function } -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface UpdatableRouteOptionsExtensions { component?: RouteComponent | VueSFC errorComponent?: false | null | undefined | ErrorRouteComponent | VueSFC @@ -68,18 +70,31 @@ declare module '@tanstack/router-core' { export interface RouteExtensions< in out TId extends string, in out TFullPath extends string, + in out TRegister, > { - useMatch: UseMatchRoute - useRouteContext: UseRouteContextRoute - useSearch: UseSearchRoute - useParams: UseParamsRoute - useLoaderDeps: UseLoaderDepsRoute - useLoaderData: UseLoaderDataRoute - useNavigate: () => UseNavigateResult - Link: LinkComponentRoute + useMatch: UseMatchRoute + useRouteContext: UseRouteContextRoute + useSearch: UseSearchRoute + useParams: UseParamsRoute + useLoaderDeps: UseLoaderDepsRoute + useLoaderData: UseLoaderDataRoute + useNavigate: () => UseNavigateResult + Link: LinkComponentRoute } } +/** + * The signature of `getRouteApi`, typed against the router of `TDefaultRegister` unless a + * router type is passed explicitly. Route modules export a `getRouteApi` of + * this type. + */ +export type GetRouteApiFn = < + const TId, + TRouter extends AnyRouter = RegisteredRouterOf, +>( + id: ConstrainLiteral>, +) => RouteApi + export function getRouteApi< const TId, TRouter extends AnyRouter = RegisteredRouter, @@ -98,53 +113,64 @@ export class RouteApi< super({ id }) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts) => { + useRouteContext: UseRouteContextRoute = (opts) => { return useRouteContext({ ...(opts as any), from: this.id }) } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id, strict: false } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id, strict: false } as any) } useNavigate = (): UseNavigateResult< - RouteTypesById['fullPath'] + RouteTypesById['fullPath'], + { router: TRouter } > => { const router = useRouter() - return useNavigate({ from: router.routesById[this.id as string].fullPath }) + return useNavigate({ + from: router.routesById[this.id as string]?.fullPath, + ...routeModules?.navigationScope(this.id as string), + } as any) as any } notFound = (opts?: NotFoundError) => { return notFound({ routeId: this.id as string, ...opts }) } - Link: LinkComponentRoute['fullPath']> = (( - props, - ctx?: Vue.SetupContext, - ) => { + Link: LinkComponentRoute< + RouteTypesById['fullPath'], + { router: TRouter } + > = ((props, ctx?: Vue.SetupContext) => { const router = useRouter() - const fullPath = router.routesById[this.id as string].fullPath + const fullPath = router.routesById[this.id as string]?.fullPath return Vue.h( Link as any, - { from: fullPath as never, ...(props as any) }, + { + from: fullPath, + ...(routeModules?.navigationScope(this.id as string) as any), + ...(props as any), + }, ctx?.slots, ) - }) as LinkComponentRoute['fullPath']> + }) as LinkComponentRoute< + RouteTypesById['fullPath'], + { router: TRouter } + > } export class Route< @@ -242,41 +268,51 @@ export class Route< super(options) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts?) => { + useRouteContext: UseRouteContextRoute = (opts?) => { return useRouteContext({ ...(opts as any), from: this.id }) } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id } as any) } - useNavigate = (): UseNavigateResult => { - return useNavigate({ from: this.fullPath }) + useNavigate = (): UseNavigateResult => { + return useNavigate({ + from: this.fullPath, + ...routeModules?.navigationScope(this.id), + } as any) as any } - Link: LinkComponentRoute = ((props, ctx?: Vue.SetupContext) => { + Link: LinkComponentRoute = (( + props, + ctx?: Vue.SetupContext, + ) => { return Vue.h( Link as any, - { from: this.fullPath as never, ...(props as any) }, + { + from: this.fullPath, + ...(routeModules?.navigationScope(this.id) as any), + ...(props as any), + }, ctx?.slots, ) - }) as LinkComponentRoute + }) as LinkComponentRoute } export function createRoute< @@ -475,37 +511,40 @@ export class RootRoute< super(options) } - useMatch: UseMatchRoute = (opts) => { + useMatch: UseMatchRoute = (opts) => { return useMatch({ ...opts, from: this.id } as any) as any } - useRouteContext: UseRouteContextRoute = (opts) => { + useRouteContext: UseRouteContextRoute = (opts) => { return useRouteContext({ ...(opts as any), from: this.id }) } - useSearch: UseSearchRoute = (opts) => { + useSearch: UseSearchRoute = (opts) => { return useSearch({ ...opts, from: this.id } as any) } - useParams: UseParamsRoute = (opts) => { + useParams: UseParamsRoute = (opts) => { return useParams({ ...opts, from: this.id } as any) } - useLoaderDeps: UseLoaderDepsRoute = (opts) => { + useLoaderDeps: UseLoaderDepsRoute = (opts) => { return useLoaderDeps({ ...opts, from: this.id } as any) } - useLoaderData: UseLoaderDataRoute = (opts) => { + useLoaderData: UseLoaderDataRoute = (opts) => { return useLoaderData({ ...opts, from: this.id } as any) } - useNavigate = (): UseNavigateResult<'/'> => { - return useNavigate({ from: this.fullPath }) + useNavigate = (): UseNavigateResult<'/', TRegister> => { + return useNavigate({ from: this.fullPath }) as any } - Link: LinkComponentRoute<'/'> = ((props, ctx?: Vue.SetupContext) => { + Link: LinkComponentRoute<'/', TRegister> = (( + props, + ctx?: Vue.SetupContext, + ) => { return Vue.h(Link, { from: this.fullPath as never, ...props }, ctx?.slots) - }) as LinkComponentRoute<'/'> + }) as LinkComponentRoute<'/', TRegister> } export function createRouteMask< diff --git a/packages/vue-router/src/routeModule.ts b/packages/vue-router/src/routeModule.ts new file mode 100644 index 0000000000..afc5647a84 --- /dev/null +++ b/packages/vue-router/src/routeModule.ts @@ -0,0 +1,385 @@ +import * as Vue from 'vue' +import { notFound } from '@tanstack/router-core' +import { + bindRouteScopeIdApi, + bindRouteScopeOptions, + createScopedRedirect, + getScopedRouterView, + installRouteModules, +} from '@tanstack/router-core/_internal/route-module' +import { Route, getRouteApi } from './route' +import { Link, addRouteModuleLinkOptions, useLinkPropsImpl } from './link' +import { Navigate, useNavigate } from './useNavigate' +import { MatchRoute, useMatchRoute } from './Matches' +import { useRouter } from './useRouter' +import { routeIdContext } from './matchContext' +import { useMatch } from './useMatch' +import { useLoaderData } from './useLoaderData' +import { useLoaderDeps } from './useLoaderDeps' +import { useSearch } from './useSearch' +import { useParams } from './useParams' +import { useRouteContext } from './useRouteContext' +import type { UseBlockerFn } from './useBlocker' +import type { + AnyContext, + AnyRoute, + AnyRouter, + ModuleRootRoute, + ModuleRootRouteOptions, + NotFoundError, + RedirectFn, + RouteIds, + ScopedRouterView, +} from '@tanstack/router-core' +import type { FileRouteFactory } from './fileRoute' +import type { GetRouteApiFn } from './route' +import type { + CreateLinkFn, + LinkComponent, + LinkOptionsFn, + UseLinkPropsFn, +} from './link' +import type { NavigateComponentFn, UseNavigateFn } from './useNavigate' +import type { + MatchRouteComponentType, + UseChildMatchesFn, + UseMatchRouteFn, + UseMatchesFn, + UseParentMatchesFn, +} from './Matches' +import type { UseMatchFn } from './useMatch' +import type { UseLoaderDataFn } from './useLoaderData' +import type { UseLoaderDepsFn } from './useLoaderDeps' +import type { UseSearchFn } from './useSearch' +import type { UseParamsFn } from './useParams' +import type { UseRouteContextFn } from './useRouteContext' +import type { UseLocationFn } from './useLocation' +import type { UseRouterStateFn } from './useRouterState' + +// Entries reference the route files, whose types depend on these factories: +// read one property at a time and never constrain or check whole entries. +type FileRouteEntry = + TFileRoutesByPath[TFilePath & keyof TFileRoutesByPath] +type FileRouteParent = + FileRouteEntry extends { + parentRoute: infer TParentRoute extends AnyRoute + } + ? TParentRoute + : never +type FileRouteId = + FileRouteEntry extends { + id: infer TId extends string + } + ? TId + : never +type FileRoutePath = + FileRouteEntry extends { + path: infer TPath extends string + } + ? TPath + : never +type FileRouteFullPath = + FileRouteEntry extends { + fullPath: infer TFullPath extends string + } + ? TFullPath + : never + +/** + * Route factories of a route module, typed against the module's generated + * `FileRoutesByPath` and its scope register instead of the application's + * global registrations. + */ +export interface FileRouteScope< + TFileRoutesByPath, + TRegister, + TModuleId extends string, +> { + /** `createFileRoute`, typed against the module's own route files. */ + createFileRoute: ( + path?: TFilePath, + ) => FileRouteFactory< + FileRouteId, + FileRouteParent, + FileRouteId, + FileRoutePath, + FileRouteFullPath, + TRegister + > + /** + * Creates the module root. `TRouterContext` is the router context the module + * requires from the route it is mounted under. + */ + createModuleRoot: () => < + TRouteContextFn = AnyContext, + TBeforeLoadFn = AnyContext, + TSearchValidator = undefined, + TLoaderDeps extends Record = {}, + TLoaderFn = undefined, + TSSR = unknown, + const TServerMiddlewares = unknown, + THandlers = undefined, + >( + options?: ModuleRootRouteOptions< + TModuleId, + TRegister, + TSearchValidator, + TRouterContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + TSSR, + TServerMiddlewares, + THandlers + >, + ) => ModuleRootRoute< + TModuleId, + TRegister, + TSearchValidator, + TRouterContext, + TRouteContextFn, + TBeforeLoadFn, + TLoaderDeps, + TLoaderFn, + unknown, + unknown, + TSSR, + TServerMiddlewares, + THandlers + > +} + +/** + * Installs the route-module behavior of the core and of this framework's + * links. Module roots call it when they are created, before an application + * creates its router. + */ +function installRouteModuleBindings() { + installRouteModules() + addRouteModuleLinkOptions() +} + +/** Binds only the module-root factory used by generated route scopes. */ +export function bindCreateModuleRoot( + moduleId: TModuleId, +): FileRouteScope['createModuleRoot'] { + return () => (options) => { + // Module routes resolve their route-bound APIs through the route-module + // behavior: install it with the first module root. Binding the factory + // itself, as every generated scope does, has no effect. + installRouteModuleBindings() + return new Route({ ...(options as any), _module: moduleId }) as any + } +} + +/** + * The routing APIs of a route scope, typed against `TRouter`. + * + * Path-based APIs (`Link`, `useNavigate`, `redirect`, ...) address routes by + * the module-local paths of the module: they work wherever the module is + * mounted. Id-based APIs (`useMatch`, `getRouteApi`, ...) take qualified route + * ids such as `@acme/products:/$productId`. + */ +export interface RouteScope { + Link: LinkComponent<'a', string, { router: TRouter }> + createLink: CreateLinkFn<{ router: TRouter }> + linkOptions: LinkOptionsFn<'a', { router: TRouter }> + Navigate: NavigateComponentFn<{ router: TRouter }> + useNavigate: UseNavigateFn<{ router: TRouter }> + useLinkProps: UseLinkPropsFn<{ router: TRouter }> + useBlocker: UseBlockerFn<{ router: TRouter }> + notFound: ( + options?: Omit & { + routeId?: RouteIds + }, + ) => NotFoundError + redirect: RedirectFn<{ router: TRouter }> + MatchRoute: MatchRouteComponentType<{ router: TRouter }> + useMatchRoute: UseMatchRouteFn<{ router: TRouter }> + /** + * The router, viewed from the module: its `navigate`, `buildLocation`, + * `preloadRoute` and `matchRoute` take module-local paths. + */ + useRouter: (opts?: { warn?: boolean }) => ScopedRouterView + getRouteApi: GetRouteApiFn<{ router: TRouter }> + useMatch: UseMatchFn<{ router: TRouter }> + useMatches: UseMatchesFn<{ router: TRouter }> + useParentMatches: UseParentMatchesFn<{ router: TRouter }> + useChildMatches: UseChildMatchesFn<{ router: TRouter }> + useLoaderData: UseLoaderDataFn<{ router: TRouter }> + useLoaderDeps: UseLoaderDepsFn<{ router: TRouter }> + useSearch: UseSearchFn<{ router: TRouter }> + useParams: UseParamsFn<{ router: TRouter }> + useRouteContext: UseRouteContextFn<{ router: TRouter }> + useLocation: UseLocationFn<{ router: TRouter }> + useRouterState: UseRouterStateFn<{ router: TRouter }> +} + +// Each generated ESM export binds only its own API. These functions allocate +// closures/components; they never access a router or register runtime state. +function bindOptions(moduleId: string): (options: any) => any { + const router = useRouter() + const routeId = Vue.inject(routeIdContext, undefined) + return (options: any) => + bindRouteScopeOptions(moduleId, options ?? {}, router, routeId) +} + +function scopedComponent( + moduleId: string, + name: string, + component: any, + extra?: object, +) { + return Vue.defineComponent({ + name, + inheritAttrs: false, + setup(_, { attrs, slots }) { + const bind = bindOptions(moduleId) + return () => Vue.h(component, { ...bind(attrs), ...extra }, slots) + }, + }) +} + +export function bindRouteScopeLink( + moduleId: string, +): RouteScope['Link'] { + return scopedComponent(moduleId, 'Link', Link) as any +} + +export function bindRouteScopeCreateLink( + moduleId: string, +): RouteScope['createLink'] { + return ((Comp: unknown) => + scopedComponent(moduleId, 'Link', Link, { _asChild: Comp })) as any +} + +export function bindRouteScopeNavigate( + moduleId: string, +): RouteScope['Navigate'] { + return scopedComponent(moduleId, 'Navigate', Navigate) as any +} + +export function bindRouteScopeMatchRoute( + moduleId: string, +): RouteScope['MatchRoute'] { + return Vue.defineComponent({ + name: 'MatchRoute', + inheritAttrs: false, + setup(_, { attrs, slots }) { + const bind = bindOptions(moduleId) + const routeId = Vue.inject(routeIdContext, undefined) + return () => + Vue.h( + MatchRoute as any, + { ...bind(attrs), _nearestRoute: routeId }, + slots, + ) + }, + }) as any +} + +export function bindRouteScopeUseLinkProps( + moduleId: string, +): RouteScope['useLinkProps'] { + return ((options: any) => { + const bind = bindOptions(moduleId) + return useLinkPropsImpl(() => bind(options)) + }) as any +} + +export function bindRouteScopeLinkOptions( + moduleId: string, +): RouteScope['linkOptions'] { + return ((options: any) => + Array.isArray(options) + ? options.map((option) => bindRouteScopeOptions(moduleId, option)) + : bindRouteScopeOptions(moduleId, options)) as any +} + +export function bindRouteScopeUseNavigate( + moduleId: string, +): RouteScope['useNavigate'] { + return ((options?: any) => { + const bind = bindOptions(moduleId) + const navigate = useNavigate(bind(options)) + return (next: any) => navigate(bind(next)) + }) as any +} + +export function bindRouteScopeRedirect( + moduleId: string, +): RouteScope['redirect'] { + return createScopedRedirect(moduleId) +} + +export function bindRouteScopeUseMatchRoute( + moduleId: string, +): RouteScope['useMatchRoute'] { + return (() => { + const bind = bindOptions(moduleId) + const matchRoute = useMatchRoute() + const routeId = Vue.inject(routeIdContext, undefined) + return (options: any) => + matchRoute({ ...bind(options), _nearestRoute: routeId }) + }) as any +} + +export function bindRouteScopeUseRouter( + moduleId: string, +): RouteScope['useRouter'] { + return ((options?: { warn?: boolean }) => + getScopedRouterView( + useRouter(options), + moduleId, + Vue.inject(routeIdContext, undefined), + )) as any +} + +export function bindRouteScopeGetRouteApi( + moduleId: string, +): RouteScope['getRouteApi'] { + return bindRouteScopeIdApi(moduleId, getRouteApi) as any +} + +export function bindRouteScopeUseMatch( + moduleId: string, +): RouteScope['useMatch'] { + return bindRouteScopeIdApi(moduleId, useMatch, 'from') as any +} + +export function bindRouteScopeUseLoaderData( + moduleId: string, +): RouteScope['useLoaderData'] { + return bindRouteScopeIdApi(moduleId, useLoaderData, 'from') as any +} + +export function bindRouteScopeUseLoaderDeps( + moduleId: string, +): RouteScope['useLoaderDeps'] { + return bindRouteScopeIdApi(moduleId, useLoaderDeps, 'from') as any +} + +export function bindRouteScopeUseSearch( + moduleId: string, +): RouteScope['useSearch'] { + return bindRouteScopeIdApi(moduleId, useSearch, 'from') as any +} + +export function bindRouteScopeUseParams( + moduleId: string, +): RouteScope['useParams'] { + return bindRouteScopeIdApi(moduleId, useParams, 'from') as any +} + +export function bindRouteScopeUseRouteContext( + moduleId: string, +): RouteScope['useRouteContext'] { + return bindRouteScopeIdApi(moduleId, useRouteContext, 'from') as any +} + +export function bindRouteScopeNotFound( + moduleId: string, +): RouteScope['notFound'] { + return bindRouteScopeIdApi(moduleId, notFound, 'routeId') as any +} diff --git a/packages/vue-router/src/router.ts b/packages/vue-router/src/router.ts index b1f56cf929..48bf6f5ecd 100644 --- a/packages/vue-router/src/router.ts +++ b/packages/vue-router/src/router.ts @@ -15,7 +15,7 @@ import type { } from './route' import type { VNode } from 'vue' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface RouterOptionsExtensions { /** * The default `component` a route should use if no component is provided. diff --git a/packages/vue-router/src/routerStores.ts b/packages/vue-router/src/routerStores.ts index a7aafa0287..171e4124bc 100644 --- a/packages/vue-router/src/routerStores.ts +++ b/packages/vue-router/src/routerStores.ts @@ -2,7 +2,7 @@ import { batch, createAtom } from '@tanstack/vue-store' import type { GetStoreConfig } from '@tanstack/router-core' import type { Readable } from '@tanstack/vue-store' -declare module '@tanstack/router-core' { +declare module '@tanstack/router-core/extensions' { export interface RouterReadableStore extends Readable {} } diff --git a/packages/vue-router/src/useBlocker.tsx b/packages/vue-router/src/useBlocker.tsx index 17eef20f7a..02f9345646 100644 --- a/packages/vue-router/src/useBlocker.tsx +++ b/packages/vue-router/src/useBlocker.tsx @@ -1,3 +1,4 @@ +import { isServer } from '@tanstack/router-core/isServer' import * as Vue from 'vue' import { useRouter } from './useRouter' import type { @@ -10,6 +11,8 @@ import type { AnyRouter, ParseRoute, RegisteredRouter, + RegisteredRouterOf, + RouteScopeMarker, } from '@tanstack/router-core' type ShouldBlockFnLocation< @@ -29,14 +32,21 @@ type AnyShouldBlockFnLocation = ShouldBlockFnLocation type MakeShouldBlockFnLocationUnion< TRouter extends AnyRouter = RegisteredRouter, TRoute extends AnyRoute = ParseRoute, -> = TRoute extends any +> = TRouter['routeTree'] extends RouteScopeMarker ? ShouldBlockFnLocation< - TRoute['id'], - TRoute['fullPath'], - TRoute['types']['allParams'], - TRoute['types']['fullSearchSchema'] + string, + string, + Record, + Record > - : never + : TRoute extends any + ? ShouldBlockFnLocation< + TRoute['id'], + TRoute['fullPath'], + TRoute['types']['allParams'], + TRoute['types']['fullSearchSchema'] + > + : never type BlockerResolver = | { @@ -128,6 +138,14 @@ function _resolveBlockerOpts( } } +/** The generated module hook observes navigation across the entire application. */ +export type UseBlockerFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TWithResolver extends boolean = false, +>( + opts: UseBlockerOpts, +) => TWithResolver extends true ? Vue.Ref> : void + export function useBlocker< TRouter extends AnyRouter = RegisteredRouter, TWithResolver extends boolean = false, @@ -164,14 +182,19 @@ export function useBlocker( const router = useRouter() const { history } = router - const resolver = Vue.ref({ + const idle: BlockerResolver = { status: 'idle', current: undefined, next: undefined, action: undefined, proceed: undefined, reset: undefined, - }) + } + if (isServer ?? router.isServer) { + return withResolver ? Vue.toRef(() => idle) : undefined + } + + const resolver = Vue.ref(idle) Vue.watchEffect((onCleanup) => { const blockerFnComposed = async (blockerFnArgs: BlockerFnArgs) => { diff --git a/packages/vue-router/src/useLoaderData.tsx b/packages/vue-router/src/useLoaderData.tsx index c4cbcb2f93..fc3bf3f442 100644 --- a/packages/vue-router/src/useLoaderData.tsx +++ b/packages/vue-router/src/useLoaderData.tsx @@ -2,7 +2,9 @@ import { useMatch } from './useMatch' import type * as Vue from 'vue' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseLoaderData, StrictOrFrom, UseLoaderDataResult, @@ -25,13 +27,26 @@ export type UseLoaderDataOptions< > = StrictOrFrom & UseLoaderDataBaseOptions -export type UseLoaderDataRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseLoaderDataRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, >( opts?: UseLoaderDataBaseOptions, ) => Vue.Ref> +/** + * The signature of `useLoaderData`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLoaderData` of this type. + */ +export type UseLoaderDataFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TSelected = unknown, +>( + opts: UseLoaderDataOptions, +) => Vue.Ref> + export function useLoaderData< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/vue-router/src/useLoaderDeps.tsx b/packages/vue-router/src/useLoaderDeps.tsx index ecf9f54f4e..e168e9ae77 100644 --- a/packages/vue-router/src/useLoaderDeps.tsx +++ b/packages/vue-router/src/useLoaderDeps.tsx @@ -2,7 +2,9 @@ import { useMatch } from './useMatch' import type * as Vue from 'vue' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseLoaderDeps, StrictOrFrom, UseLoaderDepsResult, @@ -23,13 +25,25 @@ export type UseLoaderDepsOptions< > = StrictOrFrom & UseLoaderDepsBaseOptions -export type UseLoaderDepsRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseLoaderDepsRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, >( opts?: UseLoaderDepsBaseOptions, ) => Vue.Ref> +/** + * The signature of `useLoaderDeps`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLoaderDeps` of this type. + */ +export type UseLoaderDepsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TSelected = unknown, +>( + opts: UseLoaderDepsOptions, +) => Vue.Ref> + export function useLoaderDeps< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/vue-router/src/useLocation.tsx b/packages/vue-router/src/useLocation.tsx index 144ca8ced9..809205bbf8 100644 --- a/packages/vue-router/src/useLocation.tsx +++ b/packages/vue-router/src/useLocation.tsx @@ -2,7 +2,9 @@ import { useSelector } from '@tanstack/vue-store' import { useRouter } from './useRouter' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, RouterState, } from '@tanstack/router-core' import type * as Vue from 'vue' @@ -18,6 +20,17 @@ export type UseLocationResult< ? RouterState['location'] : TSelected +/** + * The signature of `useLocation`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useLocation` of this type. + */ +export type UseLocationFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseLocationBaseOptions, +) => Vue.Ref> + export function useLocation< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, diff --git a/packages/vue-router/src/useMatch.tsx b/packages/vue-router/src/useMatch.tsx index 5bffc5fdcf..e8060c73a0 100644 --- a/packages/vue-router/src/useMatch.tsx +++ b/packages/vue-router/src/useMatch.tsx @@ -1,5 +1,6 @@ import * as Vue from 'vue' import { invariant } from '@tanstack/router-core' +import { routeModules } from '@tanstack/router-core/_internal/route-module' import { isServer } from '@tanstack/router-core/isServer' import { useSelector } from '@tanstack/vue-store' import { routeIdContext } from './matchContext' @@ -8,7 +9,10 @@ import type { AnyRouter, MakeRouteMatch, MakeRouteMatchUnion, + Register, RegisteredRouter, + RegisteredRouterOf, + RouteScopeMarker, StrictOrFrom, ThrowConstraint, ThrowOrOptional, @@ -22,13 +26,17 @@ export interface UseMatchBaseOptions< TSelected, > { select?: ( - match: MakeRouteMatch, + match: TRouter['routeTree'] extends RouteScopeMarker + ? TStrict extends true + ? MakeRouteMatch + : MakeRouteMatchUnion + : MakeRouteMatch, ) => TSelected shouldThrow?: TThrow } -export type UseMatchRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseMatchRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TThrow extends boolean = true, >( @@ -57,6 +65,28 @@ export type UseMatchResult< : MakeRouteMatchUnion : TSelected +/** + * The signature of `useMatch`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useMatch` of this type. + */ +export type UseMatchFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, +>( + opts: UseMatchOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected + >, +) => Vue.Ref< + ThrowOrOptional, TThrow> +> + export function useMatch< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, @@ -79,11 +109,16 @@ export function useMatch< // During SSR we render exactly once and do not need reactivity. // Avoid store subscriptions and pending/transition bookkeeping on the server. if (isServer ?? router.isServer) { - const nearestRouteId = opts.from ? undefined : Vue.inject(routeIdContext) - const matchStore = - (opts.from ?? nearestRouteId) - ? router.stores.getMatchStore(opts.from ?? nearestRouteId!) - : undefined + const nearestRouteId = Vue.inject(routeIdContext, undefined) + // `from` can be the module-local id of a module installed several times: + // it resolves through the nearest match. + const routeId = + routeModules && opts.from + ? routeModules.resolveRouteId(router, opts.from, nearestRouteId) + : (opts.from ?? nearestRouteId) + const matchStore = routeId + ? router.stores.getMatchStore(routeId) + : undefined const match = matchStore?.get() if ((opts.shouldThrow ?? true) && !match) { @@ -105,7 +140,13 @@ export function useMatch< > } - return Vue.ref(opts.select ? opts.select(match) : match) as Vue.Ref< + return Vue.ref( + opts.select + ? opts.select( + match as unknown as Parameters>[0], + ) + : match, + ) as Vue.Ref< ThrowOrOptional< UseMatchResult, TThrow @@ -116,26 +157,24 @@ export function useMatch< // Set up reactive match value based on lookup strategy. let match: Readonly> const nearestRouteId = Vue.inject(routeIdContext) + // `from` can be the module-local id of a module installed several times: + // it resolves through the nearest match. + const routeId = + routeModules && opts.from + ? routeModules.resolveRouteId(router, opts.from, nearestRouteId) + : (opts.from ?? nearestRouteId) - if (opts.from) { - // routeId case: subscribe to the stable per-route presentation atom. - const matchStore = router.stores.getMatchStore(opts.from) - match = useSelector(matchStore) + if (routeId) { + // Subscribe to the stable per-route presentation atom. The nearest + // routeId is provided by the nearest Match component and doesn't change + // for the component's lifetime, so the store is stable. + match = useSelector(router.stores.getMatchStore(routeId)) } else { - // Nearest-match case: use the routeId from context for stable lookup. - // The routeId is provided by the nearest Match component and doesn't - // change for the component's lifetime, so the store is stable. - if (nearestRouteId) { - match = useSelector(router.stores.getMatchStore(nearestRouteId)) - } else { - // No route context — will fall through to error handling below - match = Vue.ref(undefined) as Readonly> - } + // No route context — will fall through to error handling below + match = Vue.ref(undefined) as Readonly> } - const ownsMatch = - nearestRouteId !== undefined && - (opts.from ?? nearestRouteId) === nearestRouteId + const ownsMatch = nearestRouteId !== undefined && routeId === nearestRouteId let lastOwnedMatch: any const result = Vue.computed(() => { if (match.value !== undefined && ownsMatch) { diff --git a/packages/vue-router/src/useNavigate.tsx b/packages/vue-router/src/useNavigate.tsx index bc3162260a..99a2ff4a33 100644 --- a/packages/vue-router/src/useNavigate.tsx +++ b/packages/vue-router/src/useNavigate.tsx @@ -1,40 +1,89 @@ import * as Vue from 'vue' +import { isServer } from '@tanstack/router-core/isServer' +import { routeModules } from '@tanstack/router-core/_internal/route-module' +import { routeIdContext } from './matchContext' import { useRouter } from './useRouter' import type { AnyRouter, + CompatibleRouteScope, FromPathOption, NavigateOptions, + Register, RegisteredRouter, + RegisteredRouterOf, + RouteModuleScope, UseNavigateResult, } from '@tanstack/router-core' +/** + * The signature of `useNavigate`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useNavigate` of this type. + */ +export type UseNavigateFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TDefaultFrom extends string = string, +>(_defaultOpts?: { + from?: FromPathOption + _module?: RouteModuleScope> +}) => UseNavigateResult + export function useNavigate< TRouter extends AnyRouter = RegisteredRouter, TDefaultFrom extends string = string, >(_defaultOpts?: { from?: FromPathOption -}): UseNavigateResult { +}): UseNavigateResult { const { navigate } = useRouter() + // Only the route-module translation reads the nearest route, which route + // modules install before any component sets up. + const routeId = routeModules + ? Vue.inject(routeIdContext, undefined) + : undefined return ((options: NavigateOptions) => { - return navigate({ from: _defaultOpts?.from, ...options }) - }) as UseNavigateResult + return navigate( + routeModules + ? { + // Route-module APIs also pass their internal `_module` and + // `_fromRoute` scope; it resolves to the installation of the + // nearest match. + ..._defaultOpts, + _nearestRoute: routeId, + ...options, + } + : { from: _defaultOpts?.from, ...options }, + ) + }) as UseNavigateResult } -export function Navigate< - TRouter extends AnyRouter = RegisteredRouter, +/** + * The signature of `Navigate`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `Navigate` of this type. + */ +export type NavigateComponentFn = < + TRouter extends AnyRouter = RegisteredRouterOf, const TFrom extends string = string, const TTo extends string | undefined = undefined, const TMaskFrom extends string = TFrom, const TMaskTo extends string = '', ->(props: NavigateOptions): null { - const { navigate } = useRouter() +>( + props: NavigateOptions, +) => null - Vue.onMounted(() => { - navigate({ - ...props, - }) - }) - - return null -} +export const Navigate = Vue.defineComponent({ + name: 'Navigate', + inheritAttrs: false, + setup(_, { attrs }) { + const router = useRouter() + if (isServer ?? router.isServer) { + return () => null + } + const navigate = useNavigate() + const update = () => { + void navigate({ ...attrs }) + } + Vue.onMounted(update) + Vue.onUpdated(update) + return () => null + }, +}) as unknown as NavigateComponentFn diff --git a/packages/vue-router/src/useParams.tsx b/packages/vue-router/src/useParams.tsx index 6891c08adc..703d91e902 100644 --- a/packages/vue-router/src/useParams.tsx +++ b/packages/vue-router/src/useParams.tsx @@ -2,7 +2,9 @@ import { useMatch } from './useMatch' import type * as Vue from 'vue' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseParams, StrictOrFrom, ThrowConstraint, @@ -30,8 +32,8 @@ export type UseParamsOptions< > = StrictOrFrom & UseParamsBaseOptions -export type UseParamsRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseParamsRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TThrow extends boolean = true, >( @@ -46,6 +48,28 @@ export type UseParamsRoute = < ThrowOrOptional, TThrow> > +/** + * The signature of `useParams`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useParams` of this type. + */ +export type UseParamsFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, +>( + opts: UseParamsOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected + >, +) => Vue.Ref< + ThrowOrOptional, TThrow> +> + export function useParams< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/vue-router/src/useRouteContext.ts b/packages/vue-router/src/useRouteContext.ts index 839e311925..86e09e3bf2 100644 --- a/packages/vue-router/src/useRouteContext.ts +++ b/packages/vue-router/src/useRouteContext.ts @@ -2,19 +2,34 @@ import { useMatch } from './useMatch' import type * as Vue from 'vue' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, UseRouteContextBaseOptions, UseRouteContextOptions, UseRouteContextResult, } from '@tanstack/router-core' -export type UseRouteContextRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseRouteContextRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, >( opts?: UseRouteContextBaseOptions, ) => Vue.Ref> +/** + * The signature of `useRouteContext`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouteContext` of this type. + */ +export type UseRouteContextFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TSelected = unknown, +>( + opts: UseRouteContextOptions, +) => Vue.Ref> + export function useRouteContext< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/vue-router/src/useRouter.tsx b/packages/vue-router/src/useRouter.tsx index 21afef03df..6bcbddd8c5 100644 --- a/packages/vue-router/src/useRouter.tsx +++ b/packages/vue-router/src/useRouter.tsx @@ -1,6 +1,21 @@ import * as Vue from 'vue' import { routerContext } from './routerContext' -import type { AnyRouter, RegisteredRouter } from '@tanstack/router-core' +import type { + AnyRouter, + Register, + RegisteredRouter, + RegisteredRouterOf, +} from '@tanstack/router-core' + +/** + * The signature of `useRouter`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouter` of this type. + */ +export type UseRouterFn = < + TRouter extends AnyRouter = RegisteredRouterOf, +>(opts?: { + warn?: boolean +}) => TRouter export function useRouter(opts?: { warn?: boolean diff --git a/packages/vue-router/src/useRouterState.tsx b/packages/vue-router/src/useRouterState.tsx index 489b05ae91..e7d64bd4a2 100644 --- a/packages/vue-router/src/useRouterState.tsx +++ b/packages/vue-router/src/useRouterState.tsx @@ -4,7 +4,9 @@ import { useSelector } from '@tanstack/vue-store' import { useRouter } from './useRouter' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, RouterState, } from '@tanstack/router-core' @@ -18,6 +20,17 @@ export type UseRouterStateResult< TSelected, > = unknown extends TSelected ? RouterState : TSelected +/** + * The signature of `useRouterState`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useRouterState` of this type. + */ +export type UseRouterStateFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + TSelected = unknown, +>( + opts?: UseRouterStateOptions, +) => Vue.Ref> + export function useRouterState< TRouter extends AnyRouter = RegisteredRouter, TSelected = unknown, @@ -42,7 +55,7 @@ export function useRouterState< // The expression must stay inlined in the `if` so bundlers fold the // browser-build constant `isServer = false` and drop this server block. if (isServer ?? router.isServer) { - const state = router.stores.__store.get() as RouterState< + const state = router.stores.__store.get() as unknown as RouterState< TRouter['routeTree'] > return Vue.ref(opts?.select ? opts.select(state) : state) as Vue.Ref< @@ -52,7 +65,7 @@ export function useRouterState< return useSelector(router.stores.__store, (state) => { if (opts?.select) { - return opts.select(state) + return opts.select(state as unknown as RouterState) } return state diff --git a/packages/vue-router/src/useSearch.tsx b/packages/vue-router/src/useSearch.tsx index 43f61d743f..107b7602b5 100644 --- a/packages/vue-router/src/useSearch.tsx +++ b/packages/vue-router/src/useSearch.tsx @@ -2,7 +2,9 @@ import { useMatch } from './useMatch' import type * as Vue from 'vue' import type { AnyRouter, + Register, RegisteredRouter, + RegisteredRouterOf, ResolveUseSearch, StrictOrFrom, ThrowConstraint, @@ -30,8 +32,8 @@ export type UseSearchOptions< > = StrictOrFrom & UseSearchBaseOptions -export type UseSearchRoute = < - TRouter extends AnyRouter = RegisteredRouter, +export type UseSearchRoute = < + TRouter extends AnyRouter = RegisteredRouterOf, TSelected = unknown, TThrow extends boolean = true, >( @@ -46,6 +48,28 @@ export type UseSearchRoute = < ThrowOrOptional, TThrow> > +/** + * The signature of `useSearch`, typed against the router of `TDefaultRegister` unless a router + * type is passed explicitly. Route modules export a `useSearch` of this type. + */ +export type UseSearchFn = < + TRouter extends AnyRouter = RegisteredRouterOf, + const TFrom extends string | undefined = undefined, + TStrict extends boolean = true, + TThrow extends boolean = true, + TSelected = unknown, +>( + opts: UseSearchOptions< + TRouter, + TFrom, + TStrict, + ThrowConstraint, + TSelected + >, +) => Vue.Ref< + ThrowOrOptional, TThrow> +> + export function useSearch< TRouter extends AnyRouter = RegisteredRouter, const TFrom extends string | undefined = undefined, diff --git a/packages/vue-router/tests/blocker-server.test.tsx b/packages/vue-router/tests/blocker-server.test.tsx new file mode 100644 index 0000000000..35d4f13f75 --- /dev/null +++ b/packages/vue-router/tests/blocker-server.test.tsx @@ -0,0 +1,38 @@ +import * as Vue from 'vue' +import { afterEach, expect, test, vi } from 'vitest' +import { cleanup, render, screen } from '@testing-library/vue' +import { + RouterContextProvider, + createMemoryHistory, + createRootRoute, + createRouter, + useBlocker, +} from '../src' + +afterEach(cleanup) + +test('a server router does not register navigation blockers', async () => { + const history = createMemoryHistory({ initialEntries: ['/'] }) + const block = vi.spyOn(history, 'block') + const router = createRouter({ + routeTree: createRootRoute(), + history, + isServer: true, + }) + const Observer = Vue.defineComponent({ + setup() { + const state = useBlocker({ + shouldBlockFn: () => true, + withResolver: true, + }) + return () => {state.value.status} + }, + }) + render( + + + , + ) + await screen.findByText('idle') + expect(block).not.toHaveBeenCalled() +}) diff --git a/packages/vue-router/tests/navigate-options-parity.test.tsx b/packages/vue-router/tests/navigate-options-parity.test.tsx new file mode 100644 index 0000000000..fb978a104f --- /dev/null +++ b/packages/vue-router/tests/navigate-options-parity.test.tsx @@ -0,0 +1,107 @@ +import * as Vue from 'vue' +import { renderToString } from 'vue/server-renderer' +import { afterEach, expect, test, vi } from 'vitest' +import { + cleanup, + fireEvent, + render, + screen, + waitFor, +} from '@testing-library/vue' +import { + Navigate, + Outlet, + RouterContextProvider, + RouterProvider, + createMemoryHistory, + createRootRoute, + createRoute, + createRouter, +} from '../src' + +afterEach(cleanup) + +test('Navigate leaves the request location unchanged during server rendering', async () => { + const root = createRootRoute() + const next = createRoute({ getParentRoute: () => root, path: '/next' }) + const router = createRouter({ + routeTree: root.addChildren([next]), + history: createMemoryHistory({ initialEntries: ['/'] }), + isServer: true, + }) + const navigate = vi.spyOn(router, 'navigate') + const html = await renderToString( + + + Request content + , + ) + expect(html).toContain('Request content') + expect(navigate).not.toHaveBeenCalled() + expect(router.state.location.href).toBe('/') +}) + +test('Navigate responds to option changes while mounted', async () => { + const component = Vue.defineComponent({ + setup() { + const id = Vue.ref('one') + const q = Vue.ref('first') + const replace = Vue.ref(true) + const setId = (value: string) => { + id.value = value + } + const setQ = (value: string) => { + q.value = value + } + const setReplace = (value: boolean) => { + replace.value = value + } + return () => ( + <> + + + + + + ) + }, + }) + const root = createRootRoute({ component }) + const item = createRoute({ getParentRoute: () => root, path: '/items/$id' }) + const history = createMemoryHistory({ initialEntries: ['/'] }) + const router = createRouter({ routeTree: root.addChildren([item]), history }) + render() + await waitFor(() => + expect(router.state.location.href).toBe('/items/one?q=first'), + ) + const initialLength = history.length + await fireEvent.click(screen.getByText('Change params')) + await waitFor(() => + expect(router.state.location.href).toBe('/items/two?q=first'), + ) + expect(history.length).toBe(initialLength + 1) + await fireEvent.click(screen.getByText('Change search')) + await waitFor(() => + expect(router.state.location.href).toBe('/items/two?q=second'), + ) + expect(history.length).toBe(initialLength + 1) +}) diff --git a/packages/vue-router/vite.config.ts b/packages/vue-router/vite.config.ts index 13928e0a1a..8500f1d734 100644 --- a/packages/vue-router/vite.config.ts +++ b/packages/vue-router/vite.config.ts @@ -34,6 +34,7 @@ export default mergeConfig( tsconfigPath: './tsconfig.build.json', entry: [ './src/index.tsx', + './src/route-module-internal.ts', './src/index.dev.tsx', './src/ssr/client.ts', './src/ssr/server.ts', diff --git a/packages/vue-start/package.json b/packages/vue-start/package.json index bf6b79e636..f4210cd60b 100644 --- a/packages/vue-start/package.json +++ b/packages/vue-start/package.json @@ -26,6 +26,7 @@ "scripts": { "clean": "rimraf ./dist && rimraf ./coverage", "test": "pnpm test:build", + "test:unit": "vitest", "test:build": "publint --strict && attw --ignore-rules no-resolution --pack .", "build": "vite build && vite build -c vite.config.server-entry.ts" }, @@ -98,7 +99,13 @@ "default": "./dist/esm/client-only.js" } }, - "./package.json": "./package.json" + "./package.json": "./package.json", + "./_internal/route-module": { + "import": { + "types": "./dist/esm/route-module-internal.d.ts", + "default": "./dist/esm/route-module-internal.js" + } + } }, "sideEffects": false, "files": [ @@ -109,7 +116,7 @@ "!skills/_artifacts" ], "engines": { - "node": ">=22.12.0" + "node": ">=22.22.0" }, "dependencies": { "@tanstack/start-client-core": "workspace:*", @@ -132,7 +139,9 @@ "jsdom": "catalog:", "@arethetypeswrong/cli": "catalog:", "publint": "catalog:", - "rimraf": "catalog:" + "rimraf": "catalog:", + "@tanstack/router-generator": "workspace:*", + "@vitejs/plugin-vue": "^6.0.5" }, "peerDependencies": { "@rsbuild/core": "^2.0.5", @@ -146,5 +155,15 @@ "vite": { "optional": true } + }, + "nx": { + "targets": { + "test:unit": { + "dependsOn": [ + "^build", + "build" + ] + } + } } } diff --git a/packages/vue-start/src/index.ts b/packages/vue-start/src/index.ts index 21b3b5b003..6602558c38 100644 --- a/packages/vue-start/src/index.ts +++ b/packages/vue-start/src/index.ts @@ -1,5 +1,6 @@ export { useServerFn } from './useServerFn' export * from '@tanstack/start-client-core' +export type { StartModuleRequirements } from '@tanstack/start-client-core' // Explicit re-exports shadow `export *` above so these public-API names are // registered on the namespace at link time (via Vite SSR's `defineExport` // at fileStartIndex), surviving the cold-start SSR cycle through user diff --git a/packages/vue-start/src/route-module-internal.ts b/packages/vue-start/src/route-module-internal.ts new file mode 100644 index 0000000000..8642a07276 --- /dev/null +++ b/packages/vue-start/src/route-module-internal.ts @@ -0,0 +1 @@ +export { createStartModule } from '@tanstack/start-client-core/_internal/route-module' diff --git a/packages/vue-start/tests/route-module-build.test.ts b/packages/vue-start/tests/route-module-build.test.ts new file mode 100644 index 0000000000..093eedd0fc --- /dev/null +++ b/packages/vue-start/tests/route-module-build.test.ts @@ -0,0 +1,13 @@ +// @vitest-environment node +import { fileURLToPath } from 'node:url' +import { defineRouteModuleBuildTests } from '../../start-plugin-core/tests/route-module-build' + +// Builds a Start application that mounts a route module with this package's +// public Vite and Rsbuild plugins, then runs its server and client output. +defineRouteModuleBuildTests({ + framework: 'vue', + frameworkPackage: 'vue', + frameworkPlugins: ['@vitejs/plugin-vue', '@vitejs/plugin-vue-jsx'], + pluginOptions: '', + packageRoot: fileURLToPath(new URL('..', import.meta.url)), +}) diff --git a/packages/vue-start/vite.config.ts b/packages/vue-start/vite.config.ts index dc421ef7ff..2edbb7d7b2 100644 --- a/packages/vue-start/vite.config.ts +++ b/packages/vue-start/vite.config.ts @@ -28,6 +28,7 @@ export default mergeConfig( exclude: ['./src/default-entry'], entry: [ './src/index.ts', + './src/route-module-internal.ts', './src/client.tsx', './src/client-rpc.ts', './src/ssr-rpc.ts', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 42744e7f3b..e75313b2f7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,9 @@ importers: .: configDependencies: {} packageManagerDependencies: + '@pnpm/exe': + specifier: 12.18.0 + version: 12.18.0 pnpm: specifier: 12.18.0 version: 12.18.0 @@ -89,6 +92,11 @@ packages: cpu: [x64] os: [win32] + '@pnpm/exe@12.18.0': + resolution: {integrity: sha512-3t/p83vw9SXsJML6suMBThCtwCl4lUGp/ILcxECU1In+G+NmFwMV9D+2TcvU7kX8tbrHRoYhs3eOPepEVdD7tQ==} + engines: {node: '>=18'} + hasBin: true + pnpm@12.18.0: resolution: {integrity: sha512-nXiC1dyCFH7PxOBiqjSDTgrQKWcQoYN6ERWuASEn02txCeMhrBWYod0KZVl2gbHpmRfhLtDXSerpEYeUM2O+sw==} engines: {node: '>=18'} @@ -138,6 +146,23 @@ snapshots: '@pnpm/exe.win32-x64@12.18.0': optional: true + '@pnpm/exe@12.18.0': + optionalDependencies: + '@pnpm/exe.android-arm64': 12.18.0 + '@pnpm/exe.android-x64': 12.18.0 + '@pnpm/exe.darwin-arm64': 12.18.0 + '@pnpm/exe.darwin-x64': 12.18.0 + '@pnpm/exe.freebsd-x64': 12.18.0 + '@pnpm/exe.linux-arm64': 12.18.0 + '@pnpm/exe.linux-arm64-musl': 12.18.0 + '@pnpm/exe.linux-ppc64': 12.18.0 + '@pnpm/exe.linux-riscv64': 12.18.0 + '@pnpm/exe.linux-s390x': 12.18.0 + '@pnpm/exe.linux-x64': 12.18.0 + '@pnpm/exe.linux-x64-musl': 12.18.0 + '@pnpm/exe.win32-arm64': 12.18.0 + '@pnpm/exe.win32-x64': 12.18.0 + pnpm@12.18.0: optionalDependencies: '@pnpm/exe.android-arm64': 12.18.0 @@ -178,7 +203,7 @@ catalogs: version: 1.26.2 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@tanstack/vite-config': specifier: 0.5.2 version: 0.5.2 @@ -198,8 +223,8 @@ catalogs: specifier: ^5.0.4 version: 5.0.4 chokidar: - specifier: ^5.0.0 - version: 5.0.0 + specifier: ^6.0.0 + version: 6.0.0 combinate: specifier: ^1.1.11 version: 1.1.11 @@ -307,16 +332,16 @@ importers: version: 2.30.0(@types/node@25.0.9) '@nx/devkit': specifier: 24.0.0 - version: 24.0.0(nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@7.2.0))(@swc/core@1.15.33(@swc/helpers@0.5.23))) + version: 24.0.0(nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23))) '@playwright/test': specifier: ^1.63.0 version: 1.63.0 '@swc-node/register': specifier: ^1.11.1 - version: 1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@7.2.0) + version: 1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@tanstack/eslint-config': specifier: 0.4.0 - version: 0.4.0(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + version: 0.4.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -325,19 +350,22 @@ importers: version: typescript@7.0.2 eslint: specifier: ^9.22.0 - version: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) + version: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-plugin-unused-imports: specifier: ^4.1.4 - version: 4.1.4(@typescript-eslint/eslint-plugin@8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) + version: 4.1.4(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) markdown-link-extractor: specifier: ^4.0.3 version: 4.0.3 nx: specifier: 24.0.0 - version: 24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@7.2.0))(@swc/core@1.15.33(@swc/helpers@0.5.23)) + version: 24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23)) prettier: specifier: ^3.8.0 version: 3.8.1 + sass: + specifier: 1.97.2 + version: 1.97.2 tinyglobby: specifier: ^0.2.15 version: 0.2.15 @@ -358,10 +386,13 @@ importers: version: typescript@5.9.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) benchmarks/bundle-size: dependencies: + '@benchmarks/feature': + specifier: workspace:* + version: link:modules/feature '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -401,10 +432,13 @@ importers: devDependencies: '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.24)) + '@tanstack/router-generator': + specifier: workspace:* + version: link:../../packages/router-generator '@tanstack/router-plugin': specifier: workspace:* version: link:../../packages/router-plugin @@ -419,22 +453,31 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + benchmarks/bundle-size/modules/feature: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../packages/react-router + react: + specifier: ^19.2.3 + version: 19.2.3 benchmarks/client-nav: dependencies: @@ -468,7 +511,7 @@ importers: devDependencies: '@codspeed/vitest-plugin': specifier: ^6.0.1 - version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) + version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) '@platformatic/flame': specifier: ^1.6.0 version: 1.6.0 @@ -492,13 +535,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) jsdom: specifier: ^29.1.1 version: 29.1.1(@noble/hashes@2.0.1) @@ -507,13 +550,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) benchmarks/memory/client: dependencies: @@ -544,7 +587,7 @@ importers: devDependencies: '@codspeed/vitest-plugin': specifier: ^6.0.1 - version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) + version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) '@datadog/pprof': specifier: ^5.13.2 version: 5.13.2 @@ -568,13 +611,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) jsdom: specifier: 29.1.1 version: 29.1.1(@noble/hashes@2.0.1) @@ -583,13 +626,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) benchmarks/memory/server: dependencies: @@ -626,7 +669,7 @@ importers: devDependencies: '@codspeed/vitest-plugin': specifier: ^6.0.1 - version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) + version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) '@datadog/pprof': specifier: ^5.13.2 version: 5.13.2 @@ -641,10 +684,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) jsdom: specifier: 29.1.1 version: 29.1.1(@noble/hashes@2.0.1) @@ -653,13 +696,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) benchmarks/ssr: dependencies: @@ -696,7 +739,7 @@ importers: devDependencies: '@codspeed/vitest-plugin': specifier: ^6.0.1 - version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) + version: 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4) '@types/react': specifier: ^19.2.8 version: 19.2.9 @@ -705,10 +748,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) jsdom: specifier: 29.1.1 version: 29.1.1(@noble/hashes@2.0.1) @@ -720,13 +763,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/e2e-utils: devDependencies: @@ -741,13 +784,13 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/eslint-plugin-start: devDependencies: @@ -780,7 +823,7 @@ importers: version: 5.9.2 vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/react-router/basepath-file-based: dependencies: @@ -814,16 +857,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -860,10 +903,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-esbuild-file-based: dependencies: @@ -909,7 +952,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -949,19 +992,19 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-file-based-code-splitting: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1001,16 +1044,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-react-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -1050,16 +1093,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-react-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -1105,16 +1148,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1151,19 +1194,19 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: ~5.9.0 version: 5.9.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1206,16 +1249,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/basic-virtual-named-export-config-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1258,10 +1301,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/escaped-special-strings: dependencies: @@ -1292,16 +1335,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/generator-cli-only: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1338,16 +1381,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/i18n-paraglide: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1387,13 +1430,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/issue-4759: dependencies: @@ -1421,10 +1464,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/issue-7120: dependencies: @@ -1455,10 +1498,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/issue-7457: dependencies: @@ -1492,16 +1535,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/js-only-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1538,10 +1581,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/match-params: dependencies: @@ -1569,7 +1612,7 @@ importers: version: 19.2.3(@types/react@19.2.9) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/react-compiler: dependencies: @@ -1591,7 +1634,7 @@ importers: version: 1.63.0 '@rolldown/plugin-babel': specifier: ^0.2.0 - version: 0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1603,13 +1646,230 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) babel-plugin-react-compiler: specifier: ^1.0.0 version: 1.0.0 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-router/route-modules: + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@route-modules/web': + specifier: workspace:* + version: link:packages/web + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@tanstack/router-generator': + specifier: workspace:* + version: link:../../../packages/router-generator + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-solid: + specifier: ^2.11.11 + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + e2e/react-router/route-modules/packages/account: + dependencies: + '@route-modules/products': + specifier: workspace:* + version: link:../products + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-router/route-modules/packages/billing: + dependencies: + '@route-modules/settings': + specifier: workspace:* + version: link:../settings + '@route-modules/team': + specifier: workspace:* + version: link:../team + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-router/route-modules/packages/products: + dependencies: + '@route-modules/account': + specifier: workspace:* + version: link:../account + '@route-modules/storefront': + specifier: workspace:* + version: link:../storefront + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + react: + specifier: ^19.2.3 + version: 19.2.3 + zod: + specifier: ^4.4.3 + version: 4.5.4 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-router/route-modules/packages/settings: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-router/route-modules/packages/storefront: + dependencies: + '@route-modules/products': + specifier: workspace:* + version: link:../products + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-router/route-modules/packages/team: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-router/route-modules/packages/web: + dependencies: + '@route-modules/account': + specifier: workspace:* + version: link:../account + '@route-modules/billing': + specifier: workspace:* + version: link:../billing + '@route-modules/products': + specifier: workspace:* + version: link:../products + '@route-modules/settings': + specifier: workspace:* + version: link:../settings + '@route-modules/storefront': + specifier: workspace:* + version: link:../storefront + '@route-modules/team': + specifier: workspace:* + version: link:../team + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + '@tanstack/react-router-devtools': + specifier: workspace:^ + version: link:../../../../../packages/react-router-devtools + react: + specifier: ^19.2.3 + version: 19.2.3 + react-dom: + specifier: ^19.2.3 + version: 19.2.3(react@19.2.3) + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-plugin': + specifier: workspace:* + version: link:../../../../../packages/router-plugin + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/react-router/rspack-basic-file-based: dependencies: @@ -1634,10 +1894,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -1689,10 +1949,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -1728,7 +1988,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1768,10 +2028,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/sentry-integration: dependencies: @@ -1786,7 +2046,7 @@ importers: version: 4.6.1(supports-color@10.2.2) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1820,16 +2080,16 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-router/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -1872,13 +2132,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/basic: dependencies: @@ -1921,16 +2181,16 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -1951,7 +2211,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -1966,7 +2226,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) zod: specifier: ^4.4.3 version: 4.4.3 @@ -2012,7 +2272,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2030,7 +2290,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) dotenv: specifier: ^17.2.3 version: 17.2.3 @@ -2045,7 +2305,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/basic-cloudflare: dependencies: @@ -2067,13 +2327,13 @@ importers: devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) '@playwright/test': specifier: ^1.63.0 version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2091,7 +2351,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -2100,7 +2360,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -2146,7 +2406,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2164,7 +2424,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -2176,7 +2436,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/basic-tsr-config: dependencies: @@ -2219,7 +2479,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/clerk-basic: dependencies: @@ -2253,7 +2513,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2271,7 +2531,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -2280,7 +2540,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/csp: dependencies: @@ -2323,7 +2583,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/css-inline: dependencies: @@ -2351,10 +2611,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2372,13 +2632,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/css-modules: dependencies: @@ -2397,19 +2657,19 @@ importers: devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) '@playwright/test': specifier: ^1.63.0 version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@rsbuild/plugin-sass': specifier: ^2.0.1 - version: 2.0.1(@rsbuild/core@2.3.1) + version: 2.0.1(@rsbuild/core@2.3.2) '@tanstack/router-e2e-utils': specifier: workspace:* version: link:../../e2e-utils @@ -2427,7 +2687,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) cf: specifier: 1.0.0-beta.28 version: 1.0.0-beta.28(@types/node@25.0.9) @@ -2436,7 +2696,7 @@ importers: version: 3.0.260903-beta rsbuild-plugin-cloudflare: specifier: ^0.0.4 - version: 0.0.4(@rsbuild/core@2.3.1)(@types/node@25.0.9)(workerd@1.20261104.1) + version: 0.0.4(@rsbuild/core@2.3.2)(@types/node@25.0.9)(workerd@1.20260317.1) sass: specifier: ^1.97.2 version: 1.97.2 @@ -2448,7 +2708,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -2482,7 +2742,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2503,7 +2763,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) cross-env: specifier: ^10.0.0 version: 10.0.0 @@ -2521,7 +2781,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/custom-server-rsbuild: dependencies: @@ -2546,10 +2806,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -2604,10 +2864,10 @@ importers: devDependencies: '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2625,7 +2885,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -2634,7 +2894,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/dev-ssr-styles: dependencies: @@ -2674,7 +2934,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: specifier: ^3.0.260903-beta version: 3.0.260903-beta @@ -2686,7 +2946,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) zod: specifier: ^4.4.3 version: 4.4.3 @@ -2729,7 +2989,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) node-forge: specifier: ^1.3.1 version: 1.3.1 @@ -2744,7 +3004,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/flamegraph-bench: dependencies: @@ -2772,7 +3032,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) autocannon: specifier: ^8.0.0 version: 8.0.0 @@ -2787,7 +3047,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/hmr: dependencies: @@ -2809,16 +3069,16 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2836,7 +3096,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -2845,7 +3105,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/i18n-paraglide: dependencies: @@ -2873,7 +3133,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2891,7 +3151,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -2900,7 +3160,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/import-protection: dependencies: @@ -2925,10 +3185,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -2946,7 +3206,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -2955,7 +3215,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/import-protection-custom-config: dependencies: @@ -2992,7 +3252,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3001,7 +3261,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/issue-8049: dependencies: @@ -3032,10 +3292,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/query-integration: dependencies: @@ -3075,7 +3335,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3093,7 +3353,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -3102,7 +3362,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/response-reconciliation: dependencies: @@ -3124,10 +3384,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3142,7 +3402,7 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3151,7 +3411,7 @@ importers: version: 6.0.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/root-document-hydration: dependencies: @@ -3188,7 +3448,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3197,7 +3457,183 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/react-start/route-modules: + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@start-route-modules/web': + specifier: workspace:* + version: link:packages/web + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@tanstack/router-generator': + specifier: workspace:* + version: link:../../../packages/router-generator + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + e2e/react-start/route-modules/packages/catalog: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../../../packages/react-start + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@tanstack/start-client-core': + specifier: workspace:* + version: link:../../../../../packages/start-client-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-start/route-modules/packages/notes: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-start/route-modules/packages/settings: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../../../packages/react-start + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@tanstack/start-client-core': + specifier: workspace:* + version: link:../../../../../packages/start-client-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-start/route-modules/packages/team: + dependencies: + '@start-route-modules/settings': + specifier: workspace:* + version: link:../settings + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../../../packages/react-start + react: + specifier: ^19.2.3 + version: 19.2.3 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core + '@tanstack/start-client-core': + specifier: workspace:* + version: link:../../../../../packages/start-client-core + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + + e2e/react-start/route-modules/packages/web: + dependencies: + '@start-route-modules/catalog': + specifier: workspace:* + version: link:../catalog + '@start-route-modules/notes': + specifier: workspace:* + version: link:../notes + '@start-route-modules/settings': + specifier: workspace:* + version: link:../settings + '@start-route-modules/team': + specifier: workspace:* + version: link:../team + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../../../packages/react-router + '@tanstack/react-router-devtools': + specifier: workspace:^ + version: link:../../../../../packages/react-router-devtools + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../../../packages/react-start + react: + specifier: ^19.2.3 + version: 19.2.3 + react-dom: + specifier: ^19.2.3 + version: 19.2.3(react@19.2.3) + devDependencies: + '@rsbuild/core': + specifier: ^2.1.0 + version: 2.2.5 + '@rsbuild/plugin-react': + specifier: ^2.0.0 + version: 2.0.0(@rsbuild/core@2.2.5)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + srvx: + specifier: ^1.0.0 + version: 1.0.5 + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/rsbuild: dependencies: @@ -3219,10 +3655,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3265,10 +3701,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/eslint-plugin-start': specifier: workspace:^ version: link:../../../packages/eslint-plugin-start @@ -3289,10 +3725,10 @@ importers: version: 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': specifier: ^0.5.37 - version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint: specifier: ^9.22.0 version: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) @@ -3304,7 +3740,7 @@ importers: version: 5.9.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/rsc-deferred-hydration: dependencies: @@ -3341,10 +3777,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': specifier: ^0.5.37 - version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3353,7 +3789,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/rsc-query: dependencies: @@ -3399,10 +3835,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': specifier: ^0.5.37 - version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3411,7 +3847,7 @@ importers: version: 5.9.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/rsc-rsbuild: dependencies: @@ -3433,10 +3869,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3488,7 +3924,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3506,7 +3942,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -3521,7 +3957,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/selective-ssr: dependencies: @@ -3546,7 +3982,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3564,7 +4000,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3576,7 +4012,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/serialization-adapters: dependencies: @@ -3601,7 +4037,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3619,7 +4055,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3631,7 +4067,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/server-functions: dependencies: @@ -3674,16 +4110,16 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3704,7 +4140,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -3719,7 +4155,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/server-functions-global-middleware: dependencies: @@ -3741,7 +4177,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3759,7 +4195,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3771,7 +4207,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/server-routes: dependencies: @@ -3814,7 +4250,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3835,7 +4271,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -3850,7 +4286,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/server-routes-global-middleware: dependencies: @@ -3872,7 +4308,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3890,7 +4326,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3902,7 +4338,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/session-handling: dependencies: @@ -3936,10 +4372,10 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -3954,7 +4390,7 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -3963,7 +4399,7 @@ importers: version: 6.0.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/spa-mode: dependencies: @@ -3985,7 +4421,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -4009,7 +4445,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/split-base-and-basepath: dependencies: @@ -4049,7 +4485,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -4058,7 +4494,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/start-manifest: dependencies: @@ -4095,7 +4531,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: specifier: ^3.0.260903-beta version: 3.0.260903-beta @@ -4104,7 +4540,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/static-server-functions: dependencies: @@ -4147,13 +4583,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/streaming-ssr: dependencies: @@ -4196,7 +4632,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -4205,7 +4641,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/transform-asset-urls: dependencies: @@ -4245,7 +4681,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -4254,7 +4690,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/virtual-routes: dependencies: @@ -4291,7 +4727,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -4309,7 +4745,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -4324,7 +4760,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/react-start/website: dependencies: @@ -4358,7 +4794,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -4376,7 +4812,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -4388,7 +4824,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/solid-router/basepath-file-based: dependencies: @@ -4413,16 +4849,16 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4447,10 +4883,10 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-esbuild-file-based: dependencies: @@ -4490,7 +4926,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -4524,16 +4960,16 @@ importers: version: 1.1.11 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-file-based-code-splitting: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -4564,16 +5000,16 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4604,16 +5040,16 @@ importers: version: 5.9.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-solid-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': specifier: ^5.102.0 version: 5.102.0(solid-js@1.9.12) @@ -4644,16 +5080,16 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-solid-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -4690,16 +5126,16 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -4733,16 +5169,16 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/basic-virtual-named-export-config-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -4776,16 +5212,16 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/generator-cli-only: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-cli': specifier: workspace:* version: link:../../../packages/router-cli @@ -4813,16 +5249,16 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/js-only-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -4850,10 +5286,69 @@ importers: version: link:../../../packages/router-plugin vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + e2e/solid-router/route-modules: + dependencies: + '@route-modules/solid-settings': + specifier: workspace:* + version: link:packages/settings + '@tanstack/solid-router': + specifier: workspace:^ + version: link:../../../packages/solid-router + solid-js: + specifier: 1.9.12 + version: 1.9.12 + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../packages/router-core + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@tanstack/router-generator': + specifier: workspace:* + version: link:../../../packages/router-generator + '@tanstack/router-plugin': + specifier: workspace:* + version: link:../../../packages/router-plugin + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-solid: + specifier: ^2.11.11 + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + e2e/solid-router/route-modules/packages/settings: + dependencies: + '@tanstack/solid-router': + specifier: workspace:^ + version: link:../../../../../packages/solid-router + solid-js: + specifier: 1.9.12 + version: 1.9.12 + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core e2e/solid-router/rspack-basic-file-based: dependencies: @@ -4875,13 +5370,13 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(solid-js@1.9.12)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -4924,13 +5419,13 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(solid-js@1.9.12)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -4960,7 +5455,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -4991,10 +5486,10 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/sentry-integration: dependencies: @@ -5009,7 +5504,7 @@ importers: version: 4.6.1(supports-color@10.2.2) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: workspace:^ version: link:../../../packages/solid-router @@ -5034,16 +5529,16 @@ importers: version: link:../../e2e-utils vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-router/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -5080,10 +5575,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/basic: dependencies: @@ -5123,19 +5618,19 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(solid-js@1.9.12)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5162,10 +5657,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/basic-auth: dependencies: @@ -5205,7 +5700,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5232,10 +5727,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/basic-cloudflare: dependencies: @@ -5254,13 +5749,13 @@ importers: devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) '@playwright/test': specifier: ^1.63.0 version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5278,10 +5773,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -5324,7 +5819,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5345,10 +5840,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/basic-tsr-config: dependencies: @@ -5385,10 +5880,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/csp: dependencies: @@ -5422,10 +5917,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/css-modules: dependencies: @@ -5462,10 +5957,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/custom-basepath: dependencies: @@ -5493,7 +5988,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5523,10 +6018,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/deferred-hydration: dependencies: @@ -5542,13 +6037,13 @@ importers: devDependencies: '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(solid-js@1.9.12)(supports-color@10.2.2) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5566,10 +6061,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/dev-ssr-styles: dependencies: @@ -5606,10 +6101,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/query-integration: dependencies: @@ -5646,7 +6141,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5664,10 +6159,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/scroll-restoration: dependencies: @@ -5698,7 +6193,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5722,10 +6217,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/selective-ssr: dependencies: @@ -5744,7 +6239,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5762,10 +6257,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/serialization-adapters: dependencies: @@ -5787,7 +6282,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5808,10 +6303,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/server-functions: dependencies: @@ -5851,7 +6346,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5878,10 +6373,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/server-routes: dependencies: @@ -5921,7 +6416,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -5948,10 +6443,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/solid-query-layout-suspense: dependencies: @@ -5985,10 +6480,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/spa-mode: dependencies: @@ -6010,7 +6505,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -6025,10 +6520,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/start-manifest: dependencies: @@ -6062,10 +6557,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/streaming-ssr: dependencies: @@ -6105,10 +6600,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/virtual-routes: dependencies: @@ -6142,7 +6637,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -6166,10 +6661,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/solid-start/website: dependencies: @@ -6200,7 +6695,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -6221,16 +6716,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) e2e/vue-router/basepath-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -6264,16 +6759,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -6282,7 +6777,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6307,13 +6802,13 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -6383,7 +6878,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -6423,10 +6918,10 @@ importers: version: 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) eslint-plugin-vue: specifier: ^9.33.0 version: 9.33.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) @@ -6435,7 +6930,7 @@ importers: version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-eslint-parser: specifier: ^9.4.3 version: 9.4.3(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) @@ -6447,7 +6942,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -6478,16 +6973,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -6496,7 +6991,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6524,16 +7019,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3)) typescript: specifier: ~5.9.0 version: 5.9.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.9.3) @@ -6542,7 +7037,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -6579,16 +7074,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -6597,7 +7092,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -6634,16 +7129,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -6652,7 +7147,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-query': specifier: ^5.102.0 version: 5.102.0(vue@3.5.25(typescript@5.8.3)) @@ -6683,16 +7178,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -6701,7 +7196,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -6738,16 +7233,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -6756,7 +7251,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-cli': specifier: workspace:* version: link:../../../packages/router-cli @@ -6784,16 +7279,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -6802,16 +7297,16 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin '@tanstack/vue-query': specifier: ^5.102.0 - version: 5.102.0(vue@3.5.25(typescript@7.0.2)) + version: 5.102.0(vue@3.5.25(typescript@6.0.2)) '@tanstack/vue-query-devtools': specifier: ^6.1.2 - version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@7.0.2)))(vue@3.5.25(typescript@7.0.2)) + version: 6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -6826,7 +7321,7 @@ importers: version: 4.2.2 vue: specifier: ^3.5.16 - version: 3.5.25(typescript@7.0.2) + version: 3.5.25(typescript@6.0.2) devDependencies: '@playwright/test': specifier: ^1.63.0 @@ -6836,13 +7331,72 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@7.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@7.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + e2e/vue-router/route-modules: + dependencies: + '@route-modules/vue-settings': + specifier: workspace:* + version: link:packages/settings + '@tanstack/vue-router': + specifier: workspace:* + version: link:../../../packages/vue-router + vue: + specifier: ^3.5.16 + version: 3.5.25(typescript@6.0.2) + devDependencies: + '@playwright/test': + specifier: ^1.63.0 + version: 1.63.0 + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../packages/router-core + '@tanstack/router-e2e-utils': + specifier: workspace:^ + version: link:../../e2e-utils + '@tanstack/router-generator': + specifier: workspace:* + version: link:../../../packages/router-generator + '@tanstack/router-plugin': + specifier: workspace:* + version: link:../../../packages/router-plugin + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@vitejs/plugin-vue-jsx': + specifier: ^5.1.5 + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2)) + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: + specifier: 'catalog:' + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + + e2e/vue-router/route-modules/packages/settings: + dependencies: + '@tanstack/vue-router': + specifier: workspace:* + version: link:../../../../../packages/vue-router + vue: + specifier: ^3.5.16 + version: 3.5.25(typescript@6.0.2) + devDependencies: + '@tanstack/router-cli': + specifier: workspace:* + version: link:../../../../../packages/router-cli + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../../../packages/router-core e2e/vue-router/rspack-basic-file-based: dependencies: @@ -6864,16 +7418,16 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@rsbuild/plugin-vue': specifier: ^1.2.7 - version: 1.2.7(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 1.2.7(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) '@rsbuild/plugin-vue-jsx': specifier: ^2.0.0 - version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -6922,16 +7476,16 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@rsbuild/plugin-vue': specifier: ^1.2.7 - version: 1.2.7(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 1.2.7(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) '@rsbuild/plugin-vue-jsx': specifier: ^2.0.0 - version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 @@ -6964,7 +7518,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -6995,16 +7549,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -7022,7 +7576,7 @@ importers: version: 10.32.0(@tanstack/vue-router@packages+vue-router)(vue@3.5.25(typescript@5.8.3)) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-router': specifier: workspace:* version: link:../../../packages/vue-router @@ -7047,13 +7601,13 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -7062,7 +7616,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -7096,16 +7650,16 @@ importers: version: link:../../e2e-utils '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -7148,22 +7702,22 @@ importers: version: 1.63.0 '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@rsbuild/plugin-vue': specifier: ^1.2.7 - version: 1.2.7(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 1.2.7(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) '@rsbuild/plugin-vue-jsx': specifier: ^2.0.0 - version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@tailwindcss/postcss': specifier: ^4.2.2 version: 4.2.2 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7178,10 +7732,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -7196,7 +7750,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/basic-auth: dependencies: @@ -7236,7 +7790,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7248,10 +7802,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) dotenv: specifier: ^17.2.3 version: 17.2.3 @@ -7269,7 +7823,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/basic-cloudflare: dependencies: @@ -7288,13 +7842,13 @@ importers: devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) '@playwright/test': specifier: ^1.63.0 version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7306,10 +7860,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -7318,7 +7872,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -7349,10 +7903,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) rimraf: specifier: 'catalog:' version: 6.1.2 @@ -7364,7 +7918,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/basic-vue-query: dependencies: @@ -7404,7 +7958,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7416,10 +7970,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -7431,7 +7985,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/css-modules: dependencies: @@ -7459,7 +8013,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) sass: specifier: ^1.97.2 version: 1.97.2 @@ -7471,7 +8025,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/custom-basepath: dependencies: @@ -7499,7 +8053,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7514,10 +8068,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) cross-env: specifier: ^10.0.0 version: 10.0.0 @@ -7535,7 +8089,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/dev-ssr-styles: dependencies: @@ -7566,10 +8120,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -7578,7 +8132,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/query-integration: dependencies: @@ -7615,7 +8169,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7627,10 +8181,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -7639,7 +8193,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/scroll-restoration: dependencies: @@ -7670,7 +8224,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7682,10 +8236,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -7700,7 +8254,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/selective-ssr: dependencies: @@ -7719,7 +8273,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7728,10 +8282,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -7743,7 +8297,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(@typescript/typescript6@6.0.2) @@ -7768,7 +8322,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7777,10 +8331,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -7792,7 +8346,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(@typescript/typescript6@6.0.2) @@ -7835,7 +8389,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7850,10 +8404,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -7868,7 +8422,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/server-routes: dependencies: @@ -7908,7 +8462,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7923,10 +8477,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -7941,7 +8495,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/spa-mode: dependencies: @@ -7963,7 +8517,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -7972,10 +8526,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -7984,7 +8538,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/start-manifest: dependencies: @@ -8012,7 +8566,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -8021,7 +8575,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/streaming-ssr: dependencies: @@ -8055,7 +8609,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -8064,7 +8618,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/virtual-routes: dependencies: @@ -8098,7 +8652,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -8110,10 +8664,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) combinate: specifier: ^1.1.11 version: 1.1.11 @@ -8128,7 +8682,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) e2e/vue-start/website: dependencies: @@ -8159,7 +8713,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-e2e-utils': specifier: workspace:^ version: link:../../e2e-utils @@ -8171,10 +8725,10 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) srvx: specifier: ^1.0.0 version: 1.0.5 @@ -8186,13 +8740,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/authenticated-routes: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8229,19 +8783,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/authenticated-routes-firebase: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8284,19 +8838,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8327,19 +8881,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-default-search-params: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -8376,19 +8930,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-devtools-panel: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -8425,19 +8979,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8474,19 +9028,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-non-nested-devtools: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8517,19 +9071,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-react-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -8566,19 +9120,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-react-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -8621,13 +9175,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-ssr-file-based: dependencies: @@ -8673,13 +9227,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-ssr-streaming-file-based: dependencies: @@ -8725,19 +9279,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8777,19 +9331,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/basic-virtual-inside-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8829,19 +9383,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/deferred-data: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8875,19 +9429,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/i18n-paraglide: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8921,19 +9475,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/kitchen-sink: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -8970,19 +9524,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/kitchen-sink-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9022,19 +9576,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/kitchen-sink-react-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -9077,19 +9631,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/kitchen-sink-react-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -9135,19 +9689,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/large-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -9187,13 +9741,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/location-masking: dependencies: @@ -9202,7 +9756,7 @@ importers: version: 1.1.7(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -9236,19 +9790,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/navigation-blocking: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -9282,19 +9836,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/quickstart: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9322,13 +9876,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/quickstart-esbuild-file-based: dependencies: @@ -9368,7 +9922,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -9405,13 +9959,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/quickstart-rspack-file-based: dependencies: @@ -9439,10 +9993,10 @@ importers: devDependencies: '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -9552,16 +10106,16 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-react-query/packages/app: dependencies: @@ -9583,7 +10137,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router-devtools': specifier: workspace:^ version: link:../../../../../packages/react-router-devtools @@ -9598,7 +10152,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -9607,10 +10161,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-react-query/packages/post-feature: dependencies: @@ -9641,16 +10195,16 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-react-query/packages/post-query: dependencies: @@ -9669,13 +10223,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/router-monorepo-react-query/packages/router: dependencies: @@ -9718,16 +10272,16 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple: dependencies: @@ -9764,16 +10318,16 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple-lazy: dependencies: @@ -9810,16 +10364,16 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple-lazy/packages/app: dependencies: @@ -9838,7 +10392,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router-devtools': specifier: workspace:^ version: link:../../../../../packages/react-router-devtools @@ -9853,7 +10407,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -9862,10 +10416,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple-lazy/packages/post-feature: dependencies: @@ -9893,16 +10447,16 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple-lazy/packages/router: dependencies: @@ -9939,16 +10493,16 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple/packages/app: dependencies: @@ -9967,7 +10521,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router-devtools': specifier: workspace:^ version: link:../../../../../packages/react-router-devtools @@ -9982,7 +10536,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -9991,10 +10545,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple/packages/post-feature: dependencies: @@ -10019,16 +10573,16 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/router-monorepo-simple/packages/router: dependencies: @@ -10065,22 +10619,22 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -10111,19 +10665,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/search-validator-adapters: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/arktype-adapter': specifier: workspace:* version: link:../../../packages/arktype-adapter @@ -10181,7 +10735,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) jsdom: specifier: ^27.0.0 version: 27.0.0(supports-color@10.2.2) @@ -10190,10 +10744,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: ^5.0.4 - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/react/start-bare: dependencies: @@ -10230,13 +10784,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic: dependencies: @@ -10264,7 +10818,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10279,7 +10833,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: specifier: ^3.0.260903-beta version: 3.0.260903-beta @@ -10291,7 +10845,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic-auth: dependencies: @@ -10331,7 +10885,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10346,7 +10900,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) dotenv: specifier: ^17.2.3 version: 17.2.3 @@ -10361,7 +10915,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic-authjs: dependencies: @@ -10392,7 +10946,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10407,7 +10961,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -10416,7 +10970,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic-cloudflare: dependencies: @@ -10438,10 +10992,10 @@ importers: devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10456,7 +11010,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -10465,7 +11019,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -10508,7 +11062,7 @@ importers: version: 1.63.0 '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10523,7 +11077,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -10532,7 +11086,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-basic-rsbuild: dependencies: @@ -10560,13 +11114,13 @@ importers: devDependencies: '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-react': specifier: ^2.0.0 - version: 2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23)) + version: 2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) '@rsbuild/plugin-tailwindcss': specifier: ^2.0.3 - version: 2.0.3(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(webpack@5.110.3) + version: 2.0.3(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))(webpack@5.110.3) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10605,7 +11159,7 @@ importers: version: link:../../../packages/start-static-server-functions '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) react: specifier: ^19.2.3 version: 19.2.3 @@ -10621,7 +11175,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10642,13 +11196,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-bun: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-devtools': specifier: ^0.7.0 version: 0.7.0(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(csstype@3.2.3)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12) @@ -10679,7 +11233,7 @@ importers: devDependencies: '@tanstack/eslint-config': specifier: ^0.3.2 - version: 0.3.2(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 0.3.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 @@ -10703,7 +11257,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) jsdom: specifier: ^27.0.0 version: 27.0.0(supports-color@10.2.2) @@ -10715,10 +11269,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: ^5.0.4 - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) web-vitals: specifier: ^5.1.0 version: 5.1.0 @@ -10739,7 +11293,7 @@ importers: version: link:../../../packages/react-start '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) react: specifier: ^19.2.3 version: 19.2.3 @@ -10758,7 +11312,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10779,7 +11333,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-convex-trellaux: dependencies: @@ -10837,7 +11391,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10852,7 +11406,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -10861,7 +11415,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-counter: dependencies: @@ -10895,13 +11449,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-i18n-paraglide: dependencies: @@ -10929,7 +11483,7 @@ importers: version: 2.4.0(babel-plugin-macros@3.1.0) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -10944,7 +11498,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -10953,7 +11507,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-large: dependencies: @@ -10987,7 +11541,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -11002,7 +11556,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -11011,7 +11565,62 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + examples/react/start-large-route-modules: + dependencies: + '@tanstack/react-router': + specifier: workspace:* + version: link:../../../packages/react-router + '@tanstack/react-start': + specifier: workspace:* + version: link:../../../packages/react-start + react: + specifier: ^19.2.3 + version: 19.2.3 + react-dom: + specifier: ^19.2.3 + version: 19.2.3(react@19.2.3) + devDependencies: + '@rsbuild/core': + specifier: ^2.1.0 + version: 2.2.5 + '@rsbuild/plugin-react': + specifier: ^2.0.0 + version: 2.0.0(@rsbuild/core@2.2.5)(@rspack/core@2.2.7(@swc/helpers@0.5.23)) + '@tanstack/router-core': + specifier: workspace:* + version: link:../../../packages/router-core + '@tanstack/router-generator': + specifier: workspace:* + version: link:../../../packages/router-generator + '@tanstack/start-client-core': + specifier: workspace:* + version: link:../../../packages/start-client-core + '@types/node': + specifier: 25.0.9 + version: 25.0.9 + '@types/react': + specifier: ^19.2.8 + version: 19.2.9 + '@types/react-dom': + specifier: ^19.2.3 + version: 19.2.3(@types/react@19.2.9) + '@typescript/native': + specifier: npm:typescript@^7.0.2 + version: typescript@7.0.2 + '@vitejs/plugin-react': + specifier: ^6.0.1 + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + srvx: + specifier: ^1.0.0 + version: 1.0.5 + typescript: + specifier: npm:@typescript/typescript6@^6.0.2 + version: '@typescript/typescript6@6.0.2' + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-material-ui: dependencies: @@ -11063,13 +11672,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-next-migration: dependencies: @@ -11106,7 +11715,7 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: specifier: ^3.0.260903-beta version: 3.0.260903-beta @@ -11115,7 +11724,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-rscs: dependencies: @@ -11149,7 +11758,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.1.18 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -11161,10 +11770,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': specifier: ^0.5.37 - version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) nitro: specifier: ^3.0.260903-beta version: 3.0.260903-beta @@ -11176,7 +11785,7 @@ importers: version: 5.9.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-streaming-data-from-server-functions: dependencies: @@ -11213,13 +11822,13 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-supabase-basic: dependencies: @@ -11250,7 +11859,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/react': specifier: ^19.2.8 version: 19.2.9 @@ -11262,7 +11871,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -11271,7 +11880,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-tailwind-v4: dependencies: @@ -11299,7 +11908,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -11314,7 +11923,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -11323,7 +11932,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-trellaux: dependencies: @@ -11372,7 +11981,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -11387,7 +11996,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tailwindcss: specifier: ^4.2.2 version: 4.2.2 @@ -11396,7 +12005,7 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/start-workos: dependencies: @@ -11433,19 +12042,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -11482,19 +12091,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/with-framer-motion: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -11531,19 +12140,19 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/with-trpc: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-router': specifier: workspace:* version: link:../../../packages/react-router @@ -11589,19 +12198,19 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tsx: specifier: ^4.20.3 version: 4.20.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/react/with-trpc-react-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/react-query': specifier: ^5.102.0 version: 5.102.0(react@19.2.3) @@ -11656,19 +12265,19 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: ^6.0.1 - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) tsx: specifier: ^4.20.3 version: 4.20.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) examples/solid/authenticated-routes: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -11699,16 +12308,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/authenticated-routes-firebase: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -11745,16 +12354,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -11785,16 +12394,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-default-search-params: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': specifier: ^5.102.0 version: 5.102.0(solid-js@1.9.12) @@ -11825,16 +12434,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-devtools-panel: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -11859,16 +12468,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -11899,16 +12508,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-non-nested-devtools: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -11939,16 +12548,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-solid-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': specifier: ^5.102.0 version: 5.102.0(solid-js@1.9.12) @@ -11982,16 +12591,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-solid-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': specifier: ^5.102.0 version: 5.102.0(solid-js@1.9.12) @@ -12028,10 +12637,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-ssr-file-based: dependencies: @@ -12071,16 +12680,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-ssr-streaming-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -12126,16 +12735,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-virtual-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -12169,16 +12778,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/basic-virtual-inside-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -12212,16 +12821,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/deferred-data: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -12249,16 +12858,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/i18n-paraglide: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -12286,16 +12895,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/kitchen-sink: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -12326,16 +12935,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/kitchen-sink-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -12369,16 +12978,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/kitchen-sink-solid-query: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': specifier: ^5.102.0 version: 5.102.0(solid-js@1.9.12) @@ -12415,16 +13024,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/kitchen-sink-solid-query-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -12464,16 +13073,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/large-file-based: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -12507,16 +13116,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/location-masking: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': specifier: ^5.102.0 version: 5.102.0(solid-js@1.9.12) @@ -12544,16 +13153,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/navigation-blocking: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-query': specifier: ^5.102.0 version: 5.102.0(solid-js@1.9.12) @@ -12581,16 +13190,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/quickstart: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -12612,10 +13221,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/quickstart-esbuild-file-based: dependencies: @@ -12652,7 +13261,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -12683,10 +13292,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/quickstart-rspack-file-based: dependencies: @@ -12711,13 +13320,13 @@ importers: devDependencies: '@rsbuild/core': specifier: ^2.3.1 - version: 2.3.1 + version: 2.3.2 '@rsbuild/plugin-babel': specifier: ^1.1.2 - version: 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + version: 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@rsbuild/plugin-solid': specifier: ^1.1.1 - version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2) + version: 1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(solid-js@1.9.12)(supports-color@10.2.2) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -12781,13 +13390,13 @@ importers: version: '@typescript/typescript6@6.0.2' webpack: specifier: ^5.97.1 - version: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack-cli@5.1.4) + version: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) webpack-cli: specifier: ^5.1.4 version: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) webpack-dev-server: specifier: ^5.2.4 - version: 5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1) + version: 5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1) examples/solid/router-monorepo-simple: dependencies: @@ -12818,13 +13427,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/router-monorepo-simple-lazy: dependencies: @@ -12855,13 +13464,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/router-monorepo-solid-query: dependencies: @@ -12898,19 +13507,19 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-dts: specifier: 4.2.3 - version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/scroll-restoration: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -12935,16 +13544,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/search-validator-adapters: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/arktype-adapter': specifier: workspace:* version: link:../../../packages/arktype-adapter @@ -12999,13 +13608,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: ^5.0.4 - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic: dependencies: @@ -13030,7 +13639,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13048,10 +13657,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-auth: dependencies: @@ -13088,7 +13697,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13109,10 +13718,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-authjs: dependencies: @@ -13140,7 +13749,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13155,10 +13764,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-cloudflare: dependencies: @@ -13177,10 +13786,10 @@ importers: devDependencies: '@cloudflare/vite-plugin': specifier: ^1.29.0 - version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0) + version: 1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13195,10 +13804,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) wrangler: specifier: ^4.74.0 version: 4.75.0 @@ -13220,10 +13829,10 @@ importers: devDependencies: '@netlify/vite-plugin-tanstack-start': specifier: ^1.3.19 - version: 1.3.19(@tanstack/solid-start@packages+solid-start)(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 1.3.19(@tanstack/solid-start@packages+solid-start)(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13238,10 +13847,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-nitro: dependencies: @@ -13260,7 +13869,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13278,10 +13887,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-solid-query: dependencies: @@ -13315,7 +13924,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13330,10 +13939,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-basic-static: dependencies: @@ -13361,7 +13970,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13376,16 +13985,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-bun: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -13416,7 +14025,7 @@ importers: version: 0.8.10(solid-js@1.9.12) '@tanstack/eslint-config': specifier: ^0.3.2 - version: 0.3.2(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + version: 0.3.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@testing-library/dom': specifier: ^10.4.1 version: 10.4.1 @@ -13440,13 +14049,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: ^5.0.4 - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) web-vitals: specifier: ^5.1.0 version: 5.1.0 @@ -13455,10 +14064,10 @@ importers: dependencies: '@convex-dev/better-auth': specifier: ^0.9.7 - version: 0.9.7(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)))(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.13.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + version: 0.9.7(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.97.2))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)))(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.13.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -13470,7 +14079,7 @@ importers: version: link:../../../packages/solid-start better-auth: specifier: ^1.6.19 - version: 1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.97.2))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)) clsx: specifier: ^2.1.1 version: 2.1.1 @@ -13510,10 +14119,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-counter: dependencies: @@ -13553,10 +14162,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-i18n-paraglide: dependencies: @@ -13581,7 +14190,7 @@ importers: version: 2.4.0(babel-plugin-macros@3.1.0) '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13596,10 +14205,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-large: dependencies: @@ -13630,7 +14239,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13645,10 +14254,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-streaming-data-from-server-functions: dependencies: @@ -13679,10 +14288,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-supabase-basic: dependencies: @@ -13710,7 +14319,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13725,10 +14334,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/start-tailwind-v4: dependencies: @@ -13753,7 +14362,7 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -13768,16 +14377,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/view-transitions: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -13808,16 +14417,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/with-framer-motion: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/solid-router': specifier: ^1.170.43 version: link:../../../packages/solid-router @@ -13848,16 +14457,16 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/solid/with-trpc: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -13897,10 +14506,10 @@ importers: version: 4.20.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.11 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) examples/vue/basic: dependencies: @@ -13922,22 +14531,22 @@ importers: devDependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@typescript/native': specifier: npm:typescript@^7.0.2 version: typescript@7.0.2 '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) typescript: specifier: npm:@typescript/typescript6@^6.0.2 version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(@typescript/typescript6@6.0.2) @@ -13946,7 +14555,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -13980,10 +14589,10 @@ importers: version: 8.44.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.8.3) '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) eslint-plugin-vue: specifier: ^9.33.0 version: 9.33.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) @@ -13992,7 +14601,7 @@ importers: version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-eslint-parser: specifier: ^9.4.3 version: 9.4.3(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) @@ -14004,7 +14613,7 @@ importers: dependencies: '@tailwindcss/vite': specifier: ^4.2.2 - version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/router-plugin': specifier: workspace:* version: link:../../../packages/router-plugin @@ -14029,16 +14638,16 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: ^6.0.5 - version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) '@vitejs/plugin-vue-jsx': specifier: ^5.1.5 - version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) + version: 5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3)) typescript: specifier: ~5.8.3 version: 5.8.3 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue-tsc: specifier: ^3.3.8 version: 3.3.8(typescript@5.8.3) @@ -14053,7 +14662,7 @@ importers: version: link:../react-router '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': specifier: 'catalog:' version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) @@ -14086,10 +14695,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/eslint-plugin-router: dependencies: @@ -14102,7 +14711,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@typescript-eslint/rule-tester': specifier: ^8.23.0 version: 8.23.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) @@ -14120,10 +14729,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/eslint-plugin-start: dependencies: @@ -14139,7 +14748,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(rollup@4.63.1)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@typescript-eslint/rule-tester': specifier: ^8.44.1 version: 8.53.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(typescript@5.9.2) @@ -14157,7 +14766,7 @@ importers: version: 5.9.2 vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/history: devDependencies: @@ -14166,7 +14775,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) jsdom: specifier: 'catalog:' version: 25.0.1(supports-color@10.2.2) @@ -14178,10 +14787,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-router: dependencies: @@ -14209,7 +14818,7 @@ importers: version: 5.102.0(react@19.2.3) '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': specifier: 'catalog:' version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) @@ -14227,7 +14836,7 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: 'catalog:' - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) combinate: specifier: 'catalog:' version: 1.1.11 @@ -14251,10 +14860,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) zod: specifier: 'catalog:' version: 4.5.4 @@ -14279,7 +14888,7 @@ importers: version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -14291,7 +14900,7 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: 'catalog:' - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-react-hooks: specifier: 'catalog:' version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) @@ -14312,10 +14921,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-router-ssr-query: dependencies: @@ -14340,7 +14949,7 @@ importers: version: link:../react-router '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/react': specifier: ^19.2.8 version: 19.2.9 @@ -14349,7 +14958,7 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: 'catalog:' - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-react-hooks: specifier: 'catalog:' version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) @@ -14370,10 +14979,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-start: dependencies: @@ -14404,9 +15013,6 @@ importers: pathe: specifier: 'catalog:' version: 2.0.3 - vite: - specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) devDependencies: '@arethetypeswrong/cli': specifier: 'catalog:' @@ -14416,10 +15022,13 @@ importers: version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@rsbuild/core': specifier: 'catalog:' - version: 2.3.1 + version: 2.3.2 + '@tanstack/router-generator': + specifier: workspace:* + version: link:../router-generator '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -14429,6 +15038,9 @@ importers: '@types/react-dom': specifier: ^19.2.3 version: 19.2.3(@types/react@19.2.9) + '@vitejs/plugin-react': + specifier: 'catalog:' + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-react-hooks: specifier: 'catalog:' version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) @@ -14447,9 +15059,12 @@ importers: rimraf: specifier: 'catalog:' version: 6.1.2 + vite: + specifier: ^8.3.4 + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-start-client: dependencies: @@ -14471,7 +15086,7 @@ importers: version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/react': specifier: 'catalog:' version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) @@ -14486,7 +15101,7 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: 'catalog:' - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-react-hooks: specifier: 'catalog:' version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) @@ -14507,10 +15122,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-start-rsc: dependencies: @@ -14550,7 +15165,7 @@ importers: version: 2.2.7(@swc/helpers@0.5.23) '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/react': specifier: 'catalog:' version: 16.3.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) @@ -14562,10 +15177,10 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: 'catalog:' - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-rsc': specifier: ^0.5.37 - version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-react-hooks: specifier: 'catalog:' version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) @@ -14589,7 +15204,7 @@ importers: version: 6.1.2 vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/react-start-server: dependencies: @@ -14611,7 +15226,7 @@ importers: version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/react': specifier: ^19.2.8 version: 19.2.9 @@ -14623,7 +15238,7 @@ importers: version: typescript@7.0.2 '@vitejs/plugin-react': specifier: 'catalog:' - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-react-hooks: specifier: 'catalog:' version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) @@ -14647,10 +15262,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-cli: dependencies: @@ -14662,14 +15277,14 @@ importers: version: 7.1.0 chokidar: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 devDependencies: '@arethetypeswrong/cli': specifier: 'catalog:' version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -14681,10 +15296,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-core: dependencies: @@ -14709,7 +15324,7 @@ importers: version: 0.11.2 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -14752,7 +15367,7 @@ importers: version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/react': specifier: ^19.2.8 version: 19.2.9 @@ -14761,7 +15376,7 @@ importers: version: 19.2.3(@types/react@19.2.9) '@vitejs/plugin-react': specifier: 'catalog:' - version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-react-hooks: specifier: 'catalog:' version: 5.1.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) @@ -14779,10 +15394,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-devtools-core: dependencies: @@ -14804,7 +15419,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': specifier: 'catalog:' version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) @@ -14822,13 +15437,13 @@ importers: version: 1.9.12 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: 'catalog:' - version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-generator: dependencies: @@ -14865,7 +15480,7 @@ importers: version: link:../react-router '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -14883,10 +15498,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-plugin: dependencies: @@ -14913,16 +15528,16 @@ importers: version: link:../router-utils chokidar: specifier: 'catalog:' - version: 5.0.0 + version: 6.0.0 unplugin: specifier: ^3.5.0 - version: 3.7.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(esbuild@0.28.2)(rolldown@1.2.13)(rollup@4.63.1)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(webpack@5.110.3) + version: 3.7.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))(esbuild@0.28.1)(rolldown@1.2.13)(rollup@4.63.1)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(webpack@5.110.3) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: ^2.11.10 || ^3.0.0-0 - version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.15(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) zod: specifier: 'catalog:' version: 4.5.4 @@ -14932,10 +15547,10 @@ importers: version: 0.18.4 '@rsbuild/core': specifier: 'catalog:' - version: 2.3.1 + version: 2.3.2 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/babel__core': specifier: ^7.20.5 version: 7.20.5 @@ -14971,10 +15586,10 @@ importers: version: 6.1.2 vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) webpack: specifier: ^5.104.1 - version: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + version: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.4(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) packages/router-ssr-query-core: devDependencies: @@ -14989,7 +15604,7 @@ importers: version: link:../router-core '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) jsdom: specifier: 'catalog:' version: 25.0.1(supports-color@10.2.2) @@ -15001,10 +15616,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-utils: dependencies: @@ -15038,7 +15653,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/babel__generator': specifier: ^7.27.0 version: 7.27.0 @@ -15053,10 +15668,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/router-vite-plugin: dependencies: @@ -15069,7 +15684,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) publint: specifier: 'catalog:' version: 0.3.17 @@ -15078,10 +15693,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-router: dependencies: @@ -15109,7 +15724,7 @@ importers: version: 0.8.10(solid-js@1.9.12) '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': specifier: 'catalog:' version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) @@ -15133,13 +15748,13 @@ importers: version: 1.9.12 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: 'catalog:' - version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) zod: specifier: 'catalog:' version: 4.5.4 @@ -15161,7 +15776,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -15176,13 +15791,13 @@ importers: version: 1.9.12 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: 'catalog:' - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-router-ssr-query: dependencies: @@ -15204,7 +15819,7 @@ importers: version: link:../solid-router '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) eslint-plugin-solid: specifier: ^0.14.5 version: 0.14.5(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) @@ -15222,13 +15837,13 @@ importers: version: 1.9.12 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: 'catalog:' - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-start: dependencies: @@ -15265,13 +15880,16 @@ importers: version: 1.26.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)(ts-api-utils@2.4.0(@typescript/typescript6@6.0.2)) '@rsbuild/core': specifier: 'catalog:' - version: 2.3.1 + version: 2.3.2 + '@tanstack/router-generator': + specifier: workspace:* + version: link:../router-generator '@tanstack/router-utils': specifier: workspace:* version: link:../router-utils '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -15289,10 +15907,13 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-solid: + specifier: ^2.11.11 + version: 2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-start-client: dependencies: @@ -15314,7 +15935,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': specifier: 'catalog:' version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) @@ -15329,13 +15950,13 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: 'catalog:' - version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/solid-start-server: dependencies: @@ -15354,7 +15975,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@typescript/native': specifier: npm:typescript@^7.0.2 version: typescript@7.0.2 @@ -15375,13 +15996,13 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vite-plugin-solid: specifier: 'catalog:' - version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-client-core: dependencies: @@ -15403,7 +16024,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -15418,10 +16039,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-fn-stubs: devDependencies: @@ -15430,7 +16051,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) publint: specifier: 'catalog:' version: 0.3.17 @@ -15439,10 +16060,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-plugin-core: dependencies: @@ -15502,7 +16123,7 @@ importers: version: 1.6.4 vitefu: specifier: ^1.1.3 - version: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) xmlbuilder2: specifier: ^4.0.3 version: 4.0.3 @@ -15515,10 +16136,10 @@ importers: version: 0.18.4 '@rsbuild/core': specifier: 'catalog:' - version: 2.3.1 + version: 2.3.2 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/babel__code-frame': specifier: ^7.0.6 version: 7.0.6 @@ -15542,10 +16163,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-server-core: dependencies: @@ -15579,7 +16200,7 @@ importers: version: 1.0.0 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -15597,10 +16218,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-static-server-functions: dependencies: @@ -15622,7 +16243,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -15637,10 +16258,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/start-storage-context: dependencies: @@ -15653,7 +16274,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 @@ -15668,10 +16289,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/valibot-adapter: devDependencies: @@ -15683,7 +16304,7 @@ importers: version: link:../react-router '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': specifier: 'catalog:' version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) @@ -15713,13 +16334,13 @@ importers: version: 6.1.2 valibot: specifier: 1.0.0-beta.15 - version: 1.0.0-beta.15(typescript@7.0.2) + version: 1.0.0-beta.15(@typescript/typescript6@6.0.2) vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/virtual-file-routes: devDependencies: @@ -15728,7 +16349,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) jsdom: specifier: 'catalog:' version: 25.0.1(supports-color@10.2.2) @@ -15740,10 +16361,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) packages/vue-router: dependencies: @@ -15768,7 +16389,7 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': specifier: 'catalog:' version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) @@ -15780,7 +16401,7 @@ importers: version: 25.0.9 '@vitejs/plugin-vue-jsx': specifier: 'catalog:' - version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitest/ui': specifier: 'catalog:' version: 5.0.4(vitest@5.0.4) @@ -15798,10 +16419,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: specifier: 'catalog:' version: 3.5.25(@typescript/typescript6@6.0.2) @@ -15822,20 +16443,20 @@ importers: version: link:../vue-router vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) devDependencies: '@arethetypeswrong/cli': specifier: 'catalog:' version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 '@vitejs/plugin-vue-jsx': specifier: 'catalog:' - version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) publint: specifier: 'catalog:' version: 0.3.17 @@ -15844,7 +16465,7 @@ importers: version: 6.1.2 vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: specifier: 'catalog:' version: 3.5.25(@typescript/typescript6@6.0.2) @@ -15866,13 +16487,13 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@tanstack/vue-router': specifier: workspace:* version: link:../vue-router '@vitejs/plugin-vue-jsx': specifier: 'catalog:' - version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) publint: specifier: 'catalog:' version: 0.3.17 @@ -15881,10 +16502,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: specifier: 'catalog:' version: 3.5.25(@typescript/typescript6@6.0.2) @@ -15918,19 +16539,25 @@ importers: version: 0.18.4 '@rsbuild/core': specifier: 'catalog:' - version: 2.3.1 + version: 2.3.2 + '@tanstack/router-generator': + specifier: workspace:* + version: link:../router-generator '@tanstack/router-utils': specifier: workspace:* version: link:../router-utils '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@types/node': specifier: 25.0.9 version: 25.0.9 + '@vitejs/plugin-vue': + specifier: ^6.0.5 + version: 6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) '@vitejs/plugin-vue-jsx': specifier: 'catalog:' - version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) jsdom: specifier: 'catalog:' version: 25.0.1(supports-color@10.2.2) @@ -15942,10 +16569,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: specifier: 'catalog:' version: 3.5.25(@typescript/typescript6@6.0.2) @@ -15967,10 +16594,10 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitejs/plugin-vue-jsx': specifier: 'catalog:' - version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) jsdom: specifier: 'catalog:' version: 25.0.1(supports-color@10.2.2) @@ -15982,10 +16609,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: specifier: 'catalog:' version: 3.5.25(@typescript/typescript6@6.0.2) @@ -16007,13 +16634,13 @@ importers: version: 0.18.4 '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@typescript/native': specifier: npm:typescript@^7.0.2 version: typescript@7.0.2 '@vitejs/plugin-vue-jsx': specifier: 'catalog:' - version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) + version: 4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2)) jsdom: specifier: 'catalog:' version: 25.0.1(supports-color@10.2.2) @@ -16028,10 +16655,10 @@ importers: version: '@typescript/typescript6@6.0.2' vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: specifier: 'catalog:' version: 3.5.25(@typescript/typescript6@6.0.2) @@ -16046,7 +16673,7 @@ importers: version: link:../react-router '@tanstack/vite-config': specifier: 'catalog:' - version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/jest-dom': specifier: 'catalog:' version: 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) @@ -16076,10 +16703,10 @@ importers: version: 6.1.2 vite: specifier: ^8.3.4 - version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + version: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vitest: specifier: 'catalog:' - version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + version: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) zod: specifier: ^3.24.2 version: 3.25.57 @@ -16912,18 +17539,27 @@ packages: '@emnapi/core@1.4.5': resolution: {integrity: sha512-XsLw1dEOpkSX/WucdqUhPWP7hDxSvZiY+fsUC14h+FtQ2Ifni4znbBt8punRX+Uj2JG/uDb8nEHVKvrVlvdZ5Q==} + '@emnapi/core@2.0.0-beta.3': + resolution: {integrity: sha512-KA+gOBtbifRATmUa/Gpf5C2B2EJ0r4brHUT3XSgACeHREcuiObXH56xd+B3fFsEFbUT04VBEe6MuZiCtMp0tQg==} + '@emnapi/runtime@1.11.3': resolution: {integrity: sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==} '@emnapi/runtime@1.4.5': resolution: {integrity: sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==} + '@emnapi/runtime@2.0.0-beta.3': + resolution: {integrity: sha512-ayb/PyyLzpwRyFVxeC0uoEHu59QlB1iWGcGsOpXQcaB/Dc+uGfBmNmpCHp3HmTT0t8lSsMmg3j7+tdJW/TlHjQ==} + '@emnapi/wasi-threads@1.0.4': resolution: {integrity: sha512-PJR+bOmMOPH8AtcTGAyYNiuJ3/Fcoj2XN/gBEWzDIKh254XO+mM9XoXHk5GNEhodxeMznbg7BlRojVbKN+gC6g==} '@emnapi/wasi-threads@1.2.3': resolution: {integrity: sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g==} + '@emnapi/wasi-threads@2.2.0': + resolution: {integrity: sha512-JP7OYH38Q7+pyTAe14raZHLQIK7BDKbdwji+Xi3pcd/6QkJYQH3SX4wu6EplGrGJWRepoNzedfm0G3B9Z4e9Rw==} + '@emotion/babel-plugin@11.13.5': resolution: {integrity: sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==} @@ -17021,12 +17657,6 @@ packages: cpu: [ppc64] os: [aix] - '@esbuild/aix-ppc64@0.28.2': - resolution: {integrity: sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [aix] - '@esbuild/android-arm64@0.23.0': resolution: {integrity: sha512-EuHFUYkAVfU4qBdyivULuu03FhJO4IJN9PGuABGrFy4vUuzk91P2d+npxHcFdpUnfYKy0PuV+n6bKIpHOB3prQ==} engines: {node: '>=18'} @@ -17063,12 +17693,6 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm64@0.28.2': - resolution: {integrity: sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==} - engines: {node: '>=18'} - cpu: [arm64] - os: [android] - '@esbuild/android-arm@0.23.0': resolution: {integrity: sha512-+KuOHTKKyIKgEEqKbGTK8W7mPp+hKinbMBeEnNzjJGyFcWsfrXjSTNluJHCY1RqhxFurdD8uNXQDei7qDlR6+g==} engines: {node: '>=18'} @@ -17105,12 +17729,6 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-arm@0.28.2': - resolution: {integrity: sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==} - engines: {node: '>=18'} - cpu: [arm] - os: [android] - '@esbuild/android-x64@0.23.0': resolution: {integrity: sha512-WRrmKidLoKDl56LsbBMhzTTBxrsVwTKdNbKDalbEZr0tcsBgCLbEtoNthOW6PX942YiYq8HzEnb4yWQMLQuipQ==} engines: {node: '>=18'} @@ -17147,12 +17765,6 @@ packages: cpu: [x64] os: [android] - '@esbuild/android-x64@0.28.2': - resolution: {integrity: sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==} - engines: {node: '>=18'} - cpu: [x64] - os: [android] - '@esbuild/darwin-arm64@0.23.0': resolution: {integrity: sha512-YLntie/IdS31H54Ogdn+v50NuoWF5BDkEUFpiOChVa9UnKpftgwzZRrI4J132ETIi+D8n6xh9IviFV3eXdxfow==} engines: {node: '>=18'} @@ -17189,12 +17801,6 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-arm64@0.28.2': - resolution: {integrity: sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [darwin] - '@esbuild/darwin-x64@0.23.0': resolution: {integrity: sha512-IMQ6eme4AfznElesHUPDZ+teuGwoRmVuuixu7sv92ZkdQcPbsNHzutd+rAfaBKo8YK3IrBEi9SLLKWJdEvJniQ==} engines: {node: '>=18'} @@ -17231,12 +17837,6 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/darwin-x64@0.28.2': - resolution: {integrity: sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==} - engines: {node: '>=18'} - cpu: [x64] - os: [darwin] - '@esbuild/freebsd-arm64@0.23.0': resolution: {integrity: sha512-0muYWCng5vqaxobq6LB3YNtevDFSAZGlgtLoAc81PjUfiFz36n4KMpwhtAd4he8ToSI3TGyuhyx5xmiWNYZFyw==} engines: {node: '>=18'} @@ -17273,12 +17873,6 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-arm64@0.28.2': - resolution: {integrity: sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [freebsd] - '@esbuild/freebsd-x64@0.23.0': resolution: {integrity: sha512-XKDVu8IsD0/q3foBzsXGt/KjD/yTKBCIwOHE1XwiXmrRwrX6Hbnd5Eqn/WvDekddK21tfszBSrE/WMaZh+1buQ==} engines: {node: '>=18'} @@ -17315,12 +17909,6 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/freebsd-x64@0.28.2': - resolution: {integrity: sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==} - engines: {node: '>=18'} - cpu: [x64] - os: [freebsd] - '@esbuild/linux-arm64@0.23.0': resolution: {integrity: sha512-j1t5iG8jE7BhonbsEg5d9qOYcVZv/Rv6tghaXM/Ug9xahM0nX/H2gfu6X6z11QRTMT6+aywOMA8TDkhPo8aCGw==} engines: {node: '>=18'} @@ -17357,12 +17945,6 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm64@0.28.2': - resolution: {integrity: sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==} - engines: {node: '>=18'} - cpu: [arm64] - os: [linux] - '@esbuild/linux-arm@0.23.0': resolution: {integrity: sha512-SEELSTEtOFu5LPykzA395Mc+54RMg1EUgXP+iw2SJ72+ooMwVsgfuwXo5Fn0wXNgWZsTVHwY2cg4Vi/bOD88qw==} engines: {node: '>=18'} @@ -17399,12 +17981,6 @@ packages: cpu: [arm] os: [linux] - '@esbuild/linux-arm@0.28.2': - resolution: {integrity: sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==} - engines: {node: '>=18'} - cpu: [arm] - os: [linux] - '@esbuild/linux-ia32@0.23.0': resolution: {integrity: sha512-P7O5Tkh2NbgIm2R6x1zGJJsnacDzTFcRWZyTTMgFdVit6E98LTxO+v8LCCLWRvPrjdzXHx9FEOA8oAZPyApWUA==} engines: {node: '>=18'} @@ -17441,12 +18017,6 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-ia32@0.28.2': - resolution: {integrity: sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==} - engines: {node: '>=18'} - cpu: [ia32] - os: [linux] - '@esbuild/linux-loong64@0.23.0': resolution: {integrity: sha512-InQwepswq6urikQiIC/kkx412fqUZudBO4SYKu0N+tGhXRWUqAx+Q+341tFV6QdBifpjYgUndV1hhMq3WeJi7A==} engines: {node: '>=18'} @@ -17483,12 +18053,6 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-loong64@0.28.2': - resolution: {integrity: sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==} - engines: {node: '>=18'} - cpu: [loong64] - os: [linux] - '@esbuild/linux-mips64el@0.23.0': resolution: {integrity: sha512-J9rflLtqdYrxHv2FqXE2i1ELgNjT+JFURt/uDMoPQLcjWQA5wDKgQA4t/dTqGa88ZVECKaD0TctwsUfHbVoi4w==} engines: {node: '>=18'} @@ -17525,12 +18089,6 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-mips64el@0.28.2': - resolution: {integrity: sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==} - engines: {node: '>=18'} - cpu: [mips64el] - os: [linux] - '@esbuild/linux-ppc64@0.23.0': resolution: {integrity: sha512-cShCXtEOVc5GxU0fM+dsFD10qZ5UpcQ8AM22bYj0u/yaAykWnqXJDpd77ublcX6vdDsWLuweeuSNZk4yUxZwtw==} engines: {node: '>=18'} @@ -17567,12 +18125,6 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-ppc64@0.28.2': - resolution: {integrity: sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==} - engines: {node: '>=18'} - cpu: [ppc64] - os: [linux] - '@esbuild/linux-riscv64@0.23.0': resolution: {integrity: sha512-HEtaN7Y5UB4tZPeQmgz/UhzoEyYftbMXrBCUjINGjh3uil+rB/QzzpMshz3cNUxqXN7Vr93zzVtpIDL99t9aRw==} engines: {node: '>=18'} @@ -17609,12 +18161,6 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-riscv64@0.28.2': - resolution: {integrity: sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==} - engines: {node: '>=18'} - cpu: [riscv64] - os: [linux] - '@esbuild/linux-s390x@0.23.0': resolution: {integrity: sha512-WDi3+NVAuyjg/Wxi+o5KPqRbZY0QhI9TjrEEm+8dmpY9Xir8+HE/HNx2JoLckhKbFopW0RdO2D72w8trZOV+Wg==} engines: {node: '>=18'} @@ -17651,12 +18197,6 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-s390x@0.28.2': - resolution: {integrity: sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==} - engines: {node: '>=18'} - cpu: [s390x] - os: [linux] - '@esbuild/linux-x64@0.23.0': resolution: {integrity: sha512-a3pMQhUEJkITgAw6e0bWA+F+vFtCciMjW/LPtoj99MhVt+Mfb6bbL9hu2wmTZgNd994qTAEw+U/r6k3qHWWaOQ==} engines: {node: '>=18'} @@ -17693,12 +18233,6 @@ packages: cpu: [x64] os: [linux] - '@esbuild/linux-x64@0.28.2': - resolution: {integrity: sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==} - engines: {node: '>=18'} - cpu: [x64] - os: [linux] - '@esbuild/netbsd-arm64@0.25.10': resolution: {integrity: sha512-AKQM3gfYfSW8XRk8DdMCzaLUFB15dTrZfnX8WXQoOUpUBQ+NaAFCP1kPS/ykbbGYz7rxn0WS48/81l9hFl3u4A==} engines: {node: '>=18'} @@ -17729,12 +18263,6 @@ packages: cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-arm64@0.28.2': - resolution: {integrity: sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==} - engines: {node: '>=18'} - cpu: [arm64] - os: [netbsd] - '@esbuild/netbsd-x64@0.23.0': resolution: {integrity: sha512-cRK+YDem7lFTs2Q5nEv/HHc4LnrfBCbH5+JHu6wm2eP+d8OZNoSMYgPZJq78vqQ9g+9+nMuIsAO7skzphRXHyw==} engines: {node: '>=18'} @@ -17771,12 +18299,6 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/netbsd-x64@0.28.2': - resolution: {integrity: sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==} - engines: {node: '>=18'} - cpu: [x64] - os: [netbsd] - '@esbuild/openbsd-arm64@0.23.0': resolution: {integrity: sha512-suXjq53gERueVWu0OKxzWqk7NxiUWSUlrxoZK7usiF50C6ipColGR5qie2496iKGYNLhDZkPxBI3erbnYkU0rQ==} engines: {node: '>=18'} @@ -17813,12 +18335,6 @@ packages: cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-arm64@0.28.2': - resolution: {integrity: sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openbsd] - '@esbuild/openbsd-x64@0.23.0': resolution: {integrity: sha512-6p3nHpby0DM/v15IFKMjAaayFhqnXV52aEmv1whZHX56pdkK+MEaLoQWj+H42ssFarP1PcomVhbsR4pkz09qBg==} engines: {node: '>=18'} @@ -17855,12 +18371,6 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/openbsd-x64@0.28.2': - resolution: {integrity: sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==} - engines: {node: '>=18'} - cpu: [x64] - os: [openbsd] - '@esbuild/openharmony-arm64@0.25.10': resolution: {integrity: sha512-AVTSBhTX8Y/Fz6OmIVBip9tJzZEUcY8WLh7I59+upa5/GPhh2/aM6bvOMQySspnCCHvFi79kMtdJS1w0DXAeag==} engines: {node: '>=18'} @@ -17885,12 +18395,6 @@ packages: cpu: [arm64] os: [openharmony] - '@esbuild/openharmony-arm64@0.28.2': - resolution: {integrity: sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==} - engines: {node: '>=18'} - cpu: [arm64] - os: [openharmony] - '@esbuild/sunos-x64@0.23.0': resolution: {integrity: sha512-BFelBGfrBwk6LVrmFzCq1u1dZbG4zy/Kp93w2+y83Q5UGYF1d8sCzeLI9NXjKyujjBBniQa8R8PzLFAUrSM9OA==} engines: {node: '>=18'} @@ -17927,12 +18431,6 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/sunos-x64@0.28.2': - resolution: {integrity: sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==} - engines: {node: '>=18'} - cpu: [x64] - os: [sunos] - '@esbuild/win32-arm64@0.23.0': resolution: {integrity: sha512-lY6AC8p4Cnb7xYHuIxQ6iYPe6MfO2CC43XXKo9nBXDb35krYt7KGhQnOkRGar5psxYkircpCqfbNDB4uJbS2jQ==} engines: {node: '>=18'} @@ -17969,12 +18467,6 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-arm64@0.28.2': - resolution: {integrity: sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==} - engines: {node: '>=18'} - cpu: [arm64] - os: [win32] - '@esbuild/win32-ia32@0.23.0': resolution: {integrity: sha512-7L1bHlOTcO4ByvI7OXVI5pNN6HSu6pUQq9yodga8izeuB1KcT2UkHaH6118QJwopExPn0rMHIseCTx1CRo/uNA==} engines: {node: '>=18'} @@ -18011,12 +18503,6 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-ia32@0.28.2': - resolution: {integrity: sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==} - engines: {node: '>=18'} - cpu: [ia32] - os: [win32] - '@esbuild/win32-x64@0.23.0': resolution: {integrity: sha512-Arm+WgUFLUATuoxCJcahGuk6Yj9Pzxd6l11Zb/2aAuv5kWWvvfhLFo2fni4uSK5vzlUdCGZ/BdV5tH8klj8p8g==} engines: {node: '>=18'} @@ -18053,12 +18539,6 @@ packages: cpu: [x64] os: [win32] - '@esbuild/win32-x64@0.28.2': - resolution: {integrity: sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==} - engines: {node: '>=18'} - cpu: [x64] - os: [win32] - '@eslint-community/eslint-utils@4.4.1': resolution: {integrity: sha512-s3O3waFUrMV8P/XaF/+ZTp1X9XBZW1a4B97ZnjQF2KYWaFD2A8KyFBsrsfSjEmjn3RGWAIuvlneuZm3CUK3jbA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -19357,6 +19837,13 @@ packages: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 + '@napi-rs/wasm-runtime@1.2.7': + resolution: {integrity: sha512-zJccwplOAbgfZju95IUHazLnx9RAPtPN2YGJXI6UbrgeaR9QfPjGrQL6ERkSAtnVCA4Q+83ApGyaX5zdpCaKkQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} + peerDependencies: + '@emnapi/core': ^1.7.1 || 2.0.0-beta.2 || 2.0.0-beta.3 + '@emnapi/runtime': ^1.7.1 || 2.0.0-beta.2 || 2.0.0-beta.3 + '@neon-rs/load@0.0.4': resolution: {integrity: sha512-kTPhdZyTQxB+2wpiRcFWrDcejc4JI6tkPuS7UZCG4l6Zvc5kU/gGQ/ozvHTh1XR5tS+UlfAfGuPajjzQjCiHCw==} @@ -21040,8 +21527,18 @@ packages: cpu: [x64] os: [win32] - '@rsbuild/core@2.3.1': - resolution: {integrity: sha512-dv5tL7djb8ex5z4sqnDmUbd5PnGNr/CXuFfiMD4RkUsF1JEZZkGH8lc+QW4fqYQIHM7RTvcMUakgvwVU/O9WMw==} + '@rsbuild/core@2.2.5': + resolution: {integrity: sha512-nf34ri1iZduYhHUr5Vc79L7Eml+IlN0nFIaF/g3OW4WR/gShxuf5wVXS69/H8FTHJYN4SdYlNcefSZQluEMKgA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + core-js: '>= 3.0.0' + peerDependenciesMeta: + core-js: + optional: true + + '@rsbuild/core@2.3.2': + resolution: {integrity: sha512-1mjHhBYX1Z+knee55SV/+6KsEVmdjEQ1h73VzXUQYD+sfncuN+6+duVx7nYYVXz1zBP4QfpQt+74gTNAxKz+Hg==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -21111,8 +21608,8 @@ packages: cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-arm64@2.3.1': - resolution: {integrity: sha512-koLyL2r8PUcLD0StjuZ/n5XM6GJ0C8dzJN0IuIV9d7nQcibJxwjjSAWEPGVz6bm8WuzypvuVKNoa1+GGAHeMQA==} + '@rspack/binding-darwin-arm64@2.3.2': + resolution: {integrity: sha512-6ouAc7766psf4i7E1jk4oE99GhHBYh3JwJhHkmortSig9dJzonPM7VIhP7yHdclw7iKNNrC+XMIw9HtcVTLxnw==} cpu: [arm64] os: [darwin] @@ -21121,8 +21618,8 @@ packages: cpu: [x64] os: [darwin] - '@rspack/binding-darwin-x64@2.3.1': - resolution: {integrity: sha512-YK39JLiu1YC6+3BMxkP7e848pHD7e2T/0OSNogDi7whfiZNg95wa9Ncd7I5ppAf0nhmV+FNew/sCBIFp5h67Jw==} + '@rspack/binding-darwin-x64@2.3.2': + resolution: {integrity: sha512-C9dhmWDeuuXjmSos2hJ2OBOcafGLxB5HKbW9JprVcd0ZIBx3KSv2Wr4/BsQE1Gxx0JSTRYeeBs0Wpmqi2p24BQ==} cpu: [x64] os: [darwin] @@ -21132,8 +21629,8 @@ packages: os: [linux] libc: [glibc] - '@rspack/binding-linux-arm64-gnu@2.3.1': - resolution: {integrity: sha512-Q+RCA/KM2tn6m6R5U4lktXDs5cCRm3SyleQk86iqqUFX7wKzVRUvr5BTsreg6K9of3gpYmQ6+g1PGT5cwo0rLA==} + '@rspack/binding-linux-arm64-gnu@2.3.2': + resolution: {integrity: sha512-+W67rrYxpKv+7Owe3Yi+GNHmvipCVJ+BxJuGi6VBL6R9Y4MP4ur/U2xxULE3Fe29hUrsq5xaiXAFAssocI63AA==} cpu: [arm64] os: [linux] libc: [glibc] @@ -21144,8 +21641,8 @@ packages: os: [linux] libc: [musl] - '@rspack/binding-linux-arm64-musl@2.3.1': - resolution: {integrity: sha512-He+muVDON1fohGtdYamh3zHVwf6/E6fZu/+iEAkxjclE0P94bsCfYVcZW/a4/l1tJ2zvLZtB4jD7Qr6r4vG/WA==} + '@rspack/binding-linux-arm64-musl@2.3.2': + resolution: {integrity: sha512-A1c3WMnAGVCUyKvqded3bUf4WWnAU4qKWJXoU2AtTa9KSfURbi2svn3hFk5PT9M/QVDwHEGkz29TgfX2FSc/zw==} cpu: [arm64] os: [linux] libc: [musl] @@ -21156,8 +21653,8 @@ packages: os: [linux] libc: [glibc] - '@rspack/binding-linux-ppc64-gnu@2.3.1': - resolution: {integrity: sha512-blIZUgyPt4FcSHkZL6sJ2xbzc7ACgDeU49An4mXLSebwdgnlhTzxeSFnh2VeJDlGza8CUaZYB/zS/6oZ2kCDcw==} + '@rspack/binding-linux-ppc64-gnu@2.3.2': + resolution: {integrity: sha512-p+m1JbiKUN0l2Q0I2ielf+spuVv4OKW0dEJUZ6Pxm/KbFEENptAdwOvjrAmUwFFAiNJN6phEDY6/PAcP+DkmIQ==} cpu: [ppc64] os: [linux] libc: [glibc] @@ -21168,8 +21665,8 @@ packages: os: [linux] libc: [glibc] - '@rspack/binding-linux-riscv64-gnu@2.3.1': - resolution: {integrity: sha512-3FtW2DUFmXxhBORUA3zSc+ot4d6R/1/U6z/48TDN4jeIYDUG9VqYBF6LUohX4vBY6IP0DCyXb2N9WayD/9QXoA==} + '@rspack/binding-linux-riscv64-gnu@2.3.2': + resolution: {integrity: sha512-3aPE11BZ0GxJfaAXS6OjpgUpUE2twRRPR+Lx5YfSMVcLw/m74m4U4bE8q39TsR4+LbaKSn7fhZ7xK06yA1o+kg==} cpu: [riscv64] os: [linux] libc: [glibc] @@ -21180,8 +21677,8 @@ packages: os: [linux] libc: [musl] - '@rspack/binding-linux-riscv64-musl@2.3.1': - resolution: {integrity: sha512-+5qNgdNdXzp/K8f8BjgJ3m7tcbBKPENN7WPDfBcSHvWb5GF4+o/pbrX26c0+LEugo0bYUOAoitBNd94AwcNvpA==} + '@rspack/binding-linux-riscv64-musl@2.3.2': + resolution: {integrity: sha512-mFRYh2zIuNmaTPIsgXMpZP1NYhysyDEsmheiG/Zr5XE1nQEMj/otxrGl3pj5EFuab4GnwWlBo5M8F0ppvsizYw==} cpu: [riscv64] os: [linux] libc: [musl] @@ -21192,8 +21689,8 @@ packages: os: [linux] libc: [glibc] - '@rspack/binding-linux-s390x-gnu@2.3.1': - resolution: {integrity: sha512-yNcg/y1+MV0wZ984CVU4d1HAYYwMcDPXoQO0xynU+K5YuBxPWALHOxuRRCKCcykBdL1GIEshAIewEFrsW/cmJg==} + '@rspack/binding-linux-s390x-gnu@2.3.2': + resolution: {integrity: sha512-c6aamcvr9vFdccsOX4cPecG1G06aZxsmMWKzQRkcvbrNYR+RwNTGa5iM13KkopktCZgZX7MJo1UNYEN+UK3JHw==} cpu: [s390x] os: [linux] libc: [glibc] @@ -21204,8 +21701,8 @@ packages: os: [linux] libc: [glibc] - '@rspack/binding-linux-x64-gnu@2.3.1': - resolution: {integrity: sha512-ffclKBuH8wwimOBd6xGUxrBfVKKY5Ow4E7OFdHZeg4xffm2O8auGszmOgvFu1eoDoOYHaVJn+cEV6UD0KwZk8A==} + '@rspack/binding-linux-x64-gnu@2.3.2': + resolution: {integrity: sha512-l/WCW3RSfJn5eAcWciqZGazhLIj1d8KjfzTAic8XwDFj5JlVwT5i2BhrOSf9b42WNrKrxtsRPFw9UoCKAunDzg==} cpu: [x64] os: [linux] libc: [glibc] @@ -21216,8 +21713,8 @@ packages: os: [linux] libc: [musl] - '@rspack/binding-linux-x64-musl@2.3.1': - resolution: {integrity: sha512-qcDwwuyxR7TMtrW+r5Y9RIW25boXd1Ip/9jz04jhdq/OiU/Am7rCP2X90CH8sWdzovIF9UNmsGjY4KklR0F2Mg==} + '@rspack/binding-linux-x64-musl@2.3.2': + resolution: {integrity: sha512-iHPYQWl6pwlzn1NNNvC+ag42uoAoQs0iPP1OEmBIYT2unXpWHnGhr4t8+uN7epD2fNYZ8HZQw1lPAgB6z7LNgA==} cpu: [x64] os: [linux] libc: [musl] @@ -21226,8 +21723,8 @@ packages: resolution: {integrity: sha512-SRDYrqWnD8Y+VNj8+11KggFaVMFSbyu+9WC2f9sygzjFu78GmF0kLKaHNQMaJv6MUMSBk/OhtEbUB4hmH7czVQ==} cpu: [wasm32] - '@rspack/binding-wasm32-wasi@2.3.1': - resolution: {integrity: sha512-3dr6zjFaCK3A920ftCriSJkiRhEfhHtat7LtBdj6g0mcV5Rt+iealmli0vjeAvD0UdpE1u8EKWlfw82JLgFLSQ==} + '@rspack/binding-wasm32-wasi@2.3.2': + resolution: {integrity: sha512-es9ts6uw29/JNd5lZcb5bviCZYgUf1W6TAnbZB1HQjJvh7+DPYtD+27tLKzpSjlkqkPfIWyzNnR4aM9NZWoFrA==} cpu: [wasm32] '@rspack/binding-win32-arm64-msvc@2.2.7': @@ -21235,8 +21732,8 @@ packages: cpu: [arm64] os: [win32] - '@rspack/binding-win32-arm64-msvc@2.3.1': - resolution: {integrity: sha512-AZbuLPylt1xvWssN93AsirbYs3WgfcrA8tMsqHmVJIHahLu9E+JPKZ3Gmsw6IYEZk3EfnV3ujQzeQ1/VfF0Vsw==} + '@rspack/binding-win32-arm64-msvc@2.3.2': + resolution: {integrity: sha512-nAzwd0tslZF8vUeYYUWrxrulfB+ZInCT+jsUNq3AoH3D4fQRRq327omaxOD0ngtHtiiX/mwdmobNlLBHNgZ+RA==} cpu: [arm64] os: [win32] @@ -21245,8 +21742,8 @@ packages: cpu: [ia32] os: [win32] - '@rspack/binding-win32-ia32-msvc@2.3.1': - resolution: {integrity: sha512-R5NVU68TePZcgRdYUzrQX9YFNxmcyXZEPwaPv40AAgsqNyacG3iRaYVmV79jt3rWYfa0QJaqvRLUchDe2SZ6zQ==} + '@rspack/binding-win32-ia32-msvc@2.3.2': + resolution: {integrity: sha512-yihZFNqOHwZd0I/z3MphJy/l5iNvuYsG0Gv3VuuqIgxZX4yS2DokqpDaWf2DnrZxB3yGSBt+IqZWQg/qzITBoA==} cpu: [ia32] os: [win32] @@ -21255,16 +21752,16 @@ packages: cpu: [x64] os: [win32] - '@rspack/binding-win32-x64-msvc@2.3.1': - resolution: {integrity: sha512-5T9DYjNPQpLbrNXjCssGd2B6xMQPlc3LxVOKHGUA1O0GV+88vBkTXAcryJ+Fo+yVEMPCzp4VvwBMGAVDpCjcSA==} + '@rspack/binding-win32-x64-msvc@2.3.2': + resolution: {integrity: sha512-I/aOF3eXODB+4zjiSSf5KXxQG4NeNoeyYOOmRyxQxdPU9/yjCSBKrKpcS6ZerK2DCYdl5V6+mwO50E25TvpVXg==} cpu: [x64] os: [win32] '@rspack/binding@2.2.7': resolution: {integrity: sha512-opY7Sw6iwtBa23CeNj18GOqKBlaJUZXp52kNIGyNq+7jpCQKrJYeX5wiK7uBn8/ZpHQfhwNL2xxu5yzG4JFH1g==} - '@rspack/binding@2.3.1': - resolution: {integrity: sha512-pfCJGBFNK2tnNnoDP6ZoTbOjxbKr1U2eGFDJ8bIuZQai4FBNhWQlKFmNup+X5K935XYRulZBomIBAL6GL6W2YQ==} + '@rspack/binding@2.3.2': + resolution: {integrity: sha512-JlzyN4N6sRykZVwEFz3Kb8IsrTg8mlbNd/AqVmVyqr35Pg7OvxelTcYRL/Dpb2IMhmfpbzYbFigHyXS2CzibVQ==} '@rspack/core@2.2.7': resolution: {integrity: sha512-kWKd4lYp13GPAQy2eQITLTvPbl+ST7ffG/MCGHoX138o5eTetMQMe/oc7UAZAfjervAM6UOzEhiiCirPTpRBUQ==} @@ -21278,8 +21775,8 @@ packages: '@swc/helpers': optional: true - '@rspack/core@2.3.1': - resolution: {integrity: sha512-9BWfaiEJLgLK9U53Q4WVruBZ19Mu/XWHXHEu0UFla4lUtH8Z+/ET2m044tiqbtyIgqQyG58fMrxHeVIAiXMXHg==} + '@rspack/core@2.3.2': + resolution: {integrity: sha512-1gnot46X+O6z1qtnMw7KAFSuNDTaybn+I5rc1o0czwmRu80wbXNTCtPRstwmeQOuUU6tp5gYFRTIPrFH1YUxaQ==} engines: {node: ^20.19.0 || >=22.12.0} peerDependencies: '@module-federation/runtime-tools': ^0.24.1 || ^2.0.0 @@ -21735,6 +22232,9 @@ packages: '@swc/helpers@0.5.23': resolution: {integrity: sha512-5lSsMOTXURePglDfvuAQUqkGek9Hg2kksOYay2m0+XR++b2NWYL/4sWyuvVBIs8oKnJaxkdi9whaL/sqN13afw==} + '@swc/helpers@0.5.24': + resolution: {integrity: sha512-6tcXo4kA8HgGO7AVmawB57RYi/piBPYVHVcO6dXjX+SZw8GoHmi262sp4v2Ha2kNP9Cx84qei27yT+fjS1lxgg==} + '@swc/types@0.1.26': resolution: {integrity: sha512-lyMwd7WGgG79RS7EERZV3T8wMdmPq3xwyg+1nmAM64kIhx5yl+juO2PYIHb7vTiPgPCj8LYjsNV2T5wiQHUEaw==} @@ -23263,7 +23763,6 @@ packages: ansi-html-community@0.0.8: resolution: {integrity: sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==} - engines: {'0': node >= 0.8.0} hasBin: true ansi-regex@5.0.1: @@ -23757,6 +24256,10 @@ packages: resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==} engines: {node: '>= 20.19.0'} + chokidar@6.0.0: + resolution: {integrity: sha512-Ec2Z7wpcKBiMpR7DxteoqS/sq5G5d2A4fpxzPv6+fD7xNNdrTghn7L11YwV5EN1B3i72Erc3XVT5FkWIDx90+A==} + engines: {node: '>= 22.22'} + chownr@3.0.0: resolution: {integrity: sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==} engines: {node: '>=18'} @@ -24692,11 +25195,6 @@ packages: engines: {node: '>=18'} hasBin: true - esbuild@0.28.2: - resolution: {integrity: sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==} - engines: {node: '>=18'} - hasBin: true - escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -24966,9 +25464,6 @@ packages: resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} engines: {node: '>= 18'} - exsolve@1.1.1: - resolution: {integrity: sha512-9U/jZUgjnSGyntRr6y5Muu1MJcwFl6kPu7k8qLF0IMNfLqvw0NZ4nnVDq0RVoZ0RvCyumib4Ez3KYrVfilrw+g==} - exsolve@1.2.0: resolution: {integrity: sha512-h1pQPR9XoeSMdntRNCjyTznaume4UpfXrULBnlkZ2CUM/G5eSa+pBByGldO5uR8dxbPC+OuJXsPPNf+JZ81ADg==} @@ -25599,9 +26094,6 @@ packages: immer@10.1.1: resolution: {integrity: sha512-s2MPrmjovJcoMaHtx6K11Ra7oD05NT97w1IC5zpMkT6Atjr7H8LjaDd81iIxUYpMKSRRNMJE703M1Fhr/TctHw==} - immutable@5.1.4: - resolution: {integrity: sha512-p6u1bG3YSnINT5RQmx/yRZBpenIl30kVxkTLDyHLIMk0gict704Q9n+thfDI7lTRm9vXdDYutVzXhzcThxTnXA==} - immutable@5.1.9: resolution: {integrity: sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==} @@ -27635,8 +28127,8 @@ packages: resolution: {integrity: sha512-h80JrZu/MHUZCyHu5ciuoI0+WxsCxzxJTILn6Fs8rxSnFPh+UVHYfeIxK1nVGugMqkfC4vJcBOYbkfkwYK0+gw==} engines: {node: '>= 14.18.0'} - readdirp@5.0.0: - resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==} + readdirp@5.1.1: + resolution: {integrity: sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA==} engines: {node: '>= 20.19.0'} real-require@0.2.0: @@ -29188,6 +29680,16 @@ packages: '@testing-library/jest-dom': optional: true + vite-plugin-solid@2.11.15: + resolution: {integrity: sha512-twDNPdUDbhem+UOXVu5PyRJvwHFmxSJ3+NxbCgT9iFL42EmWS7lBfFskVM/HXLwd86fh1BgHKJBfGCWkTu2zEg==} + peerDependencies: + '@testing-library/jest-dom': ^5.16.6 || ^5.17.0 || ^6.0.0 || ^7.0.0 + solid-js: 1.9.12 + vite: ^8.3.4 + peerDependenciesMeta: + '@testing-library/jest-dom': + optional: true + vite-tsconfig-paths@6.1.1: resolution: {integrity: sha512-2cihq7zliibCCZ8P9cKJrQBkfgdvcFkOOc3Y02o3GWUDLgqjWsZudaoiuOwO/gzTzy17cS5F7ZPo4bsnS4DGkg==} peerDependencies: @@ -30731,37 +31233,18 @@ snapshots: optionalDependencies: workerd: 1.20260317.1 - '@cloudflare/unenv-preset@2.15.0(unenv@2.0.0-rc.24)(workerd@1.20261104.1)': + '@cloudflare/unenv-preset@2.16.2(unenv@2.0.0-rc.24)(workerd@1.20260317.1)': dependencies: unenv: 2.0.0-rc.24 optionalDependencies: - workerd: 1.20261104.1 + workerd: 1.20260317.1 - '@cloudflare/unenv-preset@2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261104.1)': - dependencies: - unenv: 2.0.0-rc.24 - optionalDependencies: - workerd: 1.20261104.1 - - '@cloudflare/vite-plugin@1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0)': + '@cloudflare/vite-plugin@1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20260317.1)(wrangler@4.75.0)': dependencies: '@cloudflare/unenv-preset': 2.15.0(unenv@2.0.0-rc.24)(workerd@1.20260317.1) miniflare: 4.20260317.0 unenv: 2.0.0-rc.24 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - wrangler: 4.75.0 - ws: 8.18.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - workerd - - '@cloudflare/vite-plugin@1.29.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(workerd@1.20261104.1)(wrangler@4.75.0)': - dependencies: - '@cloudflare/unenv-preset': 2.15.0(unenv@2.0.0-rc.24)(workerd@1.20261104.1) - miniflare: 4.20260317.0 - unenv: 2.0.0-rc.24 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) wrangler: 4.75.0 ws: 8.18.0 transitivePeerDependencies: @@ -30809,12 +31292,12 @@ snapshots: - debug - supports-color - '@codspeed/vitest-plugin@6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4)': + '@codspeed/vitest-plugin@6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(tinybench@6.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vitest@5.0.4)': dependencies: '@codspeed/core': 6.0.1(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2) tinybench: 6.2.2 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) transitivePeerDependencies: - debug - supports-color @@ -30824,9 +31307,9 @@ snapshots: '@colors/colors@1.6.0': {} - '@convex-dev/better-auth@0.9.7(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)))(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.13.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': + '@convex-dev/better-auth@0.9.7(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.97.2))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)))(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.13.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: - better-auth: 1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)) + better-auth: 1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.97.2))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)) common-tags: 1.8.2 convex: 1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3) convex-helpers: 0.1.104(@standard-schema/spec@1.1.0)(@typescript/typescript6@6.0.2)(convex@1.28.2(@clerk/clerk-react@5.59.3(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react@19.2.3))(hono@4.13.9)(react@19.2.3)(zod@3.25.76) @@ -30944,6 +31427,12 @@ snapshots: '@emnapi/wasi-threads': 1.0.4 tslib: 2.8.1 + '@emnapi/core@2.0.0-beta.3': + dependencies: + '@emnapi/wasi-threads': 2.2.0 + tslib: 2.8.1 + optional: true + '@emnapi/runtime@1.11.3': dependencies: tslib: 2.8.1 @@ -30952,6 +31441,11 @@ snapshots: dependencies: tslib: 2.8.1 + '@emnapi/runtime@2.0.0-beta.3': + dependencies: + tslib: 2.8.1 + optional: true + '@emnapi/wasi-threads@1.0.4': dependencies: tslib: 2.8.1 @@ -30960,6 +31454,11 @@ snapshots: dependencies: tslib: 2.8.1 + '@emnapi/wasi-threads@2.2.0': + dependencies: + tslib: 2.8.1 + optional: true + '@emotion/babel-plugin@11.13.5(supports-color@10.2.2)': dependencies: '@babel/helper-module-imports': 7.27.1(supports-color@10.2.2) @@ -31068,9 +31567,6 @@ snapshots: '@esbuild/aix-ppc64@0.28.1': optional: true - '@esbuild/aix-ppc64@0.28.2': - optional: true - '@esbuild/android-arm64@0.23.0': optional: true @@ -31089,9 +31585,6 @@ snapshots: '@esbuild/android-arm64@0.28.1': optional: true - '@esbuild/android-arm64@0.28.2': - optional: true - '@esbuild/android-arm@0.23.0': optional: true @@ -31110,9 +31603,6 @@ snapshots: '@esbuild/android-arm@0.28.1': optional: true - '@esbuild/android-arm@0.28.2': - optional: true - '@esbuild/android-x64@0.23.0': optional: true @@ -31131,9 +31621,6 @@ snapshots: '@esbuild/android-x64@0.28.1': optional: true - '@esbuild/android-x64@0.28.2': - optional: true - '@esbuild/darwin-arm64@0.23.0': optional: true @@ -31152,9 +31639,6 @@ snapshots: '@esbuild/darwin-arm64@0.28.1': optional: true - '@esbuild/darwin-arm64@0.28.2': - optional: true - '@esbuild/darwin-x64@0.23.0': optional: true @@ -31173,9 +31657,6 @@ snapshots: '@esbuild/darwin-x64@0.28.1': optional: true - '@esbuild/darwin-x64@0.28.2': - optional: true - '@esbuild/freebsd-arm64@0.23.0': optional: true @@ -31194,9 +31675,6 @@ snapshots: '@esbuild/freebsd-arm64@0.28.1': optional: true - '@esbuild/freebsd-arm64@0.28.2': - optional: true - '@esbuild/freebsd-x64@0.23.0': optional: true @@ -31215,9 +31693,6 @@ snapshots: '@esbuild/freebsd-x64@0.28.1': optional: true - '@esbuild/freebsd-x64@0.28.2': - optional: true - '@esbuild/linux-arm64@0.23.0': optional: true @@ -31236,9 +31711,6 @@ snapshots: '@esbuild/linux-arm64@0.28.1': optional: true - '@esbuild/linux-arm64@0.28.2': - optional: true - '@esbuild/linux-arm@0.23.0': optional: true @@ -31257,9 +31729,6 @@ snapshots: '@esbuild/linux-arm@0.28.1': optional: true - '@esbuild/linux-arm@0.28.2': - optional: true - '@esbuild/linux-ia32@0.23.0': optional: true @@ -31278,9 +31747,6 @@ snapshots: '@esbuild/linux-ia32@0.28.1': optional: true - '@esbuild/linux-ia32@0.28.2': - optional: true - '@esbuild/linux-loong64@0.23.0': optional: true @@ -31299,9 +31765,6 @@ snapshots: '@esbuild/linux-loong64@0.28.1': optional: true - '@esbuild/linux-loong64@0.28.2': - optional: true - '@esbuild/linux-mips64el@0.23.0': optional: true @@ -31320,9 +31783,6 @@ snapshots: '@esbuild/linux-mips64el@0.28.1': optional: true - '@esbuild/linux-mips64el@0.28.2': - optional: true - '@esbuild/linux-ppc64@0.23.0': optional: true @@ -31341,9 +31801,6 @@ snapshots: '@esbuild/linux-ppc64@0.28.1': optional: true - '@esbuild/linux-ppc64@0.28.2': - optional: true - '@esbuild/linux-riscv64@0.23.0': optional: true @@ -31362,9 +31819,6 @@ snapshots: '@esbuild/linux-riscv64@0.28.1': optional: true - '@esbuild/linux-riscv64@0.28.2': - optional: true - '@esbuild/linux-s390x@0.23.0': optional: true @@ -31383,9 +31837,6 @@ snapshots: '@esbuild/linux-s390x@0.28.1': optional: true - '@esbuild/linux-s390x@0.28.2': - optional: true - '@esbuild/linux-x64@0.23.0': optional: true @@ -31404,9 +31855,6 @@ snapshots: '@esbuild/linux-x64@0.28.1': optional: true - '@esbuild/linux-x64@0.28.2': - optional: true - '@esbuild/netbsd-arm64@0.25.10': optional: true @@ -31422,9 +31870,6 @@ snapshots: '@esbuild/netbsd-arm64@0.28.1': optional: true - '@esbuild/netbsd-arm64@0.28.2': - optional: true - '@esbuild/netbsd-x64@0.23.0': optional: true @@ -31443,9 +31888,6 @@ snapshots: '@esbuild/netbsd-x64@0.28.1': optional: true - '@esbuild/netbsd-x64@0.28.2': - optional: true - '@esbuild/openbsd-arm64@0.23.0': optional: true @@ -31464,9 +31906,6 @@ snapshots: '@esbuild/openbsd-arm64@0.28.1': optional: true - '@esbuild/openbsd-arm64@0.28.2': - optional: true - '@esbuild/openbsd-x64@0.23.0': optional: true @@ -31485,9 +31924,6 @@ snapshots: '@esbuild/openbsd-x64@0.28.1': optional: true - '@esbuild/openbsd-x64@0.28.2': - optional: true - '@esbuild/openharmony-arm64@0.25.10': optional: true @@ -31500,9 +31936,6 @@ snapshots: '@esbuild/openharmony-arm64@0.28.1': optional: true - '@esbuild/openharmony-arm64@0.28.2': - optional: true - '@esbuild/sunos-x64@0.23.0': optional: true @@ -31521,9 +31954,6 @@ snapshots: '@esbuild/sunos-x64@0.28.1': optional: true - '@esbuild/sunos-x64@0.28.2': - optional: true - '@esbuild/win32-arm64@0.23.0': optional: true @@ -31542,9 +31972,6 @@ snapshots: '@esbuild/win32-arm64@0.28.1': optional: true - '@esbuild/win32-arm64@0.28.2': - optional: true - '@esbuild/win32-ia32@0.23.0': optional: true @@ -31563,9 +31990,6 @@ snapshots: '@esbuild/win32-ia32@0.28.1': optional: true - '@esbuild/win32-ia32@0.28.2': - optional: true - '@esbuild/win32-x64@0.23.0': optional: true @@ -31584,9 +32008,6 @@ snapshots: '@esbuild/win32-x64@0.28.1': optional: true - '@esbuild/win32-x64@0.28.2': - optional: true - '@eslint-community/eslint-utils@4.4.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) @@ -31597,21 +32018,11 @@ snapshots: eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))': - dependencies: - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 3.4.3 - '@eslint-community/eslint-utils@4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))': - dependencies: - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-visitor-keys: 3.4.3 - '@eslint-community/regexpp@4.12.1': {} '@eslint-community/regexpp@4.12.2': {} @@ -31717,14 +32128,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/config-array@0.19.2(supports-color@7.2.0)': - dependencies: - '@eslint/object-schema': 2.1.6 - debug: 4.4.3(supports-color@7.2.0) - minimatch: 3.1.2 - transitivePeerDependencies: - - supports-color - '@eslint/config-helpers@0.1.0': {} '@eslint/core@0.12.0': @@ -31745,23 +32148,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/eslintrc@3.3.0(supports-color@7.2.0)': - dependencies: - ajv: 6.12.6 - debug: 4.4.3(supports-color@7.2.0) - espree: 10.4.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.0 - js-yaml: 4.1.1 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - - '@eslint/js@10.0.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))': + '@eslint/js@10.0.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': optionalDependencies: - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) '@eslint/js@9.22.0': {} @@ -31783,7 +32172,7 @@ snapshots: '@fastify/ajv-compiler@4.0.5': dependencies: ajv: 8.17.1 - ajv-formats: 3.0.1(ajv@8.17.1) + ajv-formats: 3.0.1 fast-uri: 3.0.6 '@fastify/busboy@3.1.1': {} @@ -32996,6 +33385,13 @@ snapshots: '@tybys/wasm-util': 0.10.3 optional: true + '@napi-rs/wasm-runtime@1.2.7(@emnapi/core@2.0.0-beta.3)(@emnapi/runtime@2.0.0-beta.3)': + dependencies: + '@emnapi/core': 2.0.0-beta.3 + '@emnapi/runtime': 2.0.0-beta.3 + '@tybys/wasm-util': 0.10.3 + optional: true + '@neon-rs/load@0.0.4': {} '@netlify/ai@1.0.1': @@ -33047,7 +33443,7 @@ snapshots: validate-npm-package-name: 5.0.1 yaml: 2.9.0 yargs: 17.7.2 - zod: 4.6.6 + zod: 4.5.4 '@netlify/database-dev@1.0.1': dependencies: @@ -33265,10 +33661,10 @@ snapshots: '@netlify/types@3.0.0': {} - '@netlify/vite-plugin-tanstack-start@1.3.19(@tanstack/solid-start@packages+solid-start)(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@netlify/vite-plugin-tanstack-start@1.3.19(@tanstack/solid-start@packages+solid-start)(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - '@netlify/vite-plugin': 3.0.1(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + '@netlify/vite-plugin': 3.0.1(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) optionalDependencies: '@tanstack/solid-start': link:packages/solid-start transitivePeerDependencies: @@ -33299,12 +33695,12 @@ snapshots: - supports-color - uploadthing - '@netlify/vite-plugin@3.0.1(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@netlify/vite-plugin@3.0.1(babel-plugin-macros@3.1.0)(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@netlify/dev': 5.1.0(db0@0.4.1)(ioredis@5.11.1(supports-color@10.2.2))(rollup@4.63.1)(srvx@1.0.5)(supports-color@10.2.2) '@netlify/dev-utils': 6.0.1 dedent: 1.7.2(babel-plugin-macros@3.1.0) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) transitivePeerDependencies: - '@azure/app-configuration' - '@azure/cosmos' @@ -33367,7 +33763,7 @@ snapshots: unixify: 1.0.0 urlpattern-polyfill: 8.0.2 yargs: 17.7.2 - zod: 4.6.6 + zod: 4.5.4 transitivePeerDependencies: - bare-abort-controller - bare-buffer @@ -33419,11 +33815,11 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.19.0 - '@nx/devkit@24.0.0(nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@7.2.0))(@swc/core@1.15.33(@swc/helpers@0.5.23)))': + '@nx/devkit@24.0.0(nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23)))': dependencies: ejs: 5.0.1 minimatch: 10.2.5 - nx: 24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@7.2.0))(@swc/core@1.15.33(@swc/helpers@0.5.23)) + nx: 24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23)) semver: 7.8.5 tslib: 2.8.1 yargs-parser: 21.1.1 @@ -34681,30 +35077,21 @@ snapshots: '@rolldown/binding-win32-x64-msvc@1.2.13': optional: true - '@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@babel/core': 7.29.0(supports-color@10.2.2) picomatch: 4.0.7 rolldown: 1.2.13 optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - '@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) picomatch: 4.0.7 rolldown: 1.2.13 optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - optional: true - - '@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@babel/core': 7.29.7(supports-color@10.2.2) - picomatch: 4.0.7 - rolldown: 1.2.13 - optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) optional: true '@rolldown/pluginutils@1.0.0-rc.2': {} @@ -34798,14 +35185,21 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.63.1': optional: true - '@rsbuild/core@2.3.1': + '@rsbuild/core@2.2.5': dependencies: - '@rspack/core': 2.3.1(@swc/helpers@0.5.23) + '@rspack/core': 2.2.7(@swc/helpers@0.5.23) '@swc/helpers': 0.5.23 transitivePeerDependencies: - '@module-federation/runtime-tools' - '@rsbuild/plugin-babel@1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2)': + '@rsbuild/core@2.3.2': + dependencies: + '@rspack/core': 2.3.2(@swc/helpers@0.5.24) + '@swc/helpers': 0.5.24 + transitivePeerDependencies: + - '@module-federation/runtime-tools' + + '@rsbuild/plugin-babel@1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2)': dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/plugin-proposal-decorators': 7.29.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) @@ -34814,20 +35208,38 @@ snapshots: '@types/babel__core': 7.20.5 reduce-configs: 1.1.1 optionalDependencies: - '@rsbuild/core': 2.3.1 + '@rsbuild/core': 2.3.2 transitivePeerDependencies: - supports-color - '@rsbuild/plugin-react@2.0.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))': + '@rsbuild/plugin-react@2.0.0(@rsbuild/core@2.2.5)(@rspack/core@2.2.7(@swc/helpers@0.5.23))': dependencies: - '@rspack/plugin-react-refresh': 2.0.0(@rspack/core@2.3.1(@swc/helpers@0.5.23))(react-refresh@0.18.0) + '@rspack/plugin-react-refresh': 2.0.0(@rspack/core@2.2.7(@swc/helpers@0.5.23))(react-refresh@0.18.0) react-refresh: 0.18.0 optionalDependencies: - '@rsbuild/core': 2.3.1 + '@rsbuild/core': 2.2.5 transitivePeerDependencies: - '@rspack/core' - '@rsbuild/plugin-sass@2.0.1(@rsbuild/core@2.3.1)': + '@rsbuild/plugin-react@2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))': + dependencies: + '@rspack/plugin-react-refresh': 2.0.0(@rspack/core@2.2.7(@swc/helpers@0.5.23))(react-refresh@0.18.0) + react-refresh: 0.18.0 + optionalDependencies: + '@rsbuild/core': 2.3.2 + transitivePeerDependencies: + - '@rspack/core' + + '@rsbuild/plugin-react@2.0.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.24))': + dependencies: + '@rspack/plugin-react-refresh': 2.0.0(@rspack/core@2.2.7(@swc/helpers@0.5.24))(react-refresh@0.18.0) + react-refresh: 0.18.0 + optionalDependencies: + '@rsbuild/core': 2.3.2 + transitivePeerDependencies: + - '@rspack/core' + + '@rsbuild/plugin-sass@2.0.1(@rsbuild/core@2.3.2)': dependencies: deepmerge: 4.3.1 loader-utils: 2.0.4 @@ -34835,45 +35247,45 @@ snapshots: reduce-configs: 2.0.1 sass-embedded: 1.105.1 optionalDependencies: - '@rsbuild/core': 2.3.1 + '@rsbuild/core': 2.3.2 - '@rsbuild/plugin-solid@1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(solid-js@1.9.12)(supports-color@10.2.2)': + '@rsbuild/plugin-solid@1.1.1(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(solid-js@1.9.12)(supports-color@10.2.2)': dependencies: - '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) solid-refresh: 0.7.8(solid-js@1.9.12) optionalDependencies: - '@rsbuild/core': 2.3.1 + '@rsbuild/core': 2.3.2 transitivePeerDependencies: - '@babel/core' - solid-js - supports-color - '@rsbuild/plugin-tailwindcss@2.0.3(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(webpack@5.110.3)': + '@rsbuild/plugin-tailwindcss@2.0.3(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))(webpack@5.110.3)': dependencies: - '@tailwindcss/webpack': 4.3.1(@rspack/core@2.3.1(@swc/helpers@0.5.23))(webpack@5.110.3) + '@tailwindcss/webpack': 4.3.1(@rspack/core@2.2.7(@swc/helpers@0.5.23))(webpack@5.110.3) optionalDependencies: - '@rsbuild/core': 2.3.1 + '@rsbuild/core': 2.3.2 transitivePeerDependencies: - '@rspack/core' - webpack - '@rsbuild/plugin-vue-jsx@2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.1)(supports-color@10.2.2)': + '@rsbuild/plugin-vue-jsx@2.0.0(@babel/core@7.29.7(supports-color@10.2.2))(@rsbuild/core@2.3.2)(supports-color@10.2.2)': dependencies: - '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.3.1)(supports-color@10.2.2) + '@rsbuild/plugin-babel': 1.1.2(@rsbuild/core@2.3.2)(supports-color@10.2.2) '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) babel-plugin-vue-jsx-hmr: 1.0.0(supports-color@10.2.2) optionalDependencies: - '@rsbuild/core': 2.3.1 + '@rsbuild/core': 2.3.2 transitivePeerDependencies: - '@babel/core' - supports-color - '@rsbuild/plugin-vue@1.2.7(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2))': + '@rsbuild/plugin-vue@1.2.7(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: - rspack-vue-loader: 17.5.0(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) + rspack-vue-loader: 17.5.0(@rspack/core@2.2.7(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)) optionalDependencies: - '@rsbuild/core': 2.3.1 + '@rsbuild/core': 2.3.2 transitivePeerDependencies: - '@rspack/core' - '@vue/compiler-sfc' @@ -34882,61 +35294,61 @@ snapshots: '@rspack/binding-darwin-arm64@2.2.7': optional: true - '@rspack/binding-darwin-arm64@2.3.1': + '@rspack/binding-darwin-arm64@2.3.2': optional: true '@rspack/binding-darwin-x64@2.2.7': optional: true - '@rspack/binding-darwin-x64@2.3.1': + '@rspack/binding-darwin-x64@2.3.2': optional: true '@rspack/binding-linux-arm64-gnu@2.2.7': optional: true - '@rspack/binding-linux-arm64-gnu@2.3.1': + '@rspack/binding-linux-arm64-gnu@2.3.2': optional: true '@rspack/binding-linux-arm64-musl@2.2.7': optional: true - '@rspack/binding-linux-arm64-musl@2.3.1': + '@rspack/binding-linux-arm64-musl@2.3.2': optional: true '@rspack/binding-linux-ppc64-gnu@2.2.7': optional: true - '@rspack/binding-linux-ppc64-gnu@2.3.1': + '@rspack/binding-linux-ppc64-gnu@2.3.2': optional: true '@rspack/binding-linux-riscv64-gnu@2.2.7': optional: true - '@rspack/binding-linux-riscv64-gnu@2.3.1': + '@rspack/binding-linux-riscv64-gnu@2.3.2': optional: true '@rspack/binding-linux-riscv64-musl@2.2.7': optional: true - '@rspack/binding-linux-riscv64-musl@2.3.1': + '@rspack/binding-linux-riscv64-musl@2.3.2': optional: true '@rspack/binding-linux-s390x-gnu@2.2.7': optional: true - '@rspack/binding-linux-s390x-gnu@2.3.1': + '@rspack/binding-linux-s390x-gnu@2.3.2': optional: true '@rspack/binding-linux-x64-gnu@2.2.7': optional: true - '@rspack/binding-linux-x64-gnu@2.3.1': + '@rspack/binding-linux-x64-gnu@2.3.2': optional: true '@rspack/binding-linux-x64-musl@2.2.7': optional: true - '@rspack/binding-linux-x64-musl@2.3.1': + '@rspack/binding-linux-x64-musl@2.3.2': optional: true '@rspack/binding-wasm32-wasi@2.2.7': @@ -34946,29 +35358,29 @@ snapshots: '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) optional: true - '@rspack/binding-wasm32-wasi@2.3.1': + '@rspack/binding-wasm32-wasi@2.3.2': dependencies: - '@emnapi/core': 1.11.3 - '@emnapi/runtime': 1.11.3 - '@napi-rs/wasm-runtime': 1.1.6(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) + '@emnapi/core': 2.0.0-beta.3 + '@emnapi/runtime': 2.0.0-beta.3 + '@napi-rs/wasm-runtime': 1.2.7(@emnapi/core@2.0.0-beta.3)(@emnapi/runtime@2.0.0-beta.3) optional: true '@rspack/binding-win32-arm64-msvc@2.2.7': optional: true - '@rspack/binding-win32-arm64-msvc@2.3.1': + '@rspack/binding-win32-arm64-msvc@2.3.2': optional: true '@rspack/binding-win32-ia32-msvc@2.2.7': optional: true - '@rspack/binding-win32-ia32-msvc@2.3.1': + '@rspack/binding-win32-ia32-msvc@2.3.2': optional: true '@rspack/binding-win32-x64-msvc@2.2.7': optional: true - '@rspack/binding-win32-x64-msvc@2.3.1': + '@rspack/binding-win32-x64-msvc@2.3.2': optional: true '@rspack/binding@2.2.7': @@ -34988,22 +35400,22 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 2.2.7 '@rspack/binding-win32-x64-msvc': 2.2.7 - '@rspack/binding@2.3.1': + '@rspack/binding@2.3.2': optionalDependencies: - '@rspack/binding-darwin-arm64': 2.3.1 - '@rspack/binding-darwin-x64': 2.3.1 - '@rspack/binding-linux-arm64-gnu': 2.3.1 - '@rspack/binding-linux-arm64-musl': 2.3.1 - '@rspack/binding-linux-ppc64-gnu': 2.3.1 - '@rspack/binding-linux-riscv64-gnu': 2.3.1 - '@rspack/binding-linux-riscv64-musl': 2.3.1 - '@rspack/binding-linux-s390x-gnu': 2.3.1 - '@rspack/binding-linux-x64-gnu': 2.3.1 - '@rspack/binding-linux-x64-musl': 2.3.1 - '@rspack/binding-wasm32-wasi': 2.3.1 - '@rspack/binding-win32-arm64-msvc': 2.3.1 - '@rspack/binding-win32-ia32-msvc': 2.3.1 - '@rspack/binding-win32-x64-msvc': 2.3.1 + '@rspack/binding-darwin-arm64': 2.3.2 + '@rspack/binding-darwin-x64': 2.3.2 + '@rspack/binding-linux-arm64-gnu': 2.3.2 + '@rspack/binding-linux-arm64-musl': 2.3.2 + '@rspack/binding-linux-ppc64-gnu': 2.3.2 + '@rspack/binding-linux-riscv64-gnu': 2.3.2 + '@rspack/binding-linux-riscv64-musl': 2.3.2 + '@rspack/binding-linux-s390x-gnu': 2.3.2 + '@rspack/binding-linux-x64-gnu': 2.3.2 + '@rspack/binding-linux-x64-musl': 2.3.2 + '@rspack/binding-wasm32-wasi': 2.3.2 + '@rspack/binding-win32-arm64-msvc': 2.3.2 + '@rspack/binding-win32-ia32-msvc': 2.3.2 + '@rspack/binding-win32-x64-msvc': 2.3.2 '@rspack/core@2.2.7(@swc/helpers@0.5.23)': dependencies: @@ -35011,25 +35423,38 @@ snapshots: optionalDependencies: '@swc/helpers': 0.5.23 - '@rspack/core@2.3.1(@swc/helpers@0.5.23)': + '@rspack/core@2.2.7(@swc/helpers@0.5.24)': dependencies: - '@rspack/binding': 2.3.1 + '@rspack/binding': 2.2.7 optionalDependencies: - '@swc/helpers': 0.5.23 + '@swc/helpers': 0.5.24 + optional: true + + '@rspack/core@2.3.2(@swc/helpers@0.5.24)': + dependencies: + '@rspack/binding': 2.3.2 + optionalDependencies: + '@swc/helpers': 0.5.24 '@rspack/lite-tapable@1.1.0': {} - '@rspack/plugin-react-refresh@2.0.0(@rspack/core@2.3.1(@swc/helpers@0.5.23))(react-refresh@0.18.0)': + '@rspack/plugin-react-refresh@2.0.0(@rspack/core@2.2.7(@swc/helpers@0.5.23))(react-refresh@0.18.0)': dependencies: react-refresh: 0.18.0 optionalDependencies: - '@rspack/core': 2.3.1(@swc/helpers@0.5.23) + '@rspack/core': 2.2.7(@swc/helpers@0.5.23) + + '@rspack/plugin-react-refresh@2.0.0(@rspack/core@2.2.7(@swc/helpers@0.5.24))(react-refresh@0.18.0)': + dependencies: + react-refresh: 0.18.0 + optionalDependencies: + '@rspack/core': 2.2.7(@swc/helpers@0.5.24) '@rushstack/node-core-library@5.7.0(@types/node@25.0.9)': dependencies: ajv: 8.13.0 ajv-draft-04: 1.0.0(ajv@8.13.0) - ajv-formats: 3.0.1(ajv@8.13.0) + ajv-formats: 3.0.1 fs-extra: 7.0.1 import-lazy: 4.0.0 jju: 1.4.0 @@ -35302,11 +35727,11 @@ snapshots: '@standard-schema/spec@1.1.0': {} - '@stylistic/eslint-plugin@5.10.0(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))': + '@stylistic/eslint-plugin@5.10.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) '@typescript-eslint/types': 8.57.1 - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-visitor-keys: 4.2.1 espree: 10.4.0 estraverse: 5.3.0 @@ -35379,13 +35804,13 @@ snapshots: '@swc/core': 1.15.33(@swc/helpers@0.5.23) '@swc/types': 0.1.26 - '@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@7.2.0)': + '@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)': dependencies: '@swc-node/core': 1.14.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26) '@swc-node/sourcemap-support': 0.6.1 '@swc/core': 1.15.33(@swc/helpers@0.5.23) colorette: 2.0.20 - debug: 4.4.3(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) oxc-resolver: 11.19.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3) pirates: 4.0.7 tslib: 2.8.1 @@ -35466,6 +35891,8 @@ snapshots: dependencies: tslib: 2.8.1 + '@swc/helpers@0.5.24': {} + '@swc/types@0.1.26': dependencies: '@swc/counter': 0.1.3 @@ -35477,7 +35904,7 @@ snapshots: jiti: 2.7.0 lightningcss: 1.32.0 magic-string: 0.30.21 - source-map-js: 1.2.1 + source-map-js: 1.2.2 tailwindcss: 4.2.2 '@tailwindcss/node@4.3.1': @@ -35487,7 +35914,7 @@ snapshots: jiti: 2.7.0 lightningcss: 1.32.0 magic-string: 0.30.21 - source-map-js: 1.2.1 + source-map-js: 1.2.2 tailwindcss: 4.3.1 '@tailwindcss/oxide-android-arm64@4.2.2': @@ -35600,22 +36027,22 @@ snapshots: postcss: 8.5.8 tailwindcss: 4.2.2 - '@tailwindcss/vite@4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@tailwindcss/vite@4.2.2(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@tailwindcss/node': 4.2.2 '@tailwindcss/oxide': 4.2.2 tailwindcss: 4.2.2 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - '@tailwindcss/webpack@4.3.1(@rspack/core@2.3.1(@swc/helpers@0.5.23))(webpack@5.110.3)': + '@tailwindcss/webpack@4.3.1(@rspack/core@2.2.7(@swc/helpers@0.5.23))(webpack@5.110.3)': dependencies: '@alloc/quick-lru': 5.2.0 '@tailwindcss/node': 4.3.1 '@tailwindcss/oxide': 4.3.1 tailwindcss: 4.3.1 optionalDependencies: - '@rspack/core': 2.3.1(@swc/helpers@0.5.23) - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + '@rspack/core': 2.2.7(@swc/helpers@0.5.23) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) '@tanstack/devtools-client@0.0.4': dependencies: @@ -35682,11 +36109,11 @@ snapshots: - csstype - utf-8-validate - '@tanstack/eslint-config@0.3.2(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': + '@tanstack/eslint-config@0.3.2(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint/js': 9.36.0 '@stylistic/eslint-plugin': 5.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) - eslint-plugin-import-x: 4.16.1(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-import-x: 4.16.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) eslint-plugin-n: 17.23.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) globals: 16.4.0 typescript-eslint: 8.44.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) @@ -35698,16 +36125,16 @@ snapshots: - supports-color - typescript - '@tanstack/eslint-config@0.4.0(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0)': + '@tanstack/eslint-config@0.4.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: - '@eslint/js': 10.0.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) - '@stylistic/eslint-plugin': 5.10.0(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-plugin-import-x: 4.16.1(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) - eslint-plugin-n: 17.24.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint/js': 10.0.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + '@stylistic/eslint-plugin': 5.10.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-plugin-import-x: 4.16.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint-plugin-n: 17.24.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) globals: 17.4.0 - typescript-eslint: 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) - vue-eslint-parser: 10.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0) + typescript-eslint: 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + vue-eslint-parser: 10.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) transitivePeerDependencies: - '@typescript-eslint/utils' - eslint-import-resolver-node @@ -35802,22 +36229,10 @@ snapshots: '@tanstack/virtual-core@3.13.13': {} - '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vite-plugin-dts: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - vite-tsconfig-paths: 6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - transitivePeerDependencies: - - '@types/node' - - rollup - - supports-color - - typescript - - '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vite-plugin-dts: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-plugin-dts: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vite-tsconfig-paths: 6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) transitivePeerDependencies: @@ -35826,24 +36241,24 @@ snapshots: - supports-color - typescript - '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vite-plugin-dts: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - vite-tsconfig-paths: 6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-dts: 4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-tsconfig-paths: 6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) transitivePeerDependencies: - '@types/node' - rollup - supports-color - typescript - '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@tanstack/vite-config@0.5.2(@types/node@25.0.9)(rollup@4.63.1)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vite-plugin-dts: 4.2.3(@types/node@25.0.9)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - vite-tsconfig-paths: 6.1.1(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite-plugin-dts: 4.2.3(@types/node@25.0.9)(rollup@4.63.1)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-plugin-externalize-deps: 0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite-tsconfig-paths: 6.1.1(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) transitivePeerDependencies: - '@types/node' - rollup @@ -35868,11 +36283,11 @@ snapshots: '@tanstack/vue-query': 5.102.0(vue@3.5.25(typescript@5.8.3)) vue: 3.5.25(typescript@5.8.3) - '@tanstack/vue-query-devtools@6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@7.0.2)))(vue@3.5.25(typescript@7.0.2))': + '@tanstack/vue-query-devtools@6.1.2(@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@6.0.2)))(vue@3.5.25(typescript@6.0.2))': dependencies: '@tanstack/query-devtools': 5.91.1 - '@tanstack/vue-query': 5.102.0(vue@3.5.25(typescript@7.0.2)) - vue: 3.5.25(typescript@7.0.2) + '@tanstack/vue-query': 5.102.0(vue@3.5.25(typescript@6.0.2)) + vue: 3.5.25(typescript@6.0.2) '@tanstack/vue-query@5.102.0(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: @@ -35890,13 +36305,13 @@ snapshots: vue: 3.5.25(typescript@5.8.3) vue-demi: 0.14.10(vue@3.5.25(typescript@5.8.3)) - '@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@7.0.2))': + '@tanstack/vue-query@5.102.0(vue@3.5.25(typescript@6.0.2))': dependencies: '@tanstack/match-sorter-utils': 8.19.4 '@tanstack/query-core': 5.102.0 '@vue/devtools-api': 6.6.4 - vue: 3.5.25(typescript@7.0.2) - vue-demi: 0.14.10(vue@3.5.25(typescript@7.0.2)) + vue: 3.5.25(typescript@6.0.2) + vue-demi: 0.14.10(vue@3.5.25(typescript@6.0.2)) '@tanstack/vue-store@0.11.2(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: @@ -35952,7 +36367,7 @@ snapshots: picocolors: 1.1.1 redent: 3.0.0 optionalDependencies: - vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@testing-library/react@16.2.0(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3(@types/react@19.2.9))(@types/react@19.2.9)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)': dependencies: @@ -36243,15 +36658,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/eslint-plugin@8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2)': + '@typescript-eslint/eslint-plugin@8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) + '@typescript-eslint/parser': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/scope-manager': 8.57.1 - '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) - '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) + '@typescript-eslint/type-utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/visitor-keys': 8.57.1 - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) ignore: 7.0.12 natural-compare: 1.4.0 ts-api-utils: 2.4.0(@typescript/typescript6@6.0.2) @@ -36307,14 +36722,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2)': + '@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: '@typescript-eslint/scope-manager': 8.57.1 '@typescript-eslint/types': 8.57.1 '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@typescript-eslint/visitor-keys': 8.57.1 - debug: 4.4.3(supports-color@7.2.0) - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color @@ -36488,18 +36903,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/type-utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2)': - dependencies: - '@typescript-eslint/types': 8.57.1 - '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) - '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) - debug: 4.4.3(supports-color@10.2.2) - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - ts-api-utils: 2.4.0(@typescript/typescript6@6.0.2) - typescript: '@typescript/typescript6@6.0.2' - transitivePeerDependencies: - - supports-color - '@typescript-eslint/types@8.23.0': {} '@typescript-eslint/types@8.44.1': {} @@ -36681,17 +37084,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2)': - dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) - '@typescript-eslint/scope-manager': 8.57.1 - '@typescript-eslint/types': 8.57.1 - '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - typescript: '@typescript/typescript6@6.0.2' - transitivePeerDependencies: - - supports-color - '@typescript-eslint/visitor-keys@8.23.0': dependencies: '@typescript-eslint/types': 8.23.0 @@ -36854,31 +37246,23 @@ snapshots: - rollup - supports-color - '@vitejs/plugin-react@6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@vitejs/plugin-react@6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.7 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) optionalDependencies: - '@rolldown/plugin-babel': 0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@rolldown/plugin-babel': 0.2.3(@babel/core@7.29.0(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) babel-plugin-react-compiler: 1.0.0 - '@vitejs/plugin-react@6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@vitejs/plugin-react@6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.7 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) optionalDependencies: - '@rolldown/plugin-babel': 0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@rolldown/plugin-babel': 0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) babel-plugin-react-compiler: 1.0.0 - '@vitejs/plugin-react@6.0.1(@rolldown/plugin-babel@0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)))(babel-plugin-react-compiler@1.0.0)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@rolldown/pluginutils': 1.0.0-rc.7 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - optionalDependencies: - '@rolldown/plugin-babel': 0.2.3(@babel/core@7.29.7(supports-color@10.2.2))(rolldown@1.2.13)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - babel-plugin-react-compiler: 1.0.0 - - '@vitejs/plugin-rsc@0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@vitejs/plugin-rsc@0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@rolldown/pluginutils': 1.0.1 es-module-lexer: 3.0.3 @@ -36890,106 +37274,91 @@ snapshots: srvx: 1.0.5 strip-literal: 4.0.0 turbo-stream: 3.2.1 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - '@vitejs/plugin-rsc@0.5.37(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@rolldown/pluginutils': 1.0.1 - es-module-lexer: 3.0.3 - estree-walker: 3.0.3 - magic-string: 1.4.3 - obug: 3.0.0 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - srvx: 1.0.5 - strip-literal: 4.0.0 - turbo-stream: 3.2.1 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - - '@vitejs/plugin-vue-jsx@4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': + '@vitejs/plugin-vue-jsx@4.2.0(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.1 '@vue/babel-plugin-jsx': 1.5.0(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(@typescript/typescript6@6.0.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': + '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.0-rc.9 '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(@typescript/typescript6@6.0.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3))': + '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3))': dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.0-rc.9 '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@5.8.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3))': + '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3))': dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.0-rc.9 '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@5.9.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@7.0.2))': + '@vitejs/plugin-vue-jsx@5.1.5(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@babel/plugin-syntax-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2)) '@babel/plugin-transform-typescript': 7.28.6(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) '@rolldown/pluginutils': 1.0.0-rc.9 '@vue/babel-plugin-jsx': 2.0.1(@babel/core@7.29.7(supports-color@10.2.2))(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vue: 3.5.25(typescript@7.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vue: 3.5.25(typescript@6.0.2) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': + '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(@typescript/typescript6@6.0.2))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(@typescript/typescript6@6.0.2) - '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3))': + '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.8.3))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@5.8.3) - '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3))': + '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@5.9.3))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) vue: 3.5.25(typescript@5.9.3) - '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@7.0.2))': + '@vitejs/plugin-vue@6.0.5(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(vue@3.5.25(typescript@6.0.2))': dependencies: '@rolldown/pluginutils': 1.0.0-rc.2 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vue: 3.5.25(typescript@7.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vue: 3.5.25(typescript@6.0.2) '@vitest/expect@4.1.4': dependencies: @@ -37001,14 +37370,14 @@ snapshots: tinyrainbow: 3.2.0 optional: true - '@vitest/mocker@4.1.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@vitest/mocker@4.1.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@vitest/spy': 4.1.4 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) optional: true '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': @@ -37021,7 +37390,7 @@ snapshots: msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@jridgewell/trace-mapping': 0.3.31 '@vitest/spy': 5.0.4 @@ -37029,19 +37398,9 @@ snapshots: magic-string: 1.4.3 optionalDependencies: msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': - dependencies: - '@jridgewell/trace-mapping': 0.3.31 - '@vitest/spy': 5.0.4 - estree-walker: 3.0.3 - magic-string: 1.4.3 - optionalDependencies: - msw: 2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - - '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': dependencies: '@jridgewell/trace-mapping': 0.3.31 '@vitest/spy': 5.0.4 @@ -37049,7 +37408,17 @@ snapshots: magic-string: 1.4.3 optionalDependencies: msw: 2.15.0(@types/node@25.0.9)(typescript@5.9.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + + '@vitest/mocker@5.0.4(msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))': + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + '@vitest/spy': 5.0.4 + estree-walker: 3.0.3 + magic-string: 1.4.3 + optionalDependencies: + msw: 2.15.0(@types/node@25.0.9)(typescript@6.0.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) '@vitest/pretty-format@4.1.4': dependencies: @@ -37088,7 +37457,7 @@ snapshots: sirv: 3.0.2 tinyglobby: 0.2.17 tinyrainbow: 3.2.0 - vitest: 4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: 4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) optional: true '@vitest/ui@5.0.4(vitest@5.0.4)': @@ -37099,7 +37468,7 @@ snapshots: pathe: 2.0.3 sirv: 3.0.2 tinyrainbow: 3.2.0 - vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: 5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitest/utils@4.1.4': dependencies: @@ -37331,11 +37700,11 @@ snapshots: '@vue/shared': 3.5.25 vue: 3.5.25(typescript@5.9.3) - '@vue/server-renderer@3.5.25(vue@3.5.25(typescript@7.0.2))': + '@vue/server-renderer@3.5.25(vue@3.5.25(typescript@6.0.2))': dependencies: '@vue/compiler-ssr': 3.5.25 '@vue/shared': 3.5.25 - vue: 3.5.25(typescript@7.0.2) + vue: 3.5.25(typescript@6.0.2) '@vue/shared@3.5.25': {} @@ -37422,7 +37791,7 @@ snapshots: '@webpack-cli/configtest@2.1.1(webpack-cli@5.1.4)(webpack@5.110.3)': dependencies: - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) optional: true @@ -37433,7 +37802,7 @@ snapshots: '@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.110.3)': dependencies: - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) optional: true @@ -37444,10 +37813,10 @@ snapshots: '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.4)(webpack@5.110.3)': dependencies: - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) optionalDependencies: - webpack-dev-server: 5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3) + webpack-dev-server: 5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3) optional: true '@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.2.4)(webpack@5.97.1)': @@ -37565,16 +37934,12 @@ snapshots: dependencies: ajv: 8.18.0 - ajv-formats@2.1.1(ajv@8.18.0): - optionalDependencies: + ajv-formats@2.1.1: + dependencies: ajv: 8.18.0 - ajv-formats@3.0.1(ajv@8.13.0): - optionalDependencies: - ajv: 8.13.0 - - ajv-formats@3.0.1(ajv@8.17.1): - optionalDependencies: + ajv-formats@3.0.1: + dependencies: ajv: 8.17.1 ajv-keywords@3.5.2(ajv@6.12.6): @@ -37794,7 +38159,7 @@ snapshots: dependencies: '@babel/core': 7.28.5(supports-color@10.2.2) find-up: 5.0.0 - webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) babel-plugin-jsx-dom-expressions@0.40.3(@babel/core@7.28.5(supports-color@10.2.2)): dependencies: @@ -37895,7 +38260,7 @@ snapshots: jsonpointer: 5.0.1 leven: 3.1.0 - better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.105.1))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)): + better-auth@1.6.19(@opentelemetry/api@1.9.1)(@prisma/client@7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)))(@tanstack/solid-start@packages+solid-start)(mysql2@3.15.3)(next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.97.2))(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3))(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(solid-js@1.9.12)(vitest@4.1.4)(vue@3.5.25(@typescript/typescript6@6.0.2)): dependencies: '@better-auth/core': 1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0) '@better-auth/drizzle-adapter': 1.6.19(@better-auth/core@1.6.19(@better-auth/utils@0.4.2)(@better-fetch/fetch@1.3.1)(@opentelemetry/api@1.9.1)(better-call@1.3.6(zod@4.5.4))(jose@6.1.3)(kysely@0.29.2)(nanostores@1.3.0))(@better-auth/utils@0.4.2) @@ -37918,12 +38283,12 @@ snapshots: '@prisma/client': 7.0.0(@typescript/typescript6@6.0.2)(prisma@7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)) '@tanstack/solid-start': link:packages/solid-start mysql2: 3.15.3 - next: 16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.105.1) + next: 16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.97.2) prisma: 7.0.0(@types/react@19.2.9)(@typescript/typescript6@6.0.2)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) react: 19.2.3 react-dom: 19.2.3(react@19.2.3) solid-js: 1.9.12 - vitest: 4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vitest: 4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) vue: 3.5.25(@typescript/typescript6@6.0.2) transitivePeerDependencies: - '@cloudflare/workers-types' @@ -38073,7 +38438,7 @@ snapshots: confbox: 0.2.2 defu: 6.1.4 dotenv: 16.6.1 - exsolve: 1.1.1 + exsolve: 1.2.0 giget: 2.0.0 jiti: 2.7.0 ohash: 2.0.11 @@ -38199,7 +38564,11 @@ snapshots: chokidar@5.0.0: dependencies: - readdirp: 5.0.0 + readdirp: 5.1.1 + + chokidar@6.0.0: + dependencies: + readdirp: 5.1.1 chownr@3.0.0: {} @@ -38543,7 +38912,7 @@ snapshots: postcss-value-parser: 4.2.0 semver: 7.7.3 optionalDependencies: - webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) css-select@4.3.0: dependencies: @@ -38569,7 +38938,7 @@ snapshots: css-tree@3.2.1: dependencies: mdn-data: 2.27.1 - source-map-js: 1.2.1 + source-map-js: 1.2.2 css-what@6.1.0: {} @@ -38639,12 +39008,6 @@ snapshots: optionalDependencies: supports-color: 10.2.2 - debug@4.4.3(supports-color@7.2.0): - dependencies: - ms: 2.1.3 - optionalDependencies: - supports-color: 7.2.0 - decache@4.6.2: dependencies: callsite: 1.0.0 @@ -38979,7 +39342,7 @@ snapshots: env-runner@0.2.3: dependencies: crossws: 0.4.12(srvx@1.0.5) - exsolve: 1.1.1 + exsolve: 1.2.0 httpxy: 0.5.5 srvx: 1.0.5 @@ -39217,36 +39580,6 @@ snapshots: '@esbuild/win32-ia32': 0.28.1 '@esbuild/win32-x64': 0.28.1 - esbuild@0.28.2: - optionalDependencies: - '@esbuild/aix-ppc64': 0.28.2 - '@esbuild/android-arm': 0.28.2 - '@esbuild/android-arm64': 0.28.2 - '@esbuild/android-x64': 0.28.2 - '@esbuild/darwin-arm64': 0.28.2 - '@esbuild/darwin-x64': 0.28.2 - '@esbuild/freebsd-arm64': 0.28.2 - '@esbuild/freebsd-x64': 0.28.2 - '@esbuild/linux-arm': 0.28.2 - '@esbuild/linux-arm64': 0.28.2 - '@esbuild/linux-ia32': 0.28.2 - '@esbuild/linux-loong64': 0.28.2 - '@esbuild/linux-mips64el': 0.28.2 - '@esbuild/linux-ppc64': 0.28.2 - '@esbuild/linux-riscv64': 0.28.2 - '@esbuild/linux-s390x': 0.28.2 - '@esbuild/linux-x64': 0.28.2 - '@esbuild/netbsd-arm64': 0.28.2 - '@esbuild/netbsd-x64': 0.28.2 - '@esbuild/openbsd-arm64': 0.28.2 - '@esbuild/openbsd-x64': 0.28.2 - '@esbuild/openharmony-arm64': 0.28.2 - '@esbuild/sunos-x64': 0.28.2 - '@esbuild/win32-arm64': 0.28.2 - '@esbuild/win32-ia32': 0.28.2 - '@esbuild/win32-x64': 0.28.2 - optional: true - escalade@3.2.0: {} escape-html@1.0.3: {} @@ -39270,11 +39603,6 @@ snapshots: eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) semver: 7.8.5 - eslint-compat-utils@0.5.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)): - dependencies: - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - semver: 7.8.5 - eslint-import-context@0.1.9(unrs-resolver@1.11.1): dependencies: get-tsconfig: 4.10.1 @@ -39289,14 +39617,7 @@ snapshots: eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-compat-utils: 0.5.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) - eslint-plugin-es-x@7.8.0(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)): - dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) - '@eslint-community/regexpp': 4.12.1 - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-compat-utils: 0.5.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) - - eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): + eslint-plugin-import-x@4.16.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: '@typescript-eslint/types': 8.53.0 comment-parser: 1.4.1 @@ -39308,25 +39629,6 @@ snapshots: semver: 7.8.5 stable-hash-x: 0.2.0 unrs-resolver: 1.11.1 - optionalDependencies: - '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) - transitivePeerDependencies: - - supports-color - - eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): - dependencies: - '@typescript-eslint/types': 8.53.0 - comment-parser: 1.4.1 - debug: 4.4.3(supports-color@7.2.0) - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-import-context: 0.1.9(unrs-resolver@1.11.1) - is-glob: 4.0.3 - minimatch: 10.2.5 - semver: 7.8.5 - stable-hash-x: 0.2.0 - unrs-resolver: 1.11.1 - optionalDependencies: - '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) transitivePeerDependencies: - supports-color @@ -39345,12 +39647,12 @@ snapshots: transitivePeerDependencies: - typescript - eslint-plugin-n@17.24.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)): + eslint-plugin-n@17.24.0(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) + '@eslint-community/eslint-utils': 4.9.1(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) enhanced-resolve: 5.18.3 - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - eslint-plugin-es-x: 7.8.0(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) + eslint-plugin-es-x: 7.8.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)) get-tsconfig: 4.10.1 globals: 15.14.0 globrex: 0.1.2 @@ -39498,11 +39800,9 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-unused-imports@4.1.4(@typescript-eslint/eslint-plugin@8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)): + eslint-plugin-unused-imports@4.1.4(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2)): dependencies: - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) - optionalDependencies: - '@typescript-eslint/eslint-plugin': 8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-plugin-vue@9.33.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: @@ -39581,48 +39881,6 @@ snapshots: transitivePeerDependencies: - supports-color - eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0): - dependencies: - '@eslint-community/eslint-utils': 4.9.0(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0)) - '@eslint-community/regexpp': 4.12.1 - '@eslint/config-array': 0.19.2(supports-color@7.2.0) - '@eslint/config-helpers': 0.1.0 - '@eslint/core': 0.12.0 - '@eslint/eslintrc': 3.3.0(supports-color@7.2.0) - '@eslint/js': 9.22.0 - '@eslint/plugin-kit': 0.2.7 - '@humanfs/node': 0.16.6 - '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.4.2 - '@types/estree': 1.0.8 - '@types/json-schema': 7.0.15 - ajv: 6.12.6 - chalk: 4.1.2 - cross-spawn: 7.0.6 - debug: 4.4.3(supports-color@7.2.0) - escape-string-regexp: 4.0.0 - eslint-scope: 8.3.0 - eslint-visitor-keys: 4.2.1 - espree: 10.4.0 - esquery: 1.6.0 - esutils: 2.0.3 - fast-deep-equal: 3.1.3 - file-entry-cache: 8.0.0 - find-up: 5.0.0 - glob-parent: 6.0.2 - ignore: 5.3.2 - imurmurhash: 0.1.4 - is-glob: 4.0.3 - json-stable-stringify-without-jsonify: 1.0.1 - lodash.merge: 4.6.2 - minimatch: 3.1.2 - natural-compare: 1.4.0 - optionator: 0.9.4 - optionalDependencies: - jiti: 2.7.0 - transitivePeerDependencies: - - supports-color - espree@10.4.0: dependencies: acorn: 8.15.0 @@ -39754,8 +40012,6 @@ snapshots: transitivePeerDependencies: - supports-color - exsolve@1.1.1: {} - exsolve@1.2.0: {} extendable-error@0.1.7: {} @@ -39784,7 +40040,7 @@ snapshots: dependencies: '@fastify/merge-json-schemas': 0.2.1 ajv: 8.17.1 - ajv-formats: 3.0.1(ajv@8.17.1) + ajv-formats: 3.0.1 fast-uri: 3.0.6 json-schema-ref-resolver: 3.0.0 rfdc: 1.4.1 @@ -40357,7 +40613,7 @@ snapshots: transitivePeerDependencies: - supports-color - http-proxy-middleware@2.0.9(@types/express@4.17.25): + http-proxy-middleware@2.0.9(@types/express@4.17.25)(debug@4.4.3(supports-color@10.2.2)): dependencies: '@types/http-proxy': 1.17.15 http-proxy: 1.18.1(debug@4.4.3(supports-color@10.2.2)) @@ -40450,8 +40706,6 @@ snapshots: immer@10.1.1: {} - immutable@5.1.4: {} - immutable@5.1.9: {} import-fresh@3.3.0: @@ -41371,23 +41625,42 @@ snapshots: minimist@1.2.8: {} - minimizer-webpack-plugin@5.10.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack@5.110.3): + minimizer-webpack-plugin@5.10.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.4(@types/node@25.0.9))(svgo@4.0.0)(webpack@5.110.3): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 terser: 5.51.2 - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.4(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) optionalDependencies: '@swc/core': 1.15.33(@swc/helpers@0.5.23) clean-css: 5.3.3 csso: 5.0.5 - esbuild: 0.28.2 + esbuild: 0.28.1 + html-minifier-terser: 6.1.0 + lightningcss: 1.33.0 + postcss: 8.5.29 + sharp: 0.35.4(@types/node@25.0.9) + svgo: 4.0.0 + + minimizer-webpack-plugin@5.10.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack@5.110.3): + dependencies: + '@jridgewell/trace-mapping': 0.3.31 + jest-worker: 27.5.1 + schema-utils: 4.3.3 + terser: 5.51.2 + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + optionalDependencies: + '@swc/core': 1.15.33(@swc/helpers@0.5.23) + clean-css: 5.3.3 + csso: 5.0.5 + esbuild: 0.28.1 html-minifier-terser: 6.1.0 lightningcss: 1.33.0 postcss: 8.5.29 sharp: 0.35.5(@types/node@25.0.9) svgo: 4.0.0 + optional: true minipass@7.1.2: {} @@ -41481,6 +41754,32 @@ snapshots: - '@types/node' optional: true + msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2): + dependencies: + '@inquirer/confirm': 6.3.2(@types/node@25.0.9) + '@mswjs/interceptors': 0.41.9 + '@open-draft/deferred-promise': 3.0.0 + '@types/statuses': 2.0.6 + cookie: 1.1.1 + graphql: 16.14.2 + headers-polyfill: 5.0.1 + is-node-process: 1.2.0 + outvariant: 1.4.3 + path-to-regexp: 6.3.0 + picocolors: 1.1.1 + rettime: 0.11.11 + statuses: 2.0.2 + strict-event-emitter: 0.5.1 + tough-cookie: 6.0.1 + type-fest: 5.9.0 + until-async: 3.0.2 + yargs: 17.7.2 + optionalDependencies: + typescript: 6.0.2 + transitivePeerDependencies: + - '@types/node' + optional: true + msw@2.7.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2): dependencies: '@bundled-es-modules/cookie': 2.0.1 @@ -41561,36 +41860,6 @@ snapshots: netlify-redirector@0.5.0: {} - next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.105.1): - dependencies: - '@next/env': 16.3.4 - '@swc/helpers': 0.5.23 - baseline-browser-mapping: 2.11.23 - caniuse-lite: 1.0.30001760 - postcss: 8.5.23 - react: 19.2.3 - react-dom: 19.2.3(react@19.2.3) - styled-jsx: 5.1.6(@babel/core@7.29.7(supports-color@10.2.2))(babel-plugin-macros@3.1.0)(react@19.2.3) - optionalDependencies: - '@next/swc-darwin-arm64': 16.3.4 - '@next/swc-darwin-x64': 16.3.4 - '@next/swc-linux-arm64-gnu': 16.3.4 - '@next/swc-linux-arm64-musl': 16.3.4 - '@next/swc-linux-x64-gnu': 16.3.4 - '@next/swc-linux-x64-musl': 16.3.4 - '@next/swc-win32-arm64-msvc': 16.3.4 - '@next/swc-win32-x64-msvc': 16.3.4 - '@opentelemetry/api': 1.9.1 - '@playwright/test': 1.63.0 - babel-plugin-react-compiler: 1.0.0 - sass: 1.105.1 - sharp: 0.35.4(@types/node@25.0.9) - transitivePeerDependencies: - - '@babel/core' - - '@types/node' - - babel-plugin-macros - optional: true - next@16.3.4(@babel/core@7.29.7(supports-color@10.2.2))(@opentelemetry/api@1.9.1)(@playwright/test@1.63.0)(@types/node@25.0.9)(babel-plugin-macros@3.1.0)(babel-plugin-react-compiler@1.0.0)(react-dom@19.2.3(react@19.2.3))(react@19.2.3)(sass@1.97.2): dependencies: '@next/env': 16.3.4 @@ -41727,7 +41996,7 @@ snapshots: nwsapi@2.2.16: {} - nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@7.2.0))(@swc/core@1.15.33(@swc/helpers@0.5.23)): + nx@24.0.0(@swc-node/register@1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2))(@swc/core@1.15.33(@swc/helpers@0.5.23)): dependencies: '@clack/core': 1.4.3 '@clack/prompts': 1.7.0 @@ -41828,7 +42097,7 @@ snapshots: '@nx/nx-linux-x64-musl': 24.0.0 '@nx/nx-win32-arm64-msvc': 24.0.0 '@nx/nx-win32-x64-msvc': 24.0.0 - '@swc-node/register': 1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@7.2.0) + '@swc-node/register': 1.11.1(@emnapi/core@1.11.3)(@emnapi/runtime@1.11.3)(@swc/core@1.15.33(@swc/helpers@0.5.23))(@swc/types@0.1.26)(@typescript/typescript6@6.0.2)(supports-color@10.2.2) '@swc/core': 1.15.33(@swc/helpers@0.5.23) nypm@0.6.0: @@ -42168,7 +42437,7 @@ snapshots: pkg-types@2.3.0: dependencies: confbox: 0.2.2 - exsolve: 1.1.1 + exsolve: 1.2.0 pathe: 2.0.3 pkijs@3.4.0: @@ -42195,7 +42464,7 @@ snapshots: postcss: 8.5.6 semver: 7.7.3 optionalDependencies: - webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) transitivePeerDependencies: - typescript @@ -42243,7 +42512,7 @@ snapshots: dependencies: nanoid: 3.3.18 picocolors: 1.1.1 - source-map-js: 1.2.1 + source-map-js: 1.2.2 postcss@8.5.29: dependencies: @@ -42267,7 +42536,7 @@ snapshots: dependencies: nanoid: 3.3.11 picocolors: 1.1.1 - source-map-js: 1.2.1 + source-map-js: 1.2.2 postgres@3.4.7: {} @@ -42686,7 +42955,7 @@ snapshots: readdirp@4.1.1: {} - readdirp@5.0.0: {} + readdirp@5.1.1: {} real-require@0.2.0: {} @@ -42893,13 +43162,13 @@ snapshots: rrweb-cssom@0.8.0: {} - rsbuild-plugin-cloudflare@0.0.4(@rsbuild/core@2.3.1)(@types/node@25.0.9)(workerd@1.20261104.1): + rsbuild-plugin-cloudflare@0.0.4(@rsbuild/core@2.3.2)(@types/node@25.0.9)(workerd@1.20260317.1): dependencies: '@cloudflare/build-output-utils': 0.9.10 '@cloudflare/config': 0.30.2 '@cloudflare/runtime-types': 0.1.23(@types/node@25.0.9) - '@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261104.1) - '@rsbuild/core': 2.3.1 + '@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.20260317.1) + '@rsbuild/core': 2.3.2 miniflare: 5.20261104.0-beta(@types/node@25.0.9) unenv: 2.0.0-rc.24 ws: 8.21.0 @@ -42909,12 +43178,12 @@ snapshots: - utf-8-validate - workerd - rspack-vue-loader@17.5.0(@rspack/core@2.3.1(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)): + rspack-vue-loader@17.5.0(@rspack/core@2.2.7(@swc/helpers@0.5.23))(@vue/compiler-sfc@3.5.25)(vue@3.5.25(@typescript/typescript6@6.0.2)): dependencies: '@rspack/lite-tapable': 1.1.0 chalk: 4.1.2 optionalDependencies: - '@rspack/core': 2.3.1(@swc/helpers@0.5.23) + '@rspack/core': 2.2.7(@swc/helpers@0.5.23) '@vue/compiler-sfc': 3.5.25 vue: 3.5.25(@typescript/typescript6@6.0.2) @@ -43053,7 +43322,7 @@ snapshots: sass@1.97.2: dependencies: chokidar: 4.0.3 - immutable: 5.1.4 + immutable: 5.1.9 source-map-js: 1.2.2 optionalDependencies: '@parcel/watcher': 2.5.1 @@ -43076,7 +43345,7 @@ snapshots: dependencies: '@types/json-schema': 7.0.15 ajv: 8.18.0 - ajv-formats: 2.1.1(ajv@8.18.0) + ajv-formats: 2.1.1 ajv-keywords: 5.1.0(ajv@8.18.0) secure-json-parse@4.1.0: {} @@ -43593,7 +43862,7 @@ snapshots: style-loader@4.0.0(webpack@5.97.1): dependencies: - webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) style-to-object@1.0.8: dependencies: @@ -43725,17 +43994,17 @@ snapshots: '@swc/core': 1.15.33(@swc/helpers@0.5.23) esbuild: 0.27.4 - terser-webpack-plugin@5.3.11(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack@5.97.1): + terser-webpack-plugin@5.3.11(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack@5.97.1): dependencies: '@jridgewell/trace-mapping': 0.3.31 jest-worker: 27.5.1 schema-utils: 4.3.3 serialize-javascript: 6.0.2 terser: 5.37.0 - webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) optionalDependencies: '@swc/core': 1.15.33(@swc/helpers@0.5.23) - esbuild: 0.28.2 + esbuild: 0.28.1 terser@5.37.0: dependencies: @@ -43963,13 +44232,13 @@ snapshots: transitivePeerDependencies: - supports-color - typescript-eslint@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2): + typescript-eslint@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - '@typescript-eslint/eslint-plugin': 8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) - '@typescript-eslint/parser': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) + '@typescript-eslint/eslint-plugin': 8.57.1(@typescript-eslint/parser@8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2))(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + '@typescript-eslint/parser': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) '@typescript-eslint/typescript-estree': 8.57.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2) - '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@10.2.2) - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) + '@typescript-eslint/utils': 8.57.1(@typescript/typescript6@6.0.2)(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) typescript: '@typescript/typescript6@6.0.2' transitivePeerDependencies: - supports-color @@ -44071,20 +44340,20 @@ snapshots: picomatch: 4.0.7 webpack-virtual-modules: 0.6.2 - unplugin@3.7.0(@rsbuild/core@2.3.1)(@rspack/core@2.3.1(@swc/helpers@0.5.23))(esbuild@0.28.2)(rolldown@1.2.13)(rollup@4.63.1)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(webpack@5.110.3): + unplugin@3.7.0(@rsbuild/core@2.3.2)(@rspack/core@2.2.7(@swc/helpers@0.5.23))(esbuild@0.28.1)(rolldown@1.2.13)(rollup@4.63.1)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0))(webpack@5.110.3): dependencies: '@jridgewell/remapping': 2.3.5 '@rolldown/pluginutils': 1.0.1 picomatch: 4.0.7 webpack-virtual-modules: 0.6.2 optionalDependencies: - '@rsbuild/core': 2.3.1 - '@rspack/core': 2.3.1(@swc/helpers@0.5.23) - esbuild: 0.28.2 + '@rsbuild/core': 2.3.2 + '@rspack/core': 2.2.7(@swc/helpers@0.5.23) + esbuild: 0.28.1 rolldown: 1.2.13 rollup: 4.63.1 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.4(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) unrs-resolver@1.11.1: dependencies: @@ -44193,10 +44462,6 @@ snapshots: optionalDependencies: typescript: '@typescript/typescript6@6.0.2' - valibot@1.0.0-beta.15(typescript@7.0.2): - optionalDependencies: - typescript: 7.0.2 - valibot@1.1.0(@typescript/typescript6@6.0.2): optionalDependencies: typescript: '@typescript/typescript6@6.0.2' @@ -44212,26 +44477,7 @@ snapshots: vary@1.1.2: {} - vite-plugin-dts@4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): - dependencies: - '@microsoft/api-extractor': 7.47.7(@types/node@25.0.9) - '@rollup/pluginutils': 5.1.4(rollup@4.63.1) - '@volar/typescript': 2.4.26(@typescript/typescript6@6.0.2) - '@vue/language-core': 2.1.6(@typescript/typescript6@6.0.2) - compare-versions: 6.1.1 - debug: 4.4.3(supports-color@10.2.2) - kolorist: 1.8.0 - local-pkg: 0.5.1 - magic-string: 0.30.21 - typescript: '@typescript/typescript6@6.0.2' - optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - transitivePeerDependencies: - - '@types/node' - - rollup - - supports-color - - vite-plugin-dts@4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-dts@4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@microsoft/api-extractor': 7.47.7(@types/node@25.0.9) '@rollup/pluginutils': 5.1.4(rollup@4.63.1) @@ -44250,7 +44496,7 @@ snapshots: - rollup - supports-color - vite-plugin-dts@4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-dts@4.2.3(@types/node@25.0.9)(@typescript/typescript6@6.0.2)(rollup@4.63.1)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@microsoft/api-extractor': 7.47.7(@types/node@25.0.9) '@rollup/pluginutils': 5.1.4(rollup@4.63.1) @@ -44263,13 +44509,13 @@ snapshots: magic-string: 0.30.21 typescript: '@typescript/typescript6@6.0.2' optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) transitivePeerDependencies: - '@types/node' - rollup - supports-color - vite-plugin-dts@4.2.3(@types/node@25.0.9)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-dts@4.2.3(@types/node@25.0.9)(rollup@4.63.1)(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@microsoft/api-extractor': 7.47.7(@types/node@25.0.9) '@rollup/pluginutils': 5.1.4(rollup@4.63.1) @@ -44282,7 +44528,7 @@ snapshots: magic-string: 0.30.21 typescript: 5.9.2 optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) transitivePeerDependencies: - '@types/node' - rollup @@ -44292,15 +44538,11 @@ snapshots: dependencies: vite: 8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vite-plugin-externalize-deps@0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-externalize-deps@0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vite-plugin-externalize-deps@0.10.0(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): - dependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - - vite-plugin-solid@2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-solid@2.11.10(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@types/babel__core': 7.20.5 @@ -44308,14 +44550,14 @@ snapshots: merge-anything: 5.1.7 solid-js: 1.9.12 solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) optionalDependencies: '@testing-library/jest-dom': 6.6.3 transitivePeerDependencies: - supports-color - vite-plugin-solid@2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-solid@2.11.10(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@types/babel__core': 7.20.5 @@ -44323,14 +44565,14 @@ snapshots: merge-anything: 5.1.7 solid-js: 1.9.12 solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) optionalDependencies: '@testing-library/jest-dom': 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) transitivePeerDependencies: - supports-color - vite-plugin-solid@2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-solid@2.11.11(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@types/babel__core': 7.20.5 @@ -44338,14 +44580,14 @@ snapshots: merge-anything: 5.1.7 solid-js: 1.9.12 solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) optionalDependencies: '@testing-library/jest-dom': 6.6.3 transitivePeerDependencies: - supports-color - vite-plugin-solid@2.11.11(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-plugin-solid@2.11.11(@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4))(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@babel/core': 7.29.7(supports-color@10.2.2) '@types/babel__core': 7.20.5 @@ -44353,13 +44595,28 @@ snapshots: merge-anything: 5.1.7 solid-js: 1.9.12 solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitefu: 1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) optionalDependencies: '@testing-library/jest-dom': 7.0.1(@testing-library/dom@10.4.1)(vitest@5.0.4) transitivePeerDependencies: - supports-color + vite-plugin-solid@2.11.15(@testing-library/jest-dom@6.6.3)(solid-js@1.9.12)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@babel/core': 7.29.7(supports-color@10.2.2) + '@types/babel__core': 7.20.5 + babel-preset-solid: 1.9.10(@babel/core@7.29.7(supports-color@10.2.2))(solid-js@1.9.12) + merge-anything: 5.1.7 + solid-js: 1.9.12 + solid-refresh: 0.6.3(solid-js@1.9.12)(supports-color@10.2.2) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vitefu: 1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + optionalDependencies: + '@testing-library/jest-dom': 6.6.3 + transitivePeerDependencies: + - supports-color + vite-tsconfig-paths@6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.27.4)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: debug: 4.4.3(supports-color@10.2.2) @@ -44370,32 +44627,22 @@ snapshots: - supports-color - typescript - vite-tsconfig-paths@6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-tsconfig-paths@6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: debug: 4.4.3(supports-color@10.2.2) globrex: 0.1.2 tsconfck: 3.1.4(@typescript/typescript6@6.0.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) transitivePeerDependencies: - supports-color - typescript - vite-tsconfig-paths@6.1.1(@typescript/typescript6@6.0.2)(supports-color@10.2.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): - dependencies: - debug: 4.4.3(supports-color@10.2.2) - globrex: 0.1.2 - tsconfck: 3.1.4(@typescript/typescript6@6.0.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - transitivePeerDependencies: - - supports-color - - typescript - - vite-tsconfig-paths@6.1.1(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vite-tsconfig-paths@6.1.1(supports-color@10.2.2)(typescript@5.9.2)(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: debug: 4.4.3(supports-color@10.2.2) globrex: 0.1.2 tsconfck: 3.1.4(typescript@5.9.2) - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) transitivePeerDependencies: - supports-color - typescript @@ -44418,7 +44665,7 @@ snapshots: tsx: 4.20.3 yaml: 2.9.0 - vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0): + vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0): dependencies: lightningcss: 1.33.0 picomatch: 4.0.7 @@ -44427,25 +44674,7 @@ snapshots: tinyglobby: 0.2.17 optionalDependencies: '@types/node': 25.0.9 - esbuild: 0.28.2 - fsevents: 2.3.3 - jiti: 2.7.0 - sass: 1.105.1 - sass-embedded: 1.105.1 - terser: 5.51.2 - tsx: 4.20.3 - yaml: 2.9.0 - - vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0): - dependencies: - lightningcss: 1.33.0 - picomatch: 4.0.7 - postcss: 8.5.29 - rolldown: 1.2.13 - tinyglobby: 0.2.17 - optionalDependencies: - '@types/node': 25.0.9 - esbuild: 0.28.2 + esbuild: 0.28.1 fsevents: 2.3.3 jiti: 2.7.0 sass: 1.97.2 @@ -44454,22 +44683,18 @@ snapshots: tsx: 4.20.3 yaml: 2.9.0 - vitefu@1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vitefu@1.1.1(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitefu@1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vitefu@1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - vitefu@1.1.3(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): - optionalDependencies: - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - - vitest@4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vitest@4.1.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@4.1.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@vitest/expect': 4.1.4 - '@vitest/mocker': 4.1.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@vitest/mocker': 4.1.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) '@vitest/pretty-format': 4.1.4 '@vitest/runner': 4.1.4 '@vitest/snapshot': 4.1.4 @@ -44486,7 +44711,7 @@ snapshots: tinyexec: 1.3.1 tinyglobby: 0.2.17 tinyrainbow: 3.2.0 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) why-is-node-running: 2.3.0 optionalDependencies: '@opentelemetry/api': 1.9.1 @@ -44521,10 +44746,10 @@ snapshots: transitivePeerDependencies: - msw - vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@types/chai': 5.2.2 - '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) chai: 6.3.0 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -44535,7 +44760,7 @@ snapshots: tinybench: 6.2.2 tinyexec: 1.3.1 tinyglobby: 0.2.17 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) why-is-node-running: 3.2.1 optionalDependencies: '@opentelemetry/api': 1.9.1 @@ -44545,10 +44770,10 @@ snapshots: transitivePeerDependencies: - msw - vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@25.0.1(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@types/chai': 5.2.2 - '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) chai: 6.3.0 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -44559,31 +44784,7 @@ snapshots: tinybench: 6.2.2 tinyexec: 1.3.1 tinyglobby: 0.2.17 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) - why-is-node-running: 3.2.1 - optionalDependencies: - '@opentelemetry/api': 1.9.1 - '@types/node': 25.0.9 - '@vitest/ui': 5.0.4(vitest@5.0.4) - jsdom: 25.0.1(supports-color@10.2.2) - transitivePeerDependencies: - - msw - - vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@27.0.0(supports-color@10.2.2))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): - dependencies: - '@types/chai': 5.2.2 - '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) - chai: 6.3.0 - es-module-lexer: 2.3.2 - expect-type: 1.4.0 - magic-string: 1.4.3 - obug: 3.0.0 - picomatch: 4.0.7 - std-env: 4.3.0 - tinybench: 6.2.2 - tinyexec: 1.3.1 - tinyglobby: 0.2.17 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) why-is-node-running: 3.2.1 optionalDependencies: '@opentelemetry/api': 1.9.1 @@ -44593,10 +44794,10 @@ snapshots: transitivePeerDependencies: - msw - vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@types/chai': 5.2.2 - '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(@typescript/typescript6@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) chai: 6.3.0 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -44607,7 +44808,7 @@ snapshots: tinybench: 6.2.2 tinyexec: 1.3.1 tinyglobby: 0.2.17 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) why-is-node-running: 3.2.1 optionalDependencies: '@opentelemetry/api': 1.9.1 @@ -44617,10 +44818,10 @@ snapshots: transitivePeerDependencies: - msw - vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): dependencies: '@types/chai': 5.2.2 - '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(typescript@5.9.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) chai: 6.3.0 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -44631,7 +44832,31 @@ snapshots: tinybench: 6.2.2 tinyexec: 1.3.1 tinyglobby: 0.2.17 - vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.2)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.105.1)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) + why-is-node-running: 3.2.1 + optionalDependencies: + '@opentelemetry/api': 1.9.1 + '@types/node': 25.0.9 + '@vitest/ui': 5.0.4(vitest@5.0.4) + jsdom: 29.1.1(@noble/hashes@2.0.1) + transitivePeerDependencies: + - msw + + vitest@5.0.4(@opentelemetry/api@1.9.1)(@types/node@25.0.9)(@vitest/ui@5.0.4)(jsdom@29.1.1(@noble/hashes@2.0.1))(msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)): + dependencies: + '@types/chai': 5.2.2 + '@vitest/mocker': 5.0.4(msw@2.15.0(@types/node@25.0.9)(typescript@6.0.2))(vite@8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0)) + chai: 6.3.0 + es-module-lexer: 2.3.2 + expect-type: 1.4.0 + magic-string: 1.4.3 + obug: 3.0.0 + picomatch: 4.0.7 + std-env: 4.3.0 + tinybench: 6.2.2 + tinyexec: 1.3.1 + tinyglobby: 0.2.17 + vite: 8.3.4(@types/node@25.0.9)(esbuild@0.28.1)(jiti@2.7.0)(sass-embedded@1.105.1)(sass@1.97.2)(terser@5.51.2)(tsx@4.20.3)(yaml@2.9.0) why-is-node-running: 3.2.1 optionalDependencies: '@opentelemetry/api': 1.9.1 @@ -44653,9 +44878,9 @@ snapshots: dependencies: vue: 3.5.25(typescript@5.8.3) - vue-demi@0.14.10(vue@3.5.25(typescript@7.0.2)): + vue-demi@0.14.10(vue@3.5.25(typescript@6.0.2)): dependencies: - vue: 3.5.25(typescript@7.0.2) + vue: 3.5.25(typescript@6.0.2) vue-eslint-parser@10.2.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: @@ -44669,10 +44894,10 @@ snapshots: transitivePeerDependencies: - supports-color - vue-eslint-parser@10.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@7.2.0))(supports-color@7.2.0): + vue-eslint-parser@10.4.0(eslint@9.22.0(jiti@2.7.0)(supports-color@10.2.2))(supports-color@10.2.2): dependencies: - debug: 4.4.3(supports-color@7.2.0) - eslint: 9.22.0(jiti@2.7.0)(supports-color@7.2.0) + debug: 4.4.3(supports-color@10.2.2) + eslint: 9.22.0(jiti@2.7.0)(supports-color@10.2.2) eslint-scope: 8.3.0 eslint-visitor-keys: 4.2.1 espree: 10.4.0 @@ -44742,15 +44967,15 @@ snapshots: optionalDependencies: typescript: 5.9.3 - vue@3.5.25(typescript@7.0.2): + vue@3.5.25(typescript@6.0.2): dependencies: '@vue/compiler-dom': 3.5.25 '@vue/compiler-sfc': 3.5.25 '@vue/runtime-dom': 3.5.25 - '@vue/server-renderer': 3.5.25(vue@3.5.25(typescript@7.0.2)) + '@vue/server-renderer': 3.5.25(vue@3.5.25(typescript@6.0.2)) '@vue/shared': 3.5.25 optionalDependencies: - typescript: 7.0.2 + typescript: 6.0.2 w3c-xmlserializer@5.0.0: dependencies: @@ -44799,10 +45024,10 @@ snapshots: import-local: 3.2.0 interpret: 3.1.1 rechoir: 0.8.0 - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) webpack-merge: 5.10.0 optionalDependencies: - webpack-dev-server: 5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3) + webpack-dev-server: 5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3) optional: true webpack-cli@5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1): @@ -44833,7 +45058,7 @@ snapshots: range-parser: 1.2.1 schema-utils: 4.3.3 optionalDependencies: - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) optional: true webpack-dev-middleware@7.4.2(webpack@5.97.1): @@ -44847,7 +45072,7 @@ snapshots: optionalDependencies: webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4) - webpack-dev-server@5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3): + webpack-dev-server@5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.110.3): dependencies: '@types/bonjour': 3.5.13 '@types/connect-history-api-fallback': 1.5.4 @@ -44865,7 +45090,7 @@ snapshots: connect-history-api-fallback: 2.0.0 express: 4.22.2(supports-color@10.2.2) graceful-fs: 4.2.11 - http-proxy-middleware: 2.0.9(@types/express@4.17.25) + http-proxy-middleware: 2.0.9(@types/express@4.17.25)(debug@4.4.3(supports-color@10.2.2)) ipaddr.js: 2.2.0 launch-editor: 2.9.1 open: 10.1.0 @@ -44878,7 +45103,7 @@ snapshots: webpack-dev-middleware: 7.4.2(webpack@5.110.3) ws: 8.20.0 optionalDependencies: - webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) + webpack: 5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4) webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) transitivePeerDependencies: - bufferutil @@ -44887,6 +45112,45 @@ snapshots: - utf-8-validate optional: true + webpack-dev-server@5.2.4(debug@4.4.3(supports-color@10.2.2))(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1): + dependencies: + '@types/bonjour': 3.5.13 + '@types/connect-history-api-fallback': 1.5.4 + '@types/express': 4.17.25 + '@types/express-serve-static-core': 4.19.6 + '@types/serve-index': 1.9.4 + '@types/serve-static': 1.15.7 + '@types/sockjs': 0.3.36 + '@types/ws': 8.5.14 + ansi-html-community: 0.0.8 + bonjour-service: 1.3.0 + chokidar: 3.6.0 + colorette: 2.0.20 + compression: 1.8.1(supports-color@10.2.2) + connect-history-api-fallback: 2.0.0 + express: 4.22.2(supports-color@10.2.2) + graceful-fs: 4.2.11 + http-proxy-middleware: 2.0.9(@types/express@4.17.25)(debug@4.4.3(supports-color@10.2.2)) + ipaddr.js: 2.2.0 + launch-editor: 2.9.1 + open: 10.1.0 + p-retry: 6.2.1 + schema-utils: 4.3.3 + selfsigned: 5.5.0 + serve-index: 1.9.1(supports-color@10.2.2) + sockjs: 0.3.24 + spdy: 4.0.2(supports-color@10.2.2) + webpack-dev-middleware: 7.4.2(webpack@5.97.1) + ws: 8.20.0 + optionalDependencies: + webpack: 5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.97.1) + transitivePeerDependencies: + - bufferutil + - debug + - supports-color + - utf-8-validate + webpack-dev-server@5.2.4(supports-color@10.2.2)(webpack-cli@5.1.4)(webpack@5.97.1): dependencies: '@types/bonjour': 3.5.13 @@ -44905,7 +45169,7 @@ snapshots: connect-history-api-fallback: 2.0.0 express: 4.22.2(supports-color@10.2.2) graceful-fs: 4.2.11 - http-proxy-middleware: 2.0.9(@types/express@4.17.25) + http-proxy-middleware: 2.0.9(@types/express@4.17.25)(debug@4.4.3(supports-color@10.2.2)) ipaddr.js: 2.2.0 launch-editor: 2.9.1 open: 10.1.0 @@ -44942,7 +45206,7 @@ snapshots: webpack-virtual-modules@0.6.2: {} - webpack@5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4): + webpack@5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.4(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4): dependencies: '@types/estree': 1.0.9 '@types/json-schema': 7.0.15 @@ -44957,7 +45221,7 @@ snapshots: events: 3.3.0 graceful-fs: 4.2.11 mime-db: 1.54.0 - minimizer-webpack-plugin: 5.10.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.2)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack@5.110.3) + minimizer-webpack-plugin: 5.10.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.4(@types/node@25.0.9))(svgo@4.0.0)(webpack@5.110.3) neo-async: 2.6.2 schema-utils: 4.3.3 tapable: 2.3.3 @@ -44983,6 +45247,48 @@ snapshots: - svgo - uglify-js + webpack@5.110.3(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack-cli@5.1.4): + dependencies: + '@types/estree': 1.0.9 + '@types/json-schema': 7.0.15 + '@webassemblyjs/ast': 1.14.1 + '@webassemblyjs/wasm-edit': 1.14.1 + '@webassemblyjs/wasm-parser': 1.14.1 + acorn: 8.18.0 + browserslist: 4.28.1 + chrome-trace-event: 1.0.4 + enhanced-resolve: 5.24.5 + es-module-lexer: 2.3.2 + events: 3.3.0 + graceful-fs: 4.2.11 + mime-db: 1.54.0 + minimizer-webpack-plugin: 5.10.0(@swc/core@1.15.33(@swc/helpers@0.5.23))(clean-css@5.3.3)(csso@5.0.5)(esbuild@0.28.1)(html-minifier-terser@6.1.0)(lightningcss@1.33.0)(postcss@8.5.29)(sharp@0.35.5(@types/node@25.0.9))(svgo@4.0.0)(webpack@5.110.3) + neo-async: 2.6.2 + schema-utils: 4.3.3 + tapable: 2.3.3 + watchpack: 2.5.2 + webpack-sources: 3.5.1 + optionalDependencies: + webpack-cli: 5.1.4(webpack-dev-server@5.2.4)(webpack@5.110.3) + transitivePeerDependencies: + - '@minify-html/node' + - '@napi-rs/image' + - '@swc/core' + - '@swc/css' + - '@swc/html' + - clean-css + - cssnano + - csso + - esbuild + - html-minifier-terser + - imagemin + - lightningcss + - postcss + - sharp + - svgo + - uglify-js + optional: true + webpack@5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.27.4)(webpack-cli@5.1.4): dependencies: '@types/eslint-scope': 3.7.7 @@ -45015,7 +45321,7 @@ snapshots: - esbuild - uglify-js - webpack@5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack-cli@5.1.4): + webpack@5.97.1(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack-cli@5.1.4): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.7 @@ -45037,7 +45343,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.11(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.2)(webpack@5.97.1) + terser-webpack-plugin: 5.3.11(@swc/core@1.15.33(@swc/helpers@0.5.23))(esbuild@0.28.1)(webpack@5.97.1) watchpack: 2.4.2 webpack-sources: 3.2.3 optionalDependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 1ac9ab63d0..24f5f57a97 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -6,7 +6,7 @@ blockExoticSubdeps: true trustPolicy: 'no-downgrade' trustPolicyExclude: - - 'chokidar@4.0.3' # known to be safe, installed by sass, prisma, netlify... no planned releases in v4, packages is on v5 now + - 'chokidar@4.0.3' # known to be safe, installed by sass, prisma, netlify... no planned releases in v4, package is on v6 now - 'semver@6.3.1' # installed by babel, ecosystem has been on v7 for 7 years now, but babel is horribly out of date, 6.3.1 is the latest v6 and was released 3 years ago - 'undici@6.21.2' # installed by cheerio@1.0.0 -> html-link-extractor@1.0.5 -> markdown-link-extractor@4.0.3, is only 1 year old, v6, v7 and v8 are maintained in parallel - '@platformatic/flame@1.7.0' # trusted publishing failed due to a missing sigstore module in npm, then an established maintainer published it manually @@ -15,6 +15,7 @@ trustPolicyExclude: packages: - 'packages/*' - 'benchmarks/*' + - 'benchmarks/bundle-size/modules/*' - 'benchmarks/memory/*' - 'examples/react/*' - 'examples/solid/*' @@ -24,9 +25,13 @@ packages: - 'examples/react/router-monorepo-simple-lazy/packages/*' - 'e2e/e2e-utils' - 'e2e/react-router/*' + - 'e2e/react-router/route-modules/packages/*' - 'e2e/solid-router/*' + - 'e2e/solid-router/route-modules/packages/*' - 'e2e/vue-router/*' + - 'e2e/vue-router/route-modules/packages/*' - 'e2e/react-start/*' + - 'e2e/react-start/route-modules/packages/*' - 'e2e/solid-start/*' - 'e2e/vue-start/*' - 'e2e/eslint-plugin-start' @@ -49,7 +54,7 @@ catalog: '@types/react-dom': ^19.2.3 eslint: ^9.22.0 eslint-plugin-react-hooks: ^5.1.0 - chokidar: ^5.0.0 + chokidar: ^6.0.0 combinate: ^1.1.11 isbot: ^5.1.22 jsdom: ^25.0.1 diff --git a/scripts/benchmarks/bundle-size/measure.mjs b/scripts/benchmarks/bundle-size/measure.mjs index 4a990feaf9..9874769b0b 100644 --- a/scripts/benchmarks/bundle-size/measure.mjs +++ b/scripts/benchmarks/bundle-size/measure.mjs @@ -24,6 +24,13 @@ const SCENARIOS = [ packageName: '@tanstack/react-router', case: 'minimal', }, + { + id: 'react-router.route-modules', + dir: 'react-router-route-modules', + framework: 'react', + packageName: '@tanstack/react-router', + case: 'route-modules', + }, { id: 'react-router.full', dir: 'react-router-full', @@ -66,6 +73,13 @@ const SCENARIOS = [ packageName: '@tanstack/react-start', case: 'minimal', }, + { + id: 'react-start.route-modules', + dir: 'react-start-route-modules', + framework: 'react', + packageName: '@tanstack/react-start', + case: 'route-modules', + }, { id: 'react-start.query-integration', dir: 'react-start-query-integration', diff --git a/scripts/benchmarks/route-modules/measure.mjs b/scripts/benchmarks/route-modules/measure.mjs new file mode 100644 index 0000000000..7179305499 --- /dev/null +++ b/scripts/benchmarks/route-modules/measure.mjs @@ -0,0 +1,586 @@ +// Measures route modules against a single application with the same routes +// (CONCEPT.md §8): generation, declaration emit and type-check cost, the +// consumer program size, and incremental behaviour after an implementation +// change and after a contract change. +// +// Usage: node scripts/benchmarks/route-modules/measure.mjs [modules] [groups] +// Each module has `groups * 3 + 1` routes (static, search, param, index). +import crypto from 'node:crypto' +import { spawnSync } from 'node:child_process' +import { + existsSync, + mkdirSync, + readFileSync, + readdirSync, + realpathSync, + rmSync, + statSync, + symlinkSync, + writeFileSync, +} from 'node:fs' +import { createRequire } from 'node:module' +import os from 'node:os' +import path from 'node:path' +import { fileURLToPath, pathToFileURL } from 'node:url' +import { performance } from 'node:perf_hooks' + +const moduleCount = Number(process.argv[2] ?? 10) +const groups = Number(process.argv[3] ?? 10) + +const repoRoot = path.resolve( + path.dirname(fileURLToPath(import.meta.url)), + '../../..', +) +const tsc = path.join(repoRoot, 'node_modules', '.bin', 'tsc') +// The router fixture resolves the generator and the runtime packages. +const fixture = path.join(repoRoot, 'e2e/react-router/route-modules') +const fixturePackage = path.join(fixture, 'packages/products') +const generatorEntry = createRequire( + path.join(fixture, 'package.json'), +).resolve('@tanstack/router-generator') +const { Generator, getConfig } = await import( + pathToFileURL(generatorEntry).href +) +const external = [ + '@tanstack/react-router', + '@tanstack/router-core', + 'react', + '@types/react', +] + +const workspace = realpathSync( + (() => { + const dir = path.join( + os.tmpdir(), + `route-modules-measure-${crypto.randomBytes(4).toString('hex')}`, + ) + mkdirSync(dir, { recursive: true }) + return dir + })(), +) + +const tsconfig = { + compilerOptions: { + strict: true, + jsx: 'react-jsx', + target: 'ESNext', + module: 'ESNext', + moduleResolution: 'Bundler', + lib: ['DOM', 'DOM.Iterable', 'ES2022'], + skipLibCheck: true, + noEmit: true, + types: [], + }, + include: ['src'], +} +const routeTypesTsconfig = { + extends: './tsconfig.json', + compilerOptions: { + noEmit: false, + declaration: true, + emitDeclarationOnly: true, + noEmitOnError: true, + declarationMap: true, + rootDir: '.', + outDir: '.tanstack/types', + }, + include: ['src', '.tanstack/route-types-stubs.d.ts'], +} + +function write(file, content) { + mkdirSync(path.dirname(file), { recursive: true }) + writeFileSync( + file, + typeof content === 'string' ? content : JSON.stringify(content, null, 2), + ) +} + +function writePackage(root, packageJson, dependencies) { + write(path.join(root, 'package.json'), packageJson) + write(path.join(root, 'tsconfig.json'), tsconfig) + for (const dependency of external) { + const link = path.join(root, 'node_modules', dependency) + mkdirSync(path.dirname(link), { recursive: true }) + symlinkSync( + realpathSync(path.join(fixturePackage, 'node_modules', dependency)), + link, + 'dir', + ) + } + for (const [name, target] of dependencies) { + const link = path.join(root, 'node_modules', name) + mkdirSync(path.dirname(link), { recursive: true }) + symlinkSync(target, link, 'dir') + } +} + +const searchValidator = `(search: Record) => ({ + page: Number(search.page ?? 0), + q: String(search.q ?? ''), + })` + +/** + * The routes of one feature. `api` names the routing APIs: module routes use + * the scope and module-local paths, application routes use the framework and + * prefixed paths. `other` addresses the previous feature. + */ +function featureRoutes({ id, prefix, scopeImport, otherLink }) { + const files = {} + const route = (file, routePath, body, extraImports = '') => { + const depth = file.split('/').length - 1 + const scope = scopeImport(depth) + files[file] = `${scope}${extraImports} +export const Route = createFileRoute('${id(routePath)}')(${body}) +` + } + route( + 'index.tsx', + '/', + `{ + component: () => First item, +}`, + ) + for (let i = 0; i < groups; i++) { + const next = (i + 1) % groups + route( + `item${i}.tsx`, + `/item${i}`, + `{ + component: () => ( + + ), +})`.replace(/\)$/, ''), + ) + route( + `search${i}.tsx`, + `/search${i}`, + `{ + validateSearch: ${searchValidator}, + loader: () => ({ results: [{ id: 'r${i}', score: ${i} }] }), + component: () => { + const { page, q } = Route.useSearch() + const { results } = Route.useLoaderData() + return ( + + {q}:{page} + + ) + }, +}`, + ) + route( + `params${i}/$id.tsx`, + `/params${i}/$id`, + `{ + loader: ({ params }) => ({ id: params.id, label: 'item ' + params.id }), + component: () => { + const { label } = Route.useLoaderData() + return ( + + Back + + ) + }, +}`, + ) + } + return files +} + +function moduleName(k) { + return `@bench/m${k}` +} + +/** A single application with every feature under `/f`. */ +function writeSingleApp(root) { + writePackage(root, { name: '@bench/single', type: 'module' }, []) + write( + path.join(root, 'src/routes/__root.tsx'), + `import { Outlet, createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute({ component: () => }) +`, + ) + write( + path.join(root, 'src/routes/index.tsx'), + `import { Link, createFileRoute } from '@tanstack/react-router' + +export const Route = createFileRoute('/')({ + component: () => ( + + ), +}) +`, + ) + for (let k = 0; k < moduleCount; k++) { + const files = featureRoutes({ + id: (routePath) => `/f${k}${routePath === '/' ? '/' : routePath}`, + prefix: `/f${k}`, + scopeImport: () => + `import { Link, createFileRoute } from '@tanstack/react-router'\n`, + otherLink: (i) => + k > 0 + ? `Other` + : '', + }) + for (const [file, content] of Object.entries(files)) { + write(path.join(root, 'src/routes', `f${k}`, file), content) + } + } +} + +/** The same features as route modules; module `k` uses module `k - 1`. */ +function writeModules() { + const roots = [] + for (let k = 0; k < moduleCount; k++) { + const root = path.join(workspace, 'modular', `m${k}`) + roots.push(root) + const dependencies = k > 0 ? [[moduleName(k - 1), roots[k - 1]]] : [] + writePackage( + root, + { + name: moduleName(k), + type: 'module', + tanstack: { + router: { module: { uses: dependencies.map(([name]) => name) } }, + }, + exports: { + './route-types': { + types: './.tanstack/types/src/routeContract.gen.d.ts', + }, + './route-module': { + types: './.tanstack/types/src/routeModule.gen.d.ts', + default: './src/routeModule.gen.ts', + }, + './package.json': './package.json', + }, + dependencies: Object.fromEntries( + [...external, ...dependencies.map(([name]) => name)].map((name) => [ + name, + '*', + ]), + ), + }, + dependencies, + ) + write(path.join(root, 'tsconfig.route-types.json'), routeTypesTsconfig) + write( + path.join(root, 'src/routes/__root.tsx'), + `import { Outlet } from '@tanstack/react-router' +import { createModuleRoot } from '../routeScope.gen' + +export const Route = createModuleRoot()({ component: () => }) +`, + ) + const files = featureRoutes({ + id: (routePath) => `${moduleName(k)}:${routePath}`, + prefix: '', + scopeImport: (depth) => { + const scope = `${'../'.repeat(depth + 1)}routeScope.gen` + return k > 0 + ? `import { createFileRoute, m${k - 1} } from '${scope}'\n` + : `import { createFileRoute } from '${scope}'\n` + }, + otherLink: (i) => + k > 0 + ? `Other` + : '', + }) + for (const [file, content] of Object.entries(files)) { + write(path.join(root, 'src/routes', file), content) + } + } + + const app = path.join(workspace, 'modular', 'app') + writePackage( + app, + { + name: '@bench/app', + type: 'module', + dependencies: Object.fromEntries( + roots.map((_, k) => [moduleName(k), '*']), + ), + }, + roots.map((root, k) => [moduleName(k), root]), + ) + write( + path.join(app, 'src/routes/__root.tsx'), + `import { Outlet, createRootRoute } from '@tanstack/react-router' + +export const Route = createRootRoute({ component: () => }) +`, + ) + write( + path.join(app, 'src/routes/index.tsx'), + `import { createFileRoute } from '@tanstack/react-router' +import { ${roots.map((_, k) => `m${k}`).join(', ')} } from '../routeScope.gen' + +export const Route = createFileRoute('/')({ + component: () => ( + + ), +}) +`, + ) + return { roots, app } +} + +const appRouteModules = { + includes: Array.from({ length: moduleCount }, (_, k) => ({ + module: moduleName(k), + at: `/f${k}`, + })), +} + +async function generate(root, routeModules) { + const config = getConfig( + { + disableLogging: true, + tmpDir: path.join(workspace, '.tmp'), + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + ...(routeModules ? { routeModules } : {}), + }, + root, + ) + await new Generator({ config, root }).run() +} + +async function timed(fn) { + const start = performance.now() + const result = await fn() + return { ms: performance.now() - start, result } +} + +/** `tsc --noEmit --extendedDiagnostics` in `root`. */ +function typeCheck(root) { + const start = performance.now() + const result = spawnSync( + tsc, + ['-p', 'tsconfig.json', '--noEmit', '--extendedDiagnostics'], + { cwd: root, encoding: 'utf8' }, + ) + const ms = performance.now() - start + if (result.status !== 0) { + throw new Error(`tsc failed in ${root}:\n${result.stdout}${result.stderr}`) + } + const metric = (name) => { + const match = new RegExp(`^${name}:\\s+([\\d.,]+)`, 'm').exec(result.stdout) + return match ? Number(match[1].replace(/,/g, '')) : undefined + } + const memory = /^Memory used:\s+([\d.,]+)K/m.exec(result.stdout) + return { + ms, + files: metric('Files'), + lines: metric('Lines'), + types: metric('Types'), + instantiations: metric('Instantiations'), + memoryMB: memory + ? Math.round(Number(memory[1].replace(/,/g, '')) / 1024) + : undefined, + checkSeconds: metric('Check time'), + } +} + +function declarationSnapshot(dir) { + const declarations = new Map() + const walk = (current) => { + for (const entry of readdirSync(current)) { + const full = path.join(current, entry) + const stat = statSync(full) + if (stat.isDirectory()) { + walk(full) + } else if (/\.d\.(?:ts|mts|cts)$/.test(full)) { + declarations.set(path.relative(dir, full), readFileSync(full)) + } + } + } + if (existsSync(dir)) { + walk(dir) + } + return declarations +} + +function declarationChanges(before, after) { + let changed = 0 + for (const file of new Set([...before.keys(), ...after.keys()])) { + const previous = before.get(file) + const current = after.get(file) + if (!previous || !current || !previous.equals(current)) { + changed++ + } + } + return changed +} + +// The workload owns its declaration build just like an ordinary package does. +function emitTypes(root) { + const outDir = path.join(root, routeTypesTsconfig.compilerOptions.outDir) + rmSync(outDir, { recursive: true, force: true }) + const result = spawnSync( + tsc, + ['-p', 'tsconfig.route-types.json', '--pretty', 'false'], + { + cwd: root, + encoding: 'utf8', + }, + ) + if (result.error) { + throw result.error + } + if (result.status !== 0) { + throw new Error( + `Declaration build failed in ${root}:\n${result.stdout}${result.stderr}`, + ) + } +} + +function format(ms) { + return `${(ms / 1000).toFixed(2)} s` +} + +const routesPerFeature = groups * 3 + 1 +const compilerVersion = spawnSync(tsc, ['--version'], { encoding: 'utf8' }) +const revision = spawnSync('git', ['rev-parse', 'HEAD'], { + cwd: repoRoot, + encoding: 'utf8', +}) +console.log( + `Environment: Node ${process.version}; ${compilerVersion.stdout.trim()}; revision ${revision.status === 0 ? revision.stdout.trim() : 'unavailable'}`, +) +console.log( + `Workload: ${moduleCount} features x ${routesPerFeature} routes = ${moduleCount * routesPerFeature} routes (+ app root and index)`, +) + +// Single application. +const single = path.join(workspace, 'single') +writeSingleApp(single) +const singleGenerate = await timed(() => generate(single)) +const singleCheck = typeCheck(single) + +// Route modules, in dependency order, as a task runner would run them. +const { roots, app } = writeModules() +let modulesGenerateMs = 0 +let modulesEmitMs = 0 +for (const root of roots) { + modulesGenerateMs += (await timed(() => generate(root))).ms + const emitted = await timed(() => emitTypes(root)) + modulesEmitMs += emitted.ms +} +const appGenerate = await timed(() => generate(app, appRouteModules)) +const appCheck = typeCheck(app) +const moduleChecks = roots.map((root) => typeCheck(root)) +const declarations = roots + .map((root) => { + const files = declarationSnapshot( + path.join(root, routeTypesTsconfig.compilerOptions.outDir), + ) + return { + files: files.size, + bytes: [...files.values()].reduce( + (sum, content) => sum + content.length, + 0, + ), + } + }) + .reduce((a, b) => ({ files: a.files + b.files, bytes: a.bytes + b.bytes })) + +// Incremental: an implementation-only change in the first module. +const first = roots[0] +const firstOutDir = path.join(first, routeTypesTsconfig.compilerOptions.outDir) +const coldDeclarations = declarationSnapshot(firstOutDir) +const itemFile = path.join(first, 'src/routes/item0.tsx') +writeFileSync( + itemFile, + readFileSync(itemFile, 'utf8').replace('>Next<', '>Next item<'), +) +const implementationEmit = await timed(() => emitTypes(first)) +const implementationDeclarations = declarationSnapshot(firstOutDir) +const implementationChanges = declarationChanges( + coldDeclarations, + implementationDeclarations, +) + +// Incremental: a contract change (a new optional search param) in the first +// module. +const searchFile = path.join(first, 'src/routes/search0.tsx') +writeFileSync( + searchFile, + readFileSync(searchFile, 'utf8').replace( + "q: String(search.q ?? ''),", + "q: String(search.q ?? ''),\n ...(search.sort ? { sort: String(search.sort) } : {}),", + ), +) +const contractGenerate = await timed(() => generate(first)) +const contractEmit = await timed(() => emitTypes(first)) +const contractChanges = declarationChanges( + implementationDeclarations, + declarationSnapshot(firstOutDir), +) +const dependentCheck = typeCheck(roots[1]) +const contractAppCheck = typeCheck(app) + +const rows = [ + [ + 'Generate (cold)', + format(singleGenerate.ms), + `${format(modulesGenerateMs + appGenerate.ms)} (modules ${format(modulesGenerateMs)}, app ${format(appGenerate.ms)})`, + ], + ['Emit declarations (cold)', '-', format(modulesEmitMs)], + ['Application type check', format(singleCheck.ms), format(appCheck.ms)], + ['Application program files', singleCheck.files, appCheck.files], + ['Application program lines', singleCheck.lines, appCheck.lines], + ['Application types', singleCheck.types, appCheck.types], + [ + 'Application instantiations', + singleCheck.instantiations, + appCheck.instantiations, + ], + ['Application memory (MB)', singleCheck.memoryMB, appCheck.memoryMB], + [ + 'Module type checks (sum)', + '-', + format(moduleChecks.reduce((sum, check) => sum + check.ms, 0)), + ], + [ + 'Largest module program files', + '-', + Math.max(...moduleChecks.map((check) => check.files ?? 0)), + ], + [ + 'Declaration files / size', + '-', + `${declarations.files} / ${Math.round(declarations.bytes / 1024)} KiB`, + ], + [ + 'Implementation change: emit', + '-', + `${format(implementationEmit.ms)}, ${implementationChanges} declarations changed`, + ], + [ + 'Contract change: generate + emit', + '-', + `${format(contractGenerate.ms + contractEmit.ms)}, ${contractChanges} declarations changed`, + ], + ['Contract change: dependent module check', '-', format(dependentCheck.ms)], + ['Contract change: application check', '-', format(contractAppCheck.ms)], +] + +console.log('\n| Metric | Single application | Route modules |') +console.log('| --- | --- | --- |') +for (const [metric, singleValue, modularValue] of rows) { + console.log(`| ${metric} | ${singleValue} | ${modularValue} |`) +} + +if (process.env.KEEP) { + console.log(workspace) +} else { + rmSync(workspace, { recursive: true, force: true }) +} diff --git a/scripts/benchmarks/route-modules/measure.test.mjs b/scripts/benchmarks/route-modules/measure.test.mjs new file mode 100644 index 0000000000..e1003f302a --- /dev/null +++ b/scripts/benchmarks/route-modules/measure.test.mjs @@ -0,0 +1,32 @@ +import assert from 'node:assert/strict' +import { spawnSync } from 'node:child_process' +import path from 'node:path' +import { test } from 'node:test' +import { fileURLToPath } from 'node:url' + +const script = fileURLToPath(new URL('./measure.mjs', import.meta.url)) +const root = path.resolve(path.dirname(script), '../../..') + +test('the benchmark measures declaration changes for implementation and contract edits', () => { + const result = spawnSync(process.execPath, [script, '2', '1'], { + cwd: root, + encoding: 'utf8', + timeout: 120_000, + maxBuffer: 8 * 1024 * 1024, + }) + const output = `${result.stdout}${result.stderr}` + assert.equal(result.error, undefined, output) + assert.equal(result.status, 0, output) + + const implementation = + /Implementation change: emit[^\n]*, (\d+) declarations changed/.exec(output) + assert.ok(implementation, output) + assert.equal(Number(implementation[1]), 0, output) + + const contract = + /Contract change: generate \+ emit[^\n]*, (\d+) declarations changed/.exec( + output, + ) + assert.ok(contract, output) + assert.ok(Number(contract[1]) > 0, output) +}) diff --git a/scripts/benchmarks/route-modules/scoped-match.mjs b/scripts/benchmarks/route-modules/scoped-match.mjs new file mode 100644 index 0000000000..9e420ce417 --- /dev/null +++ b/scripts/benchmarks/route-modules/scoped-match.mjs @@ -0,0 +1,241 @@ +import assert from 'node:assert/strict' +import fs from 'node:fs/promises' +import os from 'node:os' +import path from 'node:path' +import { createRequire } from 'node:module' +import { performance } from 'node:perf_hooks' +import { realpathSync } from 'node:fs' + +// Run only after building router-generator and react-router through Nx. +// Usage: node scripts/benchmarks/route-modules/scoped-match.mjs +// This is a focused CPU probe, not a heap-retention or individual-call-tail test. +const repository = path.resolve(process.argv[2] ?? process.cwd()) +const requireGenerator = createRequire( + path.join(repository, 'packages/router-generator/package.json'), +) +const { Generator, getConfig } = requireGenerator('@tanstack/router-generator') +const { createJiti } = requireGenerator('jiti') +const workspace = realpathSync( + await fs.mkdtemp(path.join(os.tmpdir(), 'route-module-guard-benchmark-')), +) + +async function write(file, content) { + await fs.mkdir(path.dirname(file), { recursive: true }) + await fs.writeFile(file, content) +} + +async function link(root, name, target) { + const destination = path.join(root, 'node_modules', name) + await fs.mkdir(path.dirname(destination), { recursive: true }) + await fs.symlink(target, destination, 'dir') +} + +async function fixture(routeCount) { + const directory = path.join(workspace, String(routeCount)) + const provider = path.join(directory, 'provider') + const host = path.join(directory, 'host') + const moduleId = `@guard/provider-${routeCount}` + for (const root of [provider, host]) { + await write( + path.join(root, 'package.json'), + JSON.stringify({ + name: root === provider ? moduleId : `@guard/host-${routeCount}`, + type: 'module', + dependencies: { + '@tanstack/react-router': '*', + ...(root === host ? { [moduleId]: '*' } : {}), + }, + ...(root === provider + ? { + tanstack: { router: { module: true } }, + exports: { + './route-module': './src/routeModule.gen.ts', + './route-types': './src/routeContract.gen.ts', + }, + } + : {}), + }), + ) + await link( + root, + '@tanstack/react-router', + path.join(repository, 'packages/react-router'), + ) + } + await link(host, moduleId, provider) + await write( + path.join(provider, 'src/routes/__root.tsx'), + `import { createModuleRoot } from '../routeScope.gen' +export const Route = createModuleRoot()({})`, + ) + for (let index = 0; index < routeCount; index++) { + const segment = `p${String(index).padStart(4, '0')}` + await write( + path.join(provider, `src/routes/${segment}.tsx`), + `import { createFileRoute } from '../routeScope.gen' +export const Route = createFileRoute('${moduleId}:/${segment}')({})`, + ) + } + await write( + path.join(host, 'src/routes/__root.tsx'), + `import { createRootRoute } from '@tanstack/react-router' +export const Route = createRootRoute()`, + ) + await write( + path.join(host, 'src/routes/outside.tsx'), + `import { createFileRoute } from '@tanstack/react-router' +export const Route = createFileRoute('/outside')({})`, + ) + for (const root of [provider, host]) { + const config = getConfig( + { + target: 'react', + disableLogging: true, + routesDirectory: './src/routes', + generatedRouteTree: './src/routeTree.gen.ts', + ...(root === host + ? { + routeModules: { includes: [{ module: moduleId, at: '/module' }] }, + } + : {}), + }, + root, + ) + await new Generator({ root, config }).run() + } + const lastSegment = `p${String(routeCount - 1).padStart(4, '0')}` + const entry = path.join(host, 'src/benchmark.ts') + await write( + entry, + `import { createRouter, createMemoryHistory } from '@tanstack/react-router' +import { routeTree } from './routeTree.gen' +import { isScopedMatch } from '../../provider/src/routeScope.gen' +const history = createMemoryHistory({ initialEntries: ['/module/p0000'] }) +const router = createRouter({ routeTree, history, isServer: true }) +export { isScopedMatch } +export const first = router.matchRoutes('/module/p0000').at(-1)! +export const lastMatches = router.matchRoutes('/module/${lastSegment}') +export const last = lastMatches.at(-1)! +export const miss = router.matchRoutes('/outside').at(-1)! +export function dispose() { history.destroy() }`, + ) + const jiti = createJiti(path.join(directory, 'load.mjs'), { + moduleCache: true, + fsCache: false, + }) + const loaded = await jiti.import(entry) + assert.equal(typeof loaded.isScopedMatch, 'function') + assert.equal(loaded.first.routeId, `${moduleId}:/p0000`) + assert.equal(loaded.last.routeId, `${moduleId}:/${lastSegment}`) + assert.equal(loaded.miss.routeId, '/outside') + assert.equal(loaded.isScopedMatch(loaded.first), true) + assert.equal(loaded.isScopedMatch(loaded.last), true) + assert.equal(loaded.isScopedMatch(loaded.miss), false) + assert.equal(loaded.lastMatches.filter(loaded.isScopedMatch).length, 2) + return loaded +} + +const BATCH = 1024 +const SAMPLE_COUNT = 12 +const SAMPLE_MILLISECONDS = 25 +let retainedChecksum = 0 + +function sample(operation, expectedBatchChecksum, duration) { + const started = performance.now() + let elapsed = 0 + let batches = 0 + let checksum = 0 + do { + for (let index = 0; index < BATCH; index++) { + checksum += operation(index) + } + batches++ + elapsed = performance.now() - started + } while (elapsed < duration) + assert.equal(checksum, expectedBatchChecksum * batches) + retainedChecksum += checksum + return { + nsPerOperation: (elapsed * 1e6) / (batches * BATCH), + operations: batches * BATCH, + } +} + +function measure(routeCount, name, operation, expectedBatchChecksum) { + sample(operation, expectedBatchChecksum, 150) + const samples = Array.from({ length: SAMPLE_COUNT }, () => + sample(operation, expectedBatchChecksum, SAMPLE_MILLISECONDS), + ) + const means = samples.map((value) => value.nsPerOperation) + const mean = means.reduce((sum, value) => sum + value, 0) / SAMPLE_COUNT + const deviation = Math.sqrt( + means.reduce((sum, value) => sum + (value - mean) ** 2, 0) / + (SAMPLE_COUNT - 1), + ) + const sorted = [...means].sort((left, right) => left - right) + console.log( + JSON.stringify({ + benchmark: 'generated-isScopedMatch', + routes: routeCount, + name, + hz: 1e9 / mean, + meanNsPerOperation: mean, + standardDeviationNs: deviation, + rme95Percent: + ((2.201 * deviation) / Math.sqrt(SAMPLE_COUNT) / mean) * 100, + // These are percentiles of batch means, not individual-call latency. + batchMeanP50Ns: sorted[Math.floor(SAMPLE_COUNT * 0.5)], + batchMeanP95Ns: sorted[Math.ceil(SAMPLE_COUNT * 0.95) - 1], + samples, + }), + ) +} + +try { + console.log( + JSON.stringify({ + node: process.version, + repository, + batch: BATCH, + samples: SAMPLE_COUNT, + }), + ) + for (const routeCount of [8, 64, 512]) { + const fixtureData = await fixture(routeCount) + const { isScopedMatch, first, last, miss, lastMatches } = fixtureData + const mixed = [first, last, miss, lastMatches[0]] + measure( + routeCount, + 'first leaf hit', + () => Number(isScopedMatch(first)), + BATCH, + ) + measure( + routeCount, + 'last leaf hit', + () => Number(isScopedMatch(last)), + BATCH, + ) + measure( + routeCount, + 'ordinary route miss', + () => Number(isScopedMatch(miss)), + 0, + ) + measure( + routeCount, + 'mixed hits and misses', + (index) => Number(isScopedMatch(mixed[index % mixed.length])), + BATCH / 2, + ) + measure( + routeCount, + 'filter actual ancestor match list', + () => lastMatches.filter(isScopedMatch).length, + BATCH * 2, + ) + fixtureData.dispose() + } + console.log(JSON.stringify({ retainedChecksum })) +} finally { + await fs.rm(workspace, { recursive: true, force: true }) +} diff --git a/scripts/benchmarks/route-modules/start-types.mjs b/scripts/benchmarks/route-modules/start-types.mjs new file mode 100644 index 0000000000..24b7a1ecff --- /dev/null +++ b/scripts/benchmarks/route-modules/start-types.mjs @@ -0,0 +1,325 @@ +import { createHash } from 'node:crypto' +import fs from 'node:fs' +import os from 'node:os' +import path from 'node:path' +import { spawnSync } from 'node:child_process' +import { performance } from 'node:perf_hooks' + +const args = process.argv.slice(2) +function option(name, fallback) { + const index = args.indexOf(name) + return index === -1 ? fallback : args[index + 1] +} +const root = fs.realpathSync(option('--root', process.cwd())) +const label = option('--label', 'candidate') +const output = path.resolve( + option('--out', path.join(os.tmpdir(), `start-module-types-${label}`)), +) +const counts = option('--counts', '1,8,32').split(',').map(Number) +const repeats = Number(option('--repeats', '3')) +const warmups = Number(option('--warmups', '1')) +const compilerPackage = option('--compiler-package', 'typescript59') +const run = args.includes('--run') +if ( + !counts.every((n) => Number.isInteger(n) && n > 0) || + !Number.isInteger(repeats) || + repeats < 1 || + !Number.isInteger(warmups) || + warmups < 0 +) { + throw new Error( + 'Counts/repeats must be positive integers and warmups nonnegative.', + ) +} +const packageRoot = path.join(root, 'packages/start-client-core') +const packageJson = JSON.parse( + fs.readFileSync(path.join(packageRoot, 'package.json'), 'utf8'), +) +const modern = Object.hasOwn(packageJson.exports, './_internal/route-module') +const factoryEntry = modern + ? '@tanstack/start-client-core/_internal/route-module' + : '@tanstack/start-client-core' +const compilerRoot = fs.realpathSync( + path.join(root, 'node_modules', compilerPackage), +) +const compiler = path.join(compilerRoot, 'lib/tsc.js') +const compilerVersion = JSON.parse( + fs.readFileSync(path.join(compilerRoot, 'package.json'), 'utf8'), +).version + +if (fs.existsSync(path.join(output, 'results.json'))) { + throw new Error( + `Results already exist in ${output}; use a new --out to preserve the recorded run.`, + ) +} +fs.mkdirSync(output, { recursive: true }) +function link(target, destination) { + fs.mkdirSync(path.dirname(destination), { recursive: true }) + if (fs.existsSync(destination)) { + if (fs.realpathSync(destination) !== fs.realpathSync(target)) { + throw new Error(`Existing link points elsewhere: ${destination}`) + } + return + } + fs.symlinkSync(target, destination, 'dir') +} +link(packageRoot, path.join(output, 'node_modules/@tanstack/start-client-core')) +link( + fs.realpathSync(path.join(root, 'node_modules/@types/node')), + path.join(output, 'node_modules/@types/node'), +) +fs.writeFileSync( + path.join(output, 'package.json'), + JSON.stringify({ private: true, type: 'module' }, null, 2) + '\n', +) + +function source(count, scenario) { + const ids = Array.from( + { length: count }, + (_, index) => `@start-type-probe/fragment-${index}`, + ) + const declarations = modern + ? `declare module '@tanstack/start-client-core' {\n interface StartModuleRequirements {\n${ids.map((id) => ` '${id}': { requestContext: { viewer: string } }`).join('\n')}\n }\n}` + : `const requireViewer = requireRequestContext<{ viewer: string }>()` + const fragments = ids + .map((id, index) => { + const middleware = + scenario === 'flat' + ? `const middleware${index} = createMiddleware({ type: 'function' }).server(({ next }) => next({ context: { step${index}: true } }))` + : `// This object differs from sharedAudit at runtime but has the same type. +const independentAudit${index} = createMiddleware({ type: 'function' }).server(({ next }) => next({ context: { auditTag: 'fragment' } })) +const dependency${index} = createMiddleware({ type: 'function' }) + .middleware([sharedAudit, independentAudit${index}]) + .server(({ next }) => next({ context: { step${index}: true } })) +const middleware${index} = createMiddleware({ type: 'function' }) + .middleware([dependency${index}, sharedAudit]) + .server(({ context, next }) => { + const tag: string = context.auditTag + const retainsInference: 0 extends (1 & typeof context.auditTag) ? never : true = true + return next({ context: { lastAuditTag: tag, retainsInference } }) + })` + return `${middleware} +const fragment${index} = createStartModule('${id}')(() => ({ +${modern ? '' : ' requestMiddleware: [requireViewer],\n'} functionMiddleware: [middleware${index}], +}))` + }) + .join('\n\n') + return `// Same executable middleware graph and context on both revisions. +// Only the package's supported factory export and requirement syntax differ. +import { createStart, createMiddleware${modern ? '' : ', requireRequestContext'} } from '@tanstack/start-client-core' +import { createStartModule } from '${factoryEntry}' +import type { AssertStartModules, ValidateStartModules } from '@tanstack/start-client-core' + +${declarations} + +const viewer = createMiddleware().server(({ next }) => next({ context: { viewer: 'benchmark' } })) +const sharedAudit = createMiddleware({ type: 'function' }).server(({ next }) => next({ context: { auditTag: 'host' } })) + +${fragments} + +const fragments = [${ids.map((_, index) => `fragment${index}`).join(', ')}] as const +export const start = createStart(() => ({ + requestMiddleware: [viewer], + functionMiddleware: [sharedAudit], + extends: fragments, +})) +export type Validation = AssertStartModules> +export const valid: Validation = true +type ExpectTrue = T +type Options = Awaited> +// Force the complete installed contribution tuple without relying on any. +export type InstalledCount = ExpectTrue +` +} + +const cases = [ + { name: 'empty', count: 0, scenario: 'flat' }, + ...['flat', 'nested-dedupe'].flatMap((scenario) => + counts.map((count) => ({ name: `${scenario}-${count}`, count, scenario })), + ), +] +for (const item of cases) { + const directory = path.join(output, item.name) + fs.mkdirSync(directory, { recursive: true }) + const code = source(item.count, item.scenario) + fs.writeFileSync(path.join(directory, 'consumer.ts'), code) + fs.writeFileSync( + path.join(directory, 'tsconfig.json'), + JSON.stringify( + { + compilerOptions: { + target: 'ES2022', + module: 'ESNext', + moduleResolution: 'Bundler', + lib: ['DOM', 'DOM.Iterable', 'ES2022'], + types: ['node'], + strict: true, + skipLibCheck: true, + noEmit: true, + incremental: false, + }, + files: ['consumer.ts'], + }, + null, + 2, + ) + '\n', + ) + item.sourceSha256 = createHash('sha256').update(code).digest('hex') +} + +const declarations = [ + 'createStart.d.ts', + 'createStartModule.d.ts', + 'createMiddleware.d.ts', + 'createServerFn.d.ts', +].map((name) => { + const file = path.join(packageRoot, 'dist/esm', name) + return { + file, + sha256: createHash('sha256').update(fs.readFileSync(file)).digest('hex'), + } +}) +const revision = spawnSync('git', ['rev-parse', 'HEAD'], { + cwd: root, + encoding: 'utf8', +}).stdout.trim() +const status = spawnSync('git', ['status', '--porcelain'], { + cwd: root, + encoding: 'utf8', +}).stdout +const manifest = { + label, + root, + revision, + dirty: status.length > 0, + node: process.version, + compilerPackage, + compilerVersion, + factoryEntry, + requirements: modern + ? 'type-only augmentation' + : 'baseline requirement marker', + warmups, + repeats, + skipLibCheck: true, + declarations, + cases, + command: [ + process.execPath, + compiler, + '--project', + '/tsconfig.json', + '--extendedDiagnostics', + '--pretty', + 'false', + ], + notes: [ + 'Parent must build the selected checkout through Nx before running this probe.', + 'Instantiations is the primary metric. Wall time is supporting evidence only.', + 'Each subprocess is a fresh compiler process; the first run per case is discarded.', + 'No source aliases or manual declaration stubs: package exports resolve built declarations.', + "Requirements use each revision's supported syntax; executable middleware and host context are equivalent.", + 'Nested cases reuse a global object and add distinct objects with equal types, without breaking required context.', + 'skipLibCheck matches repository consumer defaults and isolates referenced generic work; full declaration correctness uses the package matrix.', + ], +} +fs.writeFileSync( + path.join(output, 'manifest.json'), + JSON.stringify(manifest, null, 2) + '\n', +) +console.log( + `Prepared ${cases.length} cases in ${output}; TypeScript ${compilerVersion}; ${run ? 'running' : 'no compiler runs requested'}.`, +) +if (run) { + const results = [] + for (const item of cases) { + const samples = [] + for (let sample = -warmups; sample < repeats; sample++) { + const started = performance.now() + const result = spawnSync( + process.execPath, + [ + compiler, + '--project', + path.join(output, item.name, 'tsconfig.json'), + '--extendedDiagnostics', + '--pretty', + 'false', + ], + { + cwd: root, + encoding: 'utf8', + timeout: 120_000, + maxBuffer: 8 * 1024 * 1024, + }, + ) + const elapsedMs = performance.now() - started + const log = `${result.stdout ?? ''}${result.stderr ?? ''}` + const sampleName = + sample < 0 ? `warmup-${sample + warmups + 1}` : `sample-${sample + 1}` + fs.writeFileSync(path.join(output, item.name, `${sampleName}.log`), log) + if (result.error || result.status !== 0) { + fs.writeFileSync( + path.join(output, 'failed.json'), + JSON.stringify( + { + case: item.name, + sample: sampleName, + status: result.status, + error: String(result.error ?? ''), + log, + }, + null, + 2, + ) + '\n', + ) + throw new Error( + `${item.name}/${sampleName} failed. See ${path.join(output, item.name, `${sampleName}.log`)}; no successful measurement claimed.`, + ) + } + const metric = (name) => + Number(new RegExp(`^${name}:\\s+([\\d.]+)`, 'm').exec(log)?.[1]) + const value = { + elapsedMs, + instantiations: metric('Instantiations'), + types: metric('Types'), + checkSeconds: metric('Check time'), + totalSeconds: metric('Total time'), + memoryKiB: metric('Memory used'), + } + if (!Number.isFinite(value.instantiations)) { + throw new Error( + `Missing extended diagnostics for ${item.name}/${sampleName}`, + ) + } + if (sample >= 0) { + samples.push(value) + } + } + const instantiationCounts = [ + ...new Set(samples.map((sample) => sample.instantiations)), + ] + if (instantiationCounts.length !== 1) { + throw new Error( + `Unstable compiler work for ${item.name}: ${instantiationCounts.join(', ')}`, + ) + } + const elapsed = samples + .map((sample) => sample.elapsedMs) + .sort((a, b) => a - b) + const result = { + ...item, + instantiations: instantiationCounts[0], + medianElapsedMs: elapsed[Math.floor(elapsed.length / 2)], + samples, + } + results.push(result) + fs.writeFileSync( + path.join(output, 'results.json'), + JSON.stringify({ ...manifest, results }, null, 2) + '\n', + ) + console.log( + `${item.name}: ${result.instantiations} instantiations; ${result.medianElapsedMs.toFixed(1)} ms median (${repeats} samples; ${warmups} discarded warmup).`, + ) + } +}