Skip to content

Commit 112589a

Browse files
committed
Merge branch 'dev' into callsite-revalidation-optout
2 parents 0715840 + c2cb601 commit 112589a

File tree

133 files changed

+8264
-4396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+8264
-4396
lines changed

.changeset/big-rings-protect.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

.changeset/bright-brooms-hammer.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Fix a Framework Mode bug where the `defaultShouldRevalidate` parameter to `shouldRevalidate` would not be correct after `action` returned a 4xx/5xx response (`true` when it should have been `false`)
6+
7+
- If your `shouldRevalidate` function relied on that parameter, you may have seen unintended revalidations

.changeset/curly-balloons-fry.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/dull-moons-share.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
"@react-router/dev": patch
3+
---
4+
5+
Load environment variables before evaluating `routes.ts`
6+
7+
For example, you can now compute your routes based on [`VITE_`-prefixed environment variables](https://vite.dev/guide/env-and-mode#env-variables):
8+
9+
```txt
10+
# .env
11+
VITE_ENV_ROUTE=my-route
12+
```
13+
14+
```ts
15+
// app/routes.ts
16+
import { type RouteConfig, route } from "@react-router/dev/routes";
17+
18+
const routes: RouteConfig = [];
19+
if (import.meta.env.VITE_ENV_ROUTE === "my-route") {
20+
routes.push(route("my-route", "routes/my-route.tsx"));
21+
}
22+
23+
export default routes;
24+
```

.changeset/fluffy-walls-add.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Fix `fetcher.submit` failing with plain objects containing a `tagName` property

.changeset/forty-bugs-turn.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/long-brooms-shake.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
[UNSTABLE] Add `unstable_pattern` to the parameters for client side `unstable_onError`, refactor how it's called by `RouterProvider` to avoid potential strict mode issues

.changeset/loud-mirrors-sneeze.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/olive-planets-think.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Add new `unstable_useTransitions` flag to routers to give users control over the usage of [`React.startTransition`](https://react.dev/reference/react/startTransition) and [`React.useOptimistic`](https://react.dev/reference/react/useOptimistic).
6+
7+
- Framework Mode + Data Mode:
8+
- `<HydratedRouter unstable_transition>`/`<RouterProvider unstable_transition>`
9+
- When left unset (current default behavior)
10+
- Router state updates are wrapped in `React.startTransition`
11+
- ⚠️ This can lead to buggy behaviors if you are wrapping your own navigations/fetchers in `React.startTransition`
12+
- You should set the flag to `true` if you run into this scenario to get the enhanced `useOptimistic` behavior (requires React 19)
13+
- When set to `true`
14+
- Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
15+
- `Link`/`Form` navigations will be wrapped in `React.startTransition`
16+
- A subset of router state info will be surfaced to the UI _during_ navigations via `React.useOptimistic` (i.e., `useNavigation()`, `useFetchers()`, etc.)
17+
- ⚠️ This is a React 19 API so you must also be React 19 to opt into this flag for Framework/Data Mode
18+
- When set to `false`
19+
- The router will not leverage `React.startTransition` or `React.useOptimistic` on any navigations or state changes
20+
- Declarative Mode
21+
- `<BrowserRouter unstable_useTransitions>`
22+
- When left unset
23+
- Router state updates are wrapped in `React.startTransition`
24+
- When set to `true`
25+
- Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
26+
- `Link`/`Form` navigations will be wrapped in `React.startTransition`
27+
- When set to `false`
28+
- the router will not leverage `React.startTransition` on any navigations or state changes

.changeset/real-chairs-exercise.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-router": patch
3+
---
4+
5+
Fix the promise returned from `useNavigate` in Framework/Data Mode so that it properly tracks the duration of `popstate` navigations (i.e., `navigate(-1)`)

0 commit comments

Comments
 (0)