Skip to content

Commit 14690a1

Browse files
committed
Update release notes
1 parent e8719ad commit 14690a1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,14 @@ In order to use your build-time loader data during pre-rendering, we now also ex
351351
- We previously only disabled this for "SPA Mode" but we realized it should apply to all `ssr:false` apps
352352
- In those `prerender` scenarios we would pre-render the `/__manifest` file but that makes some unnecessary assumptions about the static file server behaviors
353353
- `react-router` - Don't apply Single Fetch revalidation de-optimization when in SPA mode since there is no server HTTP request ([#12948](https://github.com/remix-run/react-router/pull/12948))
354+
- `react-router` - Properly handle revalidations to across a pre-render/SPA boundary ([#13021](https://github.com/remix-run/react-router/pull/13021))
355+
- In "hybrid" applications where some routes are pre-rendered and some are served from a SPA fallback, we need to avoid making `.data` requests if the path wasn't pre-rendered because the request will 404
356+
- We don't know all the pre-rendered paths client-side, however:
357+
- All `loader` data in `ssr:false` mode is static because it's generated at build time
358+
- A route must use a `clientLoader` to do anything dynamic
359+
- Therefore, if a route only has a `loader` and not a `clientLoader`, we disable revalidation by default because there is no new data to retrieve
360+
- We short circuit and skip single fetch `.data` request logic if there are no server loaders with `shouldLoad=true` in our single fetch `dataStrategy`
361+
- This ensures that the route doesn't cause a `.data` request that would 404 after a submission
354362
- `react-router` - Align dev server behavior with static file server behavior when `ssr:false` is set ([#12948](https://github.com/remix-run/react-router/pull/12948))
355363
- When no `prerender` config exists, only SSR down to the root `HydrateFallback` (SPA Mode)
356364
- When a `prerender` config exists but the current path is not pre-rendered, only SSR down to the root `HydrateFallback` (SPA Fallback)
@@ -365,6 +373,13 @@ In order to use your build-time loader data during pre-rendering, we now also ex
365373
- `loader` functions are more nuanced and depend on whether a given route is prerendered
366374
- When using `ssr:false` without a `prerender` config, only the `root` route can have a `loader`
367375
- When using `ssr:false` with a `prerender` config, only routes matched by a `prerender` path can have a `loader`
376+
- `@react-router/dev` - Error at build time in `ssr:false` + `prerender` apps for the edge case scenario of: ([#13021](https://github.com/remix-run/react-router/pull/13021))
377+
- A parent route has only a `loader` (does not have a `clientLoader`)
378+
- The parent route is pre-rendered
379+
- The parent route has children routes which are not prerendered
380+
- This means that when the child paths are loaded via the SPA fallback, the parent won't have any `loaderData` because there is no server on which to run the `loader`
381+
- This can be resolved by either adding a parent `clientLoader` or pre-rendering the child paths
382+
- If you add a `clientLoader`, calling the `serverLoader()` on non-prerendered paths will throw a 404
368383
- `@react-router/dev` - Limit prerendered resource route `.data` files to only the target route ([#13004](https://github.com/remix-run/react-router/pull/13004))
369384
- `@react-router/dev` - Fix typegen for repeated params ([#13012](https://github.com/remix-run/react-router/pull/13012))
370385
- 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 for `id` in `useParams` and the `params` prop

0 commit comments

Comments
 (0)