Repository navigation
@tanstack/react-start@1.170.0
Minor Changes
-
#8965
611b364- Start's Vite plugin can be used in a Vitest config. When Vitest resolves the config to run tests, the plugin compiles the code as it does in the app (createServerFn,createIsomorphicFn,createServerOnlyFn,createClientOnlyFn, the server-only route options), for the client in browser mode and in jsdom or happy-dom, and for the server in the Node environment. It does not set up the app's dev server, preview server or build.- A project needs no router entry and no routes. A package that only uses Start's compile-time APIs used to fail with "Could not resolve entry for router entry".
- The route tree is generated once, when Vitest starts, and only for a project with a router entry and a routes directory. It is not regenerated while Vitest watches.
- A test run never writes route files: a route file with an outdated route path and an empty route file are left as they are, with a warning.
- A module that calls
createFileRoute,createRootRouteorcreateRootRouteWithContextloses itsserver,ssrandheadersoptions in client code even when the route generator does not know the module. - It needs Vitest 5.1.1 or later. Before, Vitest's translation of the wildcards in
resolve.noExternalmissed a package name with a dash, so in a project that installs Start from the registry, jsdom, happy-dom and Node tests ran@tanstack/start-client-corewithout the Start compiler.
For this,
Generatorof@tanstack/router-generatortakeswriteRouteFiles: false, andtanstackRouterGeneratorof@tanstack/router-plugin/vitetakes options for the plugin that embeds it.
Patch Changes
-
#8965
611b364- fix: Vite pre-bundles@tanstack/react-storefor a project that depends on@tanstack/react-startbut not on@tanstack/react-routeritself. Start named the dependency by a path through@tanstack/react-router, which only resolves from a project that depends on the router. In such a project Vite warned "Failed to resolve dependency: @tanstack/react-router > @tanstack/react-store", and a browser failed to load the store's CommonJS dependency (use-sync-external-store). -
Updated dependencies [
611b364,611b364]:- @tanstack/start-plugin-core@1.173.0
- @tanstack/react-start-rsc@0.1.69