chore: Update version for release #13051
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to release-next, this PR will be updated.
Releases
react-router@7.2.0
Minor Changes
New type-safe
href
utility that guarantees links point to actual paths in your app (#13012)Patch Changes
Fix typegen for repeated params (#13012)
In React Router, path parameters are keyed by their name.
So for a path pattern like
/a/:id/b/:id?/c/:id
, the last:id
will set the value forid
inuseParams
and theparams
prop.For example,
/a/1/b/2/c/3
will result in the value{ id: 3 }
at runtime.Previously, generated types for params incorrectly modeled repeated params with an array.
So
/a/1/b/2/c/3
generated a type like{ id: [1,2,3] }
.To be consistent with runtime behavior, the generated types now correctly model the "last one wins" semantics of path parameters.
So
/a/1/b/2/c/3
now generates a type like{ id: 3 }
.Don't apply Single Fetch revalidation de-optimization when in SPA mode since there is no server HTTP request (#12948)
Properly handle revalidations to across a prerender/SPA boundary (#13021)
.data
requests if the path wasn't pre-rendered because the request will 404loader
data inssr:false
mode is static because it's generated at build timeclientLoader
to do anything dynamicloader
and not aclientLoader
, we disable revalidation by default because there is no new data to retrieve.data
request logic if there are no server loaders withshouldLoad=true
in our single fetchdataStrategy
.data
request that would 404 after a submissionError at build time in
ssr:false
+prerender
apps for the edge case scenario of: (#13021)loader
(does not have aclientLoader
)loaderData
because there is no server on which to run theloader
clientLoader
or pre-rendering the child pathsclientLoader
, calling theserverLoader()
on non-prerendered paths will throw a 404[REMOVE] Fix prerender calls to serverLoader from clientLoader (#13047)
Add unstable support for splitting route modules in framework mode via
future.unstable_splitRouteModules
(#11871)Add
unstable_SerializesTo
brand type for library authors to register types serializable by React Router's streaming format (turbo-stream
) (ab5b05b02
)Align dev server behavior with static file server behavior when
ssr:false
is set (#12948)prerender
config exists, only SSR down to the rootHydrateFallback
(SPA Mode)prerender
config exists but the current path is not prerendered, only SSR down to the rootHydrateFallback
(SPA Fallback).data
requests to non-pre-rendered pathsImprove prefetch performance of CSS side effects in framework mode (#12889)
Disable Lazy Route Discovery for all
ssr:false
apps and not just "SPA Mode" because there is no runtime server to serve the search-param-configured__manifest
requests (#12894)ssr:false
and noprerender
config but we realized it should apply to allssr:false
apps, including those prerendering multiple pagesprerender
scenarios we would prerender the/__manifest
file assuming the static file server would serve it but that makes some unneccesary assumptions about the static file server behaviorsProperly handle interrupted manifest requests in lazy route discovery (#12915)
@react-router/dev@7.2.0
Minor Changes
Generate a "SPA fallback" HTML file for scenarios where applications are prerendering the
/
route withssr:false
(#12948)ssr:false
without aprerender
config, this is considered "SPA Mode" and the generatedindex.html
file will only render down to the root route and will be able to hydrate for any valid application pathssr:false
with aprerender
config but do not include the/
path (i.e.,prerender: ['/blog/post']
), then we still generate a "SPA Mode"index.html
file that can hydrate for any path in the applicationssr:false
and included the/
path in yourprerender
config, we would prerender the/
route intoindex.html
as a non-SPA page__spa-fallback.html
that will allow you to hydrate for any non-prerendered pathsssr:false
app and serve the others as a SPAnpx sirv-cli build/client --single __spa-fallback.html
loader
in the root route in SPA mode because it can be called/server-rendered at build time (#12948)Route.HydrateFallbackProps
now also receivesloaderData
HydrateFallback
is rendering while children routes are loadingundefined
if theHydrateFallback
is rendering because the route has it's own hydratingclientLoader
index.html
New type-safe
href
utility that guarantees links point to actual paths in your app (#13012)Patch Changes
Handle custom
envDir
in Vite config (#12969)Fix typegen for repeated params (#13012)
In React Router, path parameters are keyed by their name.
So for a path pattern like
/a/:id/b/:id?/c/:id
, the last:id
will set the value forid
inuseParams
and theparams
prop.For example,
/a/1/b/2/c/3
will result in the value{ id: 3 }
at runtime.Previously, generated types for params incorrectly modeled repeated params with an array.
So
/a/1/b/2/c/3
generated a type like{ id: [1,2,3] }
.To be consistent with runtime behavior, the generated types now correctly model the "last one wins" semantics of path parameters.
So
/a/1/b/2/c/3
now generates a type like{ id: 3 }
.Fix CLI parsing to allow argumentless
npx react-router
usage (#12925)Fix
ArgError: unknown or unexpected option: --version
when runningreact-router --version
(#13012)Skip action-only resource routes when using
prerender:true
(#13004)Enhance invalid export detection when using
ssr:false
(#12948)headers
/action
are prohibited in all routes withssr:false
because there will be no runtime server on which to run themloader
functions are more nuanced and depend on whether a given route is prerenderedssr:false
without aprerender
config, only theroot
route can have aloader
index.html
file with the root routeHydrateFallback
so it is capable of hydrating for any path in your application - therefore we can only call a root routeloader
at build timessr:false
with aprerender
config, you can export aloader
from routes matched by one of theprerender
paths because those routes will be server rendered at build timeloader
from a route that is never matched by aprerender
path will throw a build time error because there will be no runtime server to ever run the loaderLimit prerendered resource route
.data
files to only the target route (#13004)Add unstable support for splitting route modules in framework mode via
future.unstable_splitRouteModules
(#11871)Fix prerendering of binary files (#13039)
Add
future.unstable_viteEnvironmentApi
flag to enable experimental Vite Environment API support (#12936)Disable Lazy Route Discovery for all
ssr:false
apps and not just "SPA Mode" because there is no runtime server to serve the search-param-configured__manifest
requests (#12894)ssr:false
and noprerender
config but we realized it should apply to allssr:false
apps, including those prerendering multiple pagesprerender
scenarios we would prerender the/__manifest
file assuming the static file server would serve it but that makes some unneccesary assumptions about the static file server behaviors[REMOVE] Update invalid route export messages (#13049)
Updated dependencies:
react-router@7.2.0
@react-router/node@7.2.0
@react-router/serve@7.2.0
@react-router/architect@7.2.0
Patch Changes
react-router@7.2.0
@react-router/node@7.2.0
@react-router/cloudflare@7.2.0
Patch Changes
react-router@7.2.0
react-router-dom@7.2.0
Patch Changes
react-router@7.2.0
@react-router/express@7.2.0
Patch Changes
react-router@7.2.0
@react-router/node@7.2.0
@react-router/fs-routes@7.2.0
Patch Changes
@react-router/dev@7.2.0
@react-router/node@7.2.0
Patch Changes
react-router@7.2.0
@react-router/remix-routes-option-adapter@7.2.0
Patch Changes
@react-router/dev@7.2.0
@react-router/serve@7.2.0
Patch Changes
react-router@7.2.0
@react-router/node@7.2.0
@react-router/express@7.2.0
create-react-router@7.2.0