Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,19 @@
"@playground/split-route-modules-spa": "0.0.0",
"@playground/vite-plugin-cloudflare": "0.0.0"
},
"changesets": []
"changesets": [
"bright-brooms-hammer",
"dull-moons-share",
"fluffy-walls-add",
"long-brooms-shake",
"olive-planets-think",
"real-chairs-exercise",
"rotten-grapes-cough",
"shiny-pans-admire",
"six-ways-carry",
"spicy-camels-love",
"stabilize-split-route-modules",
"stabilize-vite-environment-api",
"witty-ears-itch"
]
}
2 changes: 2 additions & 0 deletions packages/create-react-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `create-react-router`

## 7.10.0-pre.0

## 7.9.6

## 7.9.5
Expand Down
2 changes: 1 addition & 1 deletion packages/create-react-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-react-router",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Create a new React Router app",
"homepage": "https://reactrouter.com",
"bugs": {
Expand Down
8 changes: 8 additions & 0 deletions packages/react-router-architect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# `@react-router/architect`

## 7.10.0-pre.0

### Patch Changes

- Updated dependencies:
- `react-router@7.10.0-pre.0`
- `@react-router/node@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-architect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/architect",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Architect server request handler for React Router",
"bugs": {
"url": "https://github.com/remix-run/react-router/issues"
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router-cloudflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@react-router/cloudflare`

## 7.10.0-pre.0

### Patch Changes

- Updated dependencies:
- `react-router@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/cloudflare",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Cloudflare platform abstractions for React Router",
"bugs": {
"url": "https://github.com/remix-run/react-router/issues"
Expand Down
38 changes: 38 additions & 0 deletions packages/react-router-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# `@react-router/dev`

## 7.10.0-pre.0

### Minor Changes

- Stabilize `future.v8_splitRouteModules`, replacing `future.unstable_splitRouteModules` ([#14595](https://github.com/remix-run/react-router/pull/14595))
- ⚠️ This is a breaking change if you have begun using `future.unstable_splitRouteModules`. Please update your `react-router.config.ts`.

- Stabilize `future.v8_viteEnvironmentApi`, replacing `future.unstable_viteEnvironmentApi` ([#14595](https://github.com/remix-run/react-router/pull/14595))
- ⚠️ This is a breaking change if you have begun using `future.unstable_viteEnvironmentApi`. Please update your `react-router.config.ts`.

### Patch Changes

- Load environment variables before evaluating `routes.ts` ([#14446](https://github.com/remix-run/react-router/pull/14446))

For example, you can now compute your routes based on [`VITE_`-prefixed environment variables](https://vite.dev/guide/env-and-mode#env-variables):

```txt
# .env
VITE_ENV_ROUTE=my-route
```

```ts
// app/routes.ts
import { type RouteConfig, route } from "@react-router/dev/routes";

const routes: RouteConfig = [];
if (import.meta.env.VITE_ENV_ROUTE === "my-route") {
routes.push(route("my-route", "routes/my-route.tsx"));
}

export default routes;
```

- Updated dependencies:
- `react-router@7.10.0-pre.0`
- `@react-router/node@7.10.0-pre.0`
- `@react-router/serve@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/dev",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Dev tools and CLI for React Router",
"homepage": "https://reactrouter.com",
"bugs": {
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router-dom/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# react-router-dom

## 7.10.0-pre.0

### Patch Changes

- Updated dependencies:
- `react-router@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dom/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router-dom",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Declarative routing for React web applications",
"keywords": [
"react",
Expand Down
8 changes: 8 additions & 0 deletions packages/react-router-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# `@react-router/express`

## 7.10.0-pre.0

### Patch Changes

- Updated dependencies:
- `react-router@7.10.0-pre.0`
- `@react-router/node@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/express",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Express server request handler for React Router",
"bugs": {
"url": "https://github.com/remix-run/react-router/issues"
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router-fs-routes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@react-router/fs-routes`

## 7.10.0-pre.0

### Patch Changes

- Updated dependencies:
- `@react-router/dev@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-fs-routes/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/fs-routes",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "File system routing conventions for React Router, for use within routes.ts",
"bugs": {
"url": "https://github.com/remix-run/react-router/issues"
Expand Down
7 changes: 7 additions & 0 deletions packages/react-router-node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@react-router/node`

## 7.10.0-pre.0

### Patch Changes

- Updated dependencies:
- `react-router@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/node",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Node.js platform abstractions for React Router",
"bugs": {
"url": "https://github.com/remix-run/react-router/issues"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@react-router/remix-config-routes-adapter`

## 7.10.0-pre.0

### Patch Changes

- Updated dependencies:
- `@react-router/dev@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/remix-routes-option-adapter",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Adapter for Remix's \"routes\" config option, for use within routes.ts",
"bugs": {
"url": "https://github.com/remix-run/react-router/issues"
Expand Down
9 changes: 9 additions & 0 deletions packages/react-router-serve/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# `@react-router/serve`

## 7.10.0-pre.0

### Patch Changes

- Updated dependencies:
- `react-router@7.10.0-pre.0`
- `@react-router/node@7.10.0-pre.0`
- `@react-router/express@7.10.0-pre.0`

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-serve/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-router/serve",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Production application server for React Router",
"bugs": {
"url": "https://github.com/remix-run/react-router/issues"
Expand Down
68 changes: 68 additions & 0 deletions packages/react-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,73 @@
# `react-router`

## 7.10.0-pre.0

### Minor Changes

- Stabilize `fetcher.reset()` ([#14545](https://github.com/remix-run/react-router/pull/14545))
- ⚠️ This is a breaking change if you have begun using `fetcher.unstable_reset()`

- Stabilize the `dataStrategy` `match.shouldRevalidateArgs`/`match.shouldCallHandler()` APIs. ([#14592](https://github.com/remix-run/react-router/pull/14592))
- The `match.shouldLoad` API is now marked deprecated in favor of these more powerful alternatives
- If you're using this API in a custom `dataStrategy` today, you can swap to the new API at your convenience:

```tsx
// Before
const matchesToLoad = matches.filter((m) => m.shouldLoad);

// After
const matchesToLoad = matches.filter((m) => m.shouldCallHandler());
```

- `match.shouldRevalidateArgs` is the argument that will be passed to the route `shouldRevaliate` function
- Combined with the parameter accepted by `match.shouldCallHandler`, you can define a custom revalidation behavior for your `dataStrategy`:

```tsx
const matchesToLoad = matches.filter((m) => {
const defaultShouldRevalidate = customRevalidationBehavior(
match.shouldRevalidateArgs,
);
return m.shouldCallHandler(defaultShouldRevalidate);
// The argument here will override the internal `defaultShouldRevalidate` value
});
```

### Patch Changes

- 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`) ([#14592](https://github.com/remix-run/react-router/pull/14592))
- If your `shouldRevalidate` function relied on that parameter, you may have seen unintended revalidations

- Fix `fetcher.submit` failing with plain objects containing a `tagName` property ([#14534](https://github.com/remix-run/react-router/pull/14534))
- [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 ([#14573](https://github.com/remix-run/react-router/pull/14573))
- 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). ([#14524](https://github.com/remix-run/react-router/pull/14524))
- Framework Mode + Data Mode:
- `<HydratedRouter unstable_transition>`/`<RouterProvider unstable_transition>`
- When left unset (current default behavior)
- Router state updates are wrapped in `React.startTransition`
- ⚠️ This can lead to buggy behaviors if you are wrapping your own navigations/fetchers in `React.startTransition`
- You should set the flag to `true` if you run into this scenario to get the enhanced `useOptimistic` behavior (requires React 19)
- When set to `true`
- Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
- `Link`/`Form` navigations will be wrapped in `React.startTransition`
- A subset of router state info will be surfaced to the UI _during_ navigations via `React.useOptimistic` (i.e., `useNavigation()`, `useFetchers()`, etc.)
- ⚠️ This is a React 19 API so you must also be React 19 to opt into this flag for Framework/Data Mode
- When set to `false`
- The router will not leverage `React.startTransition` or `React.useOptimistic` on any navigations or state changes
- Declarative Mode
- `<BrowserRouter unstable_useTransitions>`
- When left unset
- Router state updates are wrapped in `React.startTransition`
- When set to `true`
- Router state updates remain wrapped in `React.startTransition` (as they are without the flag)
- `Link`/`Form` navigations will be wrapped in `React.startTransition`
- When set to `false`
- the router will not leverage `React.startTransition` on any navigations or state changes

- Fix the promise returned from `useNavigate` in Framework/Data Mode so that it properly tracks the duration of `popstate` navigations (i.e., `navigate(-1)`) ([#14524](https://github.com/remix-run/react-router/pull/14524))
- Fix internal type error in useRoute types that surfaces when skipLibCheck is disabled ([#14577](https://github.com/remix-run/react-router/pull/14577))
- Preserve `statusText` on the `ErrorResponse` instance when throwing `data()` from a route handler ([#14555](https://github.com/remix-run/react-router/pull/14555))
- Optimize href() to avoid backtracking regex on splat ([#14329](https://github.com/remix-run/react-router/pull/14329))

## 7.9.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-router",
"version": "7.9.6",
"version": "7.10.0-pre.0",
"description": "Declarative routing for React",
"keywords": [
"react",
Expand Down