You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -351,6 +351,14 @@ In order to use your build-time loader data during pre-rendering, we now also ex
351
351
- We previously only disabled this for "SPA Mode" but we realized it should apply to all `ssr:false` apps
352
352
- In those `prerender` scenarios we would pre-render the `/__manifest` file but that makes some unnecessary assumptions about the static file server behaviors
353
353
-`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
354
362
-`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))
355
363
- When no `prerender` config exists, only SSR down to the root `HydrateFallback` (SPA Mode)
356
364
- 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
365
373
-`loader` functions are more nuanced and depend on whether a given route is prerendered
366
374
- When using `ssr:false` without a `prerender` config, only the `root` route can have a `loader`
367
375
- 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
368
383
-`@react-router/dev` - Limit prerendered resource route `.data` files to only the target route ([#13004](https://github.com/remix-run/react-router/pull/13004))
369
384
-`@react-router/dev` - Fix typegen for repeated params ([#13012](https://github.com/remix-run/react-router/pull/13012))
370
385
- 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