From 8f73c5c73f47691339efbf3c34fb7345a7435ed6 Mon Sep 17 00:00:00 2001 From: Mark Dalgleish Date: Wed, 26 Nov 2025 15:37:46 +1100 Subject: [PATCH 01/51] Add initial AGENTS.md (#14594) Co-authored-by: Matt Brophy --- AGENTS.md | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000000..122c097ecc --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,160 @@ +# React Router Development Guide + +## Commands + +- **Build**: `pnpm build` (all packages) or `pnpm run --filter build` (single package) +- **Test (Jest)**: `pnpm test` (all packages), `pnpm test packages//` (single package), `pnpm test packages/react-router/__tests__/router/fetchers-test.ts` (single file), or `pnpm test -- -t "action fetch"` (tests matching name) +- **Integration tests (Playwright)**: `pnpm test:integration --project chromium` (build + test all), `pnpm test:integration:run --project chromium` (test only, all), `pnpm test:integration:run --project chromium integration/middleware-test.ts` (single file), or `pnpm test:integration:run --project chromium -g "middleware"` (tests matching name) +- **Typecheck**: `pnpm run typecheck` +- **Lint**: `pnpm run lint` +- **Docs generation**: `pnpm run docs` (regenerates API docs from JSDoc) +- **Type generation**: `pnpm run typegen` (Framework Mode only) +- **Clean**: `pnpm run clean` (git clean -fdX) + +## Modes + +**Five distinct modes**: Declarative, Data, Framework, RSC Data (unstable), RSC Framework (unstable). **Always identify which mode(s) a feature applies to.** + +1. **Declarative**: ``, ``, `` +2. **Data**: `createBrowserRouter()` with `loader`/`action`, `` +3. **Framework**: Vite plugin + `routes.ts` + Route Module API (route exports like `loader`, `action`, `default`) + type generation + SSR/SPA +4. **RSC Data** (unstable): RSC runtime APIs, manual bundler setup, runtime route config +5. **RSC Framework** (unstable): Framework Mode with `unstable_reactRouterRSC` Vite plugin + +**RSC mode differences:** + +- **RSC Framework**: `unstable_reactRouterRSC` plugin, `@vitejs/plugin-rsc`, different entry points/format +- **RSC Data**: Manual bundler, runtime route config typically in `src/routes.ts`, `unstable_RSCRouteConfig`, different runtime APIs, `setupRscTest` in `integration/rsc/`, tests Vite + Parcel + +## Architecture + +- **Monorepo**: pnpm workspace, packages in `packages/` +- **Key packages**: + - `react-router`: Core (all modes) - `lib/components.tsx`, `lib/hooks.tsx`, `lib/router/`, `lib/dom/`, `lib/rsc/` + - `@react-router/dev`: Framework tooling - `vite/plugin.ts` (Framework), `vite/rsc/plugin.ts` (RSC Framework), `typegen/` + - `react-router-dom`: Re-exports `react-router` (v6→v7 compat) + - `@react-router/node`, `@react-router/cloudflare`, `@react-router/express`: Server adapters + - `@react-router/serve`: Minimal server for Framework Mode + - `@react-router/fs-routes`: File-system routing (`flatRoutes()`) + +## Testing + +### Unit Tests (`packages/react-router/__tests__/`) + +Use Jest for pure routing logic, pure server runtime behavior, router state, React component behavior. No build required. + +```bash +pnpm test # All packages +pnpm test packages/react-router/ # Single package +pnpm test packages/react-router/__tests__/router/fetchers-test.ts # Single file +pnpm test -- -t "action fetch" # Tests matching name +``` + +### Integration Tests (`integration/`) + +Use Playwright for Vite plugin, build pipeline, SSR/hydration, RSC, type generation. + +```bash +pnpm test:integration --project chromium # Build + test all +pnpm test:integration:run --project chromium # Test only, all +pnpm test:integration:run --project chromium integration/middleware-test.ts # Single file +pnpm test:integration:run --project chromium -g "middleware" # Tests matching name +``` + +**Project**: Always use `chromium` for integration tests, unless explicitly stated otherwise. + +**Rebuild when**: First run, after changing `packages/` (not needed for test-only changes) + +**Organization**: Use `createFixture()` → `createAppFixture()` → `PlaywrightFixture`. Templates available: `vite-6-template/`, `rsc-vite-framework/`, etc. Test all applicable modes (iterate over template array when behavior should work across modes). Test both states when introducing future flags (one test with flag on, one with flag off). + +**RSC testing**: + +- **RSC Framework**: Use `createFixture` with `rsc-vite-framework/` template +- **RSC Data**: Use `setupRscTest` in `integration/rsc/`, tests Vite + Parcel + +Test shared behavior across multiple templates (e.g., `["vite-5-template", "rsc-vite-framework"]`). Test RSC-specific features against RSC template. + +## routes.ts + +Framework Mode uses `routes.ts` in `app/`. Most tests use `flatRoutes()` for file-system routing: + +```ts +// app/routes.ts +import { type RouteConfig } from "@react-router/dev/routes"; +import { flatRoutes } from "@react-router/fs-routes"; + +export default flatRoutes() satisfies RouteConfig; +``` + +**File-system conventions** (`app/routes/`): + +- `_index.tsx` → `/` (index route) +- `about.tsx` → `/about` +- `blog.$slug.tsx` → `/blog/:slug` (URL param) +- `settings.profile.tsx` → `/settings/profile` (`.` creates nesting) +- `_layout.tsx` → pathless layout route + +**Manual config alternative**: + +```ts +import { index, route, layout } from "@react-router/dev/routes"; +export default [ + index("./home.tsx"), + route("about", "./about.tsx"), + layout("./auth-layout.tsx", [route("login", "./login.tsx")]), +]; +``` + +## Documentation + +**Don't edit generated files**: `docs/api/` (from JSDoc), `.react-router/types/` (from typegen) + +**Mode indicators**: Every doc needs `[MODES: framework, data, declarative]` + +**API docs**: Edit JSDoc in `packages/react-router/lib/`, run `pnpm docs` + +**Unstable features**: Prefix `unstable_`, add `unstable: true` to frontmatter, include warning block + +## Future Flags + +- **Future flags** (`vX_*`): Stable breaking changes for next major +- **Unstable flags** (`unstable_*`): Experimental, may change + +Test both states (on/off) for future flags. Don't break existing behavior without a flag. + +## Changesets + +When making changes that affect users, create a changeset at `.changeset/.md`. If iterating on a change that hasn't shipped yet, update the existing changeset file instead of creating a new one. + +Format: + +```markdown +--- +"react-router": patch +"@react-router/dev": minor +--- + +Brief description of the change + +- Additional details if needed +``` + +## Branching + +- **`main`**: Latest stable release +- **`dev`**: Active development (branch from here for code changes) +- **`v6`**: v6.x maintenance +- Branch from `main` for docs-only changes + +## Key Files + +| Purpose | Location | +| ----------------- | ----------------------------------------------------------- | +| Router | `packages/react-router/lib/router/router.ts` | +| React API | `packages/react-router/lib/components.tsx`, `lib/hooks.tsx` | +| Vite plugin | `packages/react-router-dev/vite/plugin.ts` | +| RSC Vite plugin | `packages/react-router-dev/vite/rsc/plugin.ts` | +| Type generation | `packages/react-router-dev/typegen/` | +| Unit tests | `packages/react-router/__tests__/` | +| Integration tests | `integration/` | +| Decision docs | `decisions/` | From c2cb6013d35565f3f5920366a60d4a444a347ef3 Mon Sep 17 00:00:00 2001 From: Haruto Takeuchi Date: Fri, 28 Nov 2025 12:09:26 +0900 Subject: [PATCH 02/51] chore(dev): update `valibot` (#14608) * Update valibot dependency to ^1.2.0 * Add harucn to contributors.yml * Add changeset --- .changeset/silent-shirts-retire.md | 5 +++++ contributors.yml | 1 + packages/react-router-dev/package.json | 2 +- pnpm-lock.yaml | 10 +++++----- 4 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 .changeset/silent-shirts-retire.md diff --git a/.changeset/silent-shirts-retire.md b/.changeset/silent-shirts-retire.md new file mode 100644 index 0000000000..2e89b71565 --- /dev/null +++ b/.changeset/silent-shirts-retire.md @@ -0,0 +1,5 @@ +--- +"@react-router/dev": patch +--- + +Update `valibot` dependency to `^1.2.0` diff --git a/contributors.yml b/contributors.yml index d66ecb9e2b..8e75e7a10f 100644 --- a/contributors.yml +++ b/contributors.yml @@ -144,6 +144,7 @@ - haivuw - hampelm - harshmangalam +- harucn - HelpMe-Pls - HenriqueLimas - hernanif1 diff --git a/packages/react-router-dev/package.json b/packages/react-router-dev/package.json index c2809b6bb1..5a836e9429 100644 --- a/packages/react-router-dev/package.json +++ b/packages/react-router-dev/package.json @@ -90,7 +90,7 @@ "react-refresh": "^0.14.0", "semver": "^7.3.7", "tinyglobby": "^0.2.14", - "valibot": "^1.1.0", + "valibot": "^1.2.0", "vite-node": "^3.2.2" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dd0281e157..af765b3984 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1120,8 +1120,8 @@ importers: specifier: ^0.2.14 version: 0.2.14 valibot: - specifier: ^1.1.0 - version: 1.1.0(typescript@5.4.5) + specifier: ^1.2.0 + version: 1.2.0(typescript@5.4.5) vite-node: specifier: ^3.2.2 version: 3.2.4(@types/node@20.11.30)(jiti@2.4.2)(lightningcss@1.30.1)(tsx@4.19.3)(yaml@2.8.0) @@ -9507,8 +9507,8 @@ packages: typescript: optional: true - valibot@1.1.0: - resolution: {integrity: sha512-Nk8lX30Qhu+9txPYTwM0cFlWLdPFsFr6LblzqIySfbZph9+BFsAHsNvHOymEviUepeIW6KFHzpX8TKhbptBXXw==} + valibot@1.2.0: + resolution: {integrity: sha512-mm1rxUsmOxzrwnX5arGS+U4T25RdvpPjPN4yR0u9pUBov9+zGVtO84tif1eY4r6zWxVxu3KzIyknJy3rxfRZZg==} peerDependencies: typescript: '>=5' peerDependenciesMeta: @@ -19198,7 +19198,7 @@ snapshots: optionalDependencies: typescript: 5.4.5 - valibot@1.1.0(typescript@5.4.5): + valibot@1.2.0(typescript@5.4.5): optionalDependencies: typescript: 5.4.5 From f36a3b0862db885272911bf9f40a90187791bce1 Mon Sep 17 00:00:00 2001 From: Remix Run Bot Date: Tue, 2 Dec 2025 16:23:49 +0000 Subject: [PATCH 03/51] chore: generate markdown docs from jsdocs --- docs/api/data-routers/createBrowserRouter.md | 189 ++----------------- docs/api/data-routers/createHashRouter.md | 189 ++----------------- docs/api/data-routers/createMemoryRouter.md | 30 ++- 3 files changed, 59 insertions(+), 349 deletions(-) diff --git a/docs/api/data-routers/createBrowserRouter.md b/docs/api/data-routers/createBrowserRouter.md index ff0ca8c1bd..185f482fe2 100644 --- a/docs/api/data-routers/createBrowserRouter.md +++ b/docs/api/data-routers/createBrowserRouter.md @@ -47,189 +47,32 @@ Basename path for the application. ### opts.dataStrategy -Override the default data strategy of running loaders in parallel. -See [`DataStrategyFunction`](https://api.reactrouter.com/v7/interfaces/react_router.DataStrategyFunction.html). - -This is a low-level API intended for advanced use-cases. This -overrides React Router's internal handling of -[`action`](../../start/data/route-object#action)/[`loader`](../../start/data/route-object#loader) -execution, and if done incorrectly will break your app code. Please use -with caution and perform the appropriate testing. - -By default, React Router is opinionated about how your data is loaded/submitted - -and most notably, executes all of your [`loader`](../../start/data/route-object#loader)s -in parallel for optimal data fetching. While we think this is the right -behavior for most use-cases, we realize that there is no "one size fits all" -solution when it comes to data fetching for the wide landscape of -application requirements. - -The `dataStrategy` option gives you full control over how your [`action`](../../start/data/route-object#action)s -and [`loader`](../../start/data/route-object#loader)s are executed and lays -the foundation to build in more advanced APIs such as middleware, context, -and caching layers. Over time, we expect that we'll leverage this API -internally to bring more first class APIs to React Router, but until then -(and beyond), this is your way to add more advanced functionality for your -application's data needs. - -The `dataStrategy` function should return a key/value-object of -`routeId` -> [`DataStrategyResult`](https://api.reactrouter.com/v7/interfaces/react_router.DataStrategyResult.html) and should include entries for any -routes where a handler was executed. A `DataStrategyResult` indicates if -the handler was successful or not based on the `DataStrategyResult.type` -field. If the returned `DataStrategyResult.result` is a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response), -React Router will unwrap it for you (via [`res.json`](https://developer.mozilla.org/en-US/docs/Web/API/Response/json) -or [`res.text`](https://developer.mozilla.org/en-US/docs/Web/API/Response/text)). -If you need to do custom decoding of a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) -but want to preserve the status code, you can use the `data` utility to -return your decoded data along with a `ResponseInit`. - -
-Example dataStrategy Use Cases - -**Adding logging** - -In the simplest case, let's look at hooking into this API to add some logging -for when our route [`action`](../../start/data/route-object#action)s/[`loader`](../../start/data/route-object#loader)s -execute: +Override the default data strategy of running loaders in parallel - +see the [docs](../../how-to/data-strategy) for more information. ```tsx let router = createBrowserRouter(routes, { - async dataStrategy({ matches, request }) { - const matchesToLoad = matches.filter((m) => m.shouldLoad); - const results: Record = {}; - await Promise.all( - matchesToLoad.map(async (match) => { - console.log(`Processing ${match.route.id}`); - results[match.route.id] = await match.resolve();; - }) + async dataStrategy({ + matches, + request, + runClientMiddleware, + }) { + const matchesToLoad = matches.filter((m) => + m.shouldCallHandler(), ); - return results; - }, -}); -``` - -**Middleware** -Let's define a middleware on each route via [`handle`](../../start/data/route-object#handle) -and call middleware sequentially first, then call all -[`loader`](../../start/data/route-object#loader)s in parallel - providing -any data made available via the middleware: - -```ts -const routes = [ - { - id: "parent", - path: "/parent", - loader({ request }, context) { - // ... - }, - handle: { - async middleware({ request }, context) { - context.parent = "PARENT MIDDLEWARE"; - }, - }, - children: [ - { - id: "child", - path: "child", - loader({ request }, context) { - // ... - }, - handle: { - async middleware({ request }, context) { - context.child = "CHILD MIDDLEWARE"; - }, - }, - }, - ], - }, -]; - -let router = createBrowserRouter(routes, { - async dataStrategy({ matches, params, request }) { - // Run middleware sequentially and let them add data to `context` - let context = {}; - for (const match of matches) { - if (match.route.handle?.middleware) { - await match.route.handle.middleware( - { request, params }, - context - ); - } - } - - // Run loaders in parallel with the `context` value - let matchesToLoad = matches.filter((m) => m.shouldLoad); - let results = await Promise.all( - matchesToLoad.map((match, i) => - match.resolve((handler) => { - // Whatever you pass to `handler` will be passed as the 2nd parameter - // to your loader/action - return handler(context); - }) - ) - ); - return results.reduce( - (acc, result, i) => - Object.assign(acc, { - [matchesToLoad[i].route.id]: result, + const results: Record = {}; + await runClientMiddleware(() => + Promise.all( + matchesToLoad.map(async (match) => { + results[match.route.id] = await match.resolve(); }), - {} + ), ); - }, -}); -``` - -**Custom Handler** - -It's also possible you don't even want to define a [`loader`](../../start/data/route-object#loader) -implementation at the route level. Maybe you want to just determine the -routes and issue a single GraphQL request for all of your data? You can do -that by setting your `route.loader=true` so it qualifies as "having a -loader", and then store GQL fragments on `route.handle`: - -```ts -const routes = [ - { - id: "parent", - path: "/parent", - loader: true, - handle: { - gql: gql` - fragment Parent on Whatever { - parentField - } - `, - }, - children: [ - { - id: "child", - path: "child", - loader: true, - handle: { - gql: gql` - fragment Child on Whatever { - childField - } - `, - }, - }, - ], - }, -]; - -let router = createBrowserRouter(routes, { - async dataStrategy({ matches, params, request }) { - // Compose route fragments into a single GQL payload - let gql = getFragmentsFromRouteHandles(matches); - let data = await fetchGql(gql); - // Parse results back out into individual route level `DataStrategyResult`'s - // keyed by `routeId` - let results = parseResultsFromGql(data); return results; }, }); ``` -
### opts.future @@ -336,7 +179,7 @@ individual routes prior to router initialization (and on any subsequently added routes via `route.lazy` or `patchRoutesOnNavigation`). This is mostly useful for observability such as wrapping navigations, fetches, as well as route loaders/actions/middlewares with logging and/or performance -tracing. +tracing. See the [docs](../../how-to/instrumentation) for more information. ```tsx let router = createBrowserRouter(routes, { diff --git a/docs/api/data-routers/createHashRouter.md b/docs/api/data-routers/createHashRouter.md index 427b74a9ec..d95832da07 100644 --- a/docs/api/data-routers/createHashRouter.md +++ b/docs/api/data-routers/createHashRouter.md @@ -149,7 +149,7 @@ individual routes prior to router initialization (and on any subsequently added routes via `route.lazy` or `patchRoutesOnNavigation`). This is mostly useful for observability such as wrapping navigations, fetches, as well as route loaders/actions/middlewares with logging and/or performance -tracing. +tracing. See the [docs](../../how-to/instrumentation) for more information. ```tsx let router = createBrowserRouter(routes, { @@ -193,189 +193,32 @@ async function logExecution(label: string, impl: () => Promise) { ### opts.dataStrategy -Override the default data strategy of running loaders in parallel. -See [`DataStrategyFunction`](https://api.reactrouter.com/v7/interfaces/react_router.DataStrategyFunction.html). - -This is a low-level API intended for advanced use-cases. This -overrides React Router's internal handling of -[`action`](../../start/data/route-object#action)/[`loader`](../../start/data/route-object#loader) -execution, and if done incorrectly will break your app code. Please use -with caution and perform the appropriate testing. - -By default, React Router is opinionated about how your data is loaded/submitted - -and most notably, executes all of your [`loader`](../../start/data/route-object#loader)s -in parallel for optimal data fetching. While we think this is the right -behavior for most use-cases, we realize that there is no "one size fits all" -solution when it comes to data fetching for the wide landscape of -application requirements. - -The `dataStrategy` option gives you full control over how your [`action`](../../start/data/route-object#action)s -and [`loader`](../../start/data/route-object#loader)s are executed and lays -the foundation to build in more advanced APIs such as middleware, context, -and caching layers. Over time, we expect that we'll leverage this API -internally to bring more first class APIs to React Router, but until then -(and beyond), this is your way to add more advanced functionality for your -application's data needs. - -The `dataStrategy` function should return a key/value-object of -`routeId` -> [`DataStrategyResult`](https://api.reactrouter.com/v7/interfaces/react_router.DataStrategyResult.html) and should include entries for any -routes where a handler was executed. A `DataStrategyResult` indicates if -the handler was successful or not based on the `DataStrategyResult.type` -field. If the returned `DataStrategyResult.result` is a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response), -React Router will unwrap it for you (via [`res.json`](https://developer.mozilla.org/en-US/docs/Web/API/Response/json) -or [`res.text`](https://developer.mozilla.org/en-US/docs/Web/API/Response/text)). -If you need to do custom decoding of a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) -but want to preserve the status code, you can use the `data` utility to -return your decoded data along with a `ResponseInit`. - -
-Example dataStrategy Use Cases - -**Adding logging** - -In the simplest case, let's look at hooking into this API to add some logging -for when our route [`action`](../../start/data/route-object#action)s/[`loader`](../../start/data/route-object#loader)s -execute: +Override the default data strategy of running loaders in parallel - +see the [docs](../../how-to/data-strategy) for more information. ```tsx let router = createBrowserRouter(routes, { - async dataStrategy({ matches, request }) { - const matchesToLoad = matches.filter((m) => m.shouldLoad); - const results: Record = {}; - await Promise.all( - matchesToLoad.map(async (match) => { - console.log(`Processing ${match.route.id}`); - results[match.route.id] = await match.resolve();; - }) + async dataStrategy({ + matches, + request, + runClientMiddleware, + }) { + const matchesToLoad = matches.filter((m) => + m.shouldCallHandler(), ); - return results; - }, -}); -``` - -**Middleware** -Let's define a middleware on each route via [`handle`](../../start/data/route-object#handle) -and call middleware sequentially first, then call all -[`loader`](../../start/data/route-object#loader)s in parallel - providing -any data made available via the middleware: - -```ts -const routes = [ - { - id: "parent", - path: "/parent", - loader({ request }, context) { - // ... - }, - handle: { - async middleware({ request }, context) { - context.parent = "PARENT MIDDLEWARE"; - }, - }, - children: [ - { - id: "child", - path: "child", - loader({ request }, context) { - // ... - }, - handle: { - async middleware({ request }, context) { - context.child = "CHILD MIDDLEWARE"; - }, - }, - }, - ], - }, -]; - -let router = createBrowserRouter(routes, { - async dataStrategy({ matches, params, request }) { - // Run middleware sequentially and let them add data to `context` - let context = {}; - for (const match of matches) { - if (match.route.handle?.middleware) { - await match.route.handle.middleware( - { request, params }, - context - ); - } - } - - // Run loaders in parallel with the `context` value - let matchesToLoad = matches.filter((m) => m.shouldLoad); - let results = await Promise.all( - matchesToLoad.map((match, i) => - match.resolve((handler) => { - // Whatever you pass to `handler` will be passed as the 2nd parameter - // to your loader/action - return handler(context); - }) - ) - ); - return results.reduce( - (acc, result, i) => - Object.assign(acc, { - [matchesToLoad[i].route.id]: result, + const results: Record = {}; + await runClientMiddleware(() => + Promise.all( + matchesToLoad.map(async (match) => { + results[match.route.id] = await match.resolve(); }), - {} + ), ); - }, -}); -``` - -**Custom Handler** - -It's also possible you don't even want to define a [`loader`](../../start/data/route-object#loader) -implementation at the route level. Maybe you want to just determine the -routes and issue a single GraphQL request for all of your data? You can do -that by setting your `route.loader=true` so it qualifies as "having a -loader", and then store GQL fragments on `route.handle`: - -```ts -const routes = [ - { - id: "parent", - path: "/parent", - loader: true, - handle: { - gql: gql` - fragment Parent on Whatever { - parentField - } - `, - }, - children: [ - { - id: "child", - path: "child", - loader: true, - handle: { - gql: gql` - fragment Child on Whatever { - childField - } - `, - }, - }, - ], - }, -]; - -let router = createBrowserRouter(routes, { - async dataStrategy({ matches, params, request }) { - // Compose route fragments into a single GQL payload - let gql = getFragmentsFromRouteHandles(matches); - let data = await fetchGql(gql); - // Parse results back out into individual route level `DataStrategyResult`'s - // keyed by `routeId` - let results = parseResultsFromGql(data); return results; }, }); ``` -
### opts.patchRoutesOnNavigation diff --git a/docs/api/data-routers/createMemoryRouter.md b/docs/api/data-routers/createMemoryRouter.md index 28b2e37c48..c8bccee7d4 100644 --- a/docs/api/data-routers/createMemoryRouter.md +++ b/docs/api/data-routers/createMemoryRouter.md @@ -47,8 +47,32 @@ Basename path for the application. ### opts.dataStrategy -Override the default data strategy of loading in parallel. -Only intended for advanced usage. +Override the default data strategy of running loaders in parallel - +see the [docs](../../how-to/data-strategy) for more information. + +```tsx +let router = createBrowserRouter(routes, { + async dataStrategy({ + matches, + request, + runClientMiddleware, + }) { + const matchesToLoad = matches.filter((m) => + m.shouldCallHandler(), + ); + + const results: Record = {}; + await runClientMiddleware(() => + Promise.all( + matchesToLoad.map(async (match) => { + results[match.route.id] = await match.resolve(); + }), + ), + ); + return results; + }, +}); +``` ### opts.future @@ -82,7 +106,7 @@ individual routes prior to router initialization (and on any subsequently added routes via `route.lazy` or `patchRoutesOnNavigation`). This is mostly useful for observability such as wrapping navigations, fetches, as well as route loaders/actions/middlewares with logging and/or performance -tracing. +tracing. See the [docs](../../how-to/instrumentation) for more information. ```tsx let router = createBrowserRouter(routes, { From 5413dcac3db7afc184fb09a3217568ec35f8c07a Mon Sep 17 00:00:00 2001 From: Remix Run Bot Date: Tue, 2 Dec 2025 16:27:02 +0000 Subject: [PATCH 04/51] chore: format --- integration/CHANGELOG.md | 1 - packages/react-router-architect/CHANGELOG.md | 3 --- packages/react-router-cloudflare/CHANGELOG.md | 3 --- packages/react-router-dev/CHANGELOG.md | 8 -------- packages/react-router-express/CHANGELOG.md | 1 - packages/react-router-node/CHANGELOG.md | 5 ----- packages/react-router-serve/CHANGELOG.md | 2 -- 7 files changed, 23 deletions(-) diff --git a/integration/CHANGELOG.md b/integration/CHANGELOG.md index 6fccf850d7..2cf67d87b7 100644 --- a/integration/CHANGELOG.md +++ b/integration/CHANGELOG.md @@ -5,7 +5,6 @@ ### Minor Changes - Unstable Vite support for Node-based Remix apps ([#7590](https://github.com/remix-run/remix/pull/7590)) - - `remix build` 👉 `vite build && vite build --ssr` - `remix dev` 👉 `vite dev` diff --git a/packages/react-router-architect/CHANGELOG.md b/packages/react-router-architect/CHANGELOG.md index 8142a98c68..3bae066134 100644 --- a/packages/react-router-architect/CHANGELOG.md +++ b/packages/react-router-architect/CHANGELOG.md @@ -63,7 +63,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -287,7 +286,6 @@ ### Major Changes - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) - - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -296,7 +294,6 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: - - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` diff --git a/packages/react-router-cloudflare/CHANGELOG.md b/packages/react-router-cloudflare/CHANGELOG.md index 800ca4c50c..ade7635d77 100644 --- a/packages/react-router-cloudflare/CHANGELOG.md +++ b/packages/react-router-cloudflare/CHANGELOG.md @@ -56,7 +56,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -255,7 +254,6 @@ - For Remix consumers migrating to React Router, all exports from `@remix-run/cloudflare-pages` are now provided for React Router consumers in the `@react-router/cloudflare` package. There is no longer a separate package for Cloudflare Pages. ([#11801](https://github.com/remix-run/react-router/pull/11801)) - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) - - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -264,7 +262,6 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: - - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` diff --git a/packages/react-router-dev/CHANGELOG.md b/packages/react-router-dev/CHANGELOG.md index ded26f4124..ffc9c3f957 100644 --- a/packages/react-router-dev/CHANGELOG.md +++ b/packages/react-router-dev/CHANGELOG.md @@ -218,7 +218,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -961,7 +960,6 @@ ``` This initial implementation targets type inference for: - - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module - `ActionData` : Action data from `action` and/or `clientAction` within your route module @@ -976,7 +974,6 @@ ``` Check out our docs for more: - - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety) - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety) @@ -1176,7 +1173,6 @@ - Vite: Provide `Unstable_ServerBundlesFunction` and `Unstable_VitePluginConfig` types ([#8654](https://github.com/remix-run/remix/pull/8654)) - Vite: add `--sourcemapClient` and `--sourcemapServer` flags to `remix vite:build` ([#8613](https://github.com/remix-run/remix/pull/8613)) - - `--sourcemapClient` - `--sourcemapClient=inline` @@ -1513,7 +1509,6 @@ - Add support for `clientLoader`/`clientAction`/`HydrateFallback` route exports ([RFC](https://github.com/remix-run/remix/discussions/7634)) ([#8173](https://github.com/remix-run/remix/pull/8173)) Remix now supports loaders/actions that run on the client (in addition to, or instead of the loader/action that runs on the server). While we still recommend server loaders/actions for the majority of your data needs in a Remix app - these provide some levers you can pull for more advanced use-cases such as: - - Leveraging a data source local to the browser (i.e., `localStorage`) - Managing a client-side cache of server data (like `IndexedDB`) - Bypassing the Remix server in a BFF setup and hitting your API directly from the browser @@ -1917,7 +1912,6 @@ - Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772)) Written to server build directory (`build/` by default): - - `metafile.css.json` - `metafile.js.json` (browser JS) - `metafile.server.json` (server JS) @@ -2015,7 +2009,6 @@ - built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483)) New options: - - `--tls-key` / `tlsKey`: TLS key - `--tls-cert` / `tlsCert`: TLS Certificate @@ -2286,7 +2279,6 @@ ``` The dev server will: - - force `NODE_ENV=development` and warn you if it was previously set to something else - rebuild your app whenever your Remix app code changes - restart your app server whenever rebuilds succeed diff --git a/packages/react-router-express/CHANGELOG.md b/packages/react-router-express/CHANGELOG.md index ed57c8b2b3..7de371d64c 100644 --- a/packages/react-router-express/CHANGELOG.md +++ b/packages/react-router-express/CHANGELOG.md @@ -63,7 +63,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option diff --git a/packages/react-router-node/CHANGELOG.md b/packages/react-router-node/CHANGELOG.md index 1f60960891..a36b0812a4 100644 --- a/packages/react-router-node/CHANGELOG.md +++ b/packages/react-router-node/CHANGELOG.md @@ -57,7 +57,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -257,7 +256,6 @@ - Remove single fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522)) - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) - - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -266,7 +264,6 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: - - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` @@ -674,12 +671,10 @@ - Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920)) Informational Resources: - - - Documentation Resources (better docs specific to Remix are in the works): - - - - diff --git a/packages/react-router-serve/CHANGELOG.md b/packages/react-router-serve/CHANGELOG.md index 6da7028144..d615046e77 100644 --- a/packages/react-router-serve/CHANGELOG.md +++ b/packages/react-router-serve/CHANGELOG.md @@ -681,12 +681,10 @@ - Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920)) Informational Resources: - - - Documentation Resources (better docs specific to Remix are in the works): - - - - From 67ad60eaf0489c0f91f61f895e23b506ddb672fe Mon Sep 17 00:00:00 2001 From: Jacob Ebey Date: Tue, 2 Dec 2025 12:08:09 -0800 Subject: [PATCH 05/51] feat(rsc): routeRSCServerRequest replace fetchServer with serverResponse (#14597) --- .changeset/plenty-kiwis-matter.md | 6 +++++ docs/api/rsc/RSCStaticRouter.md | 15 ++++++----- docs/api/rsc/routeRSCServerRequest.md | 26 +++++++++---------- docs/how-to/react-server-components.md | 16 ++++++------ .../helpers/rsc-parcel/src/prerender.tsx | 4 +-- integration/helpers/rsc-parcel/src/server.tsx | 4 +-- .../helpers/rsc-vite/src/entry.rsc.tsx | 2 +- .../helpers/rsc-vite/src/entry.ssr.tsx | 4 +-- .../config/default-rsc-entries/entry.rsc.tsx | 2 +- .../config/default-rsc-entries/entry.ssr.tsx | 4 +-- packages/react-router/lib/rsc/server.ssr.tsx | 14 ++++------ playground/rsc-parcel/src/entry.ssr.tsx | 2 +- playground/rsc-vite/src/entry.rsc.tsx | 2 +- playground/rsc-vite/src/entry.ssr.tsx | 4 +-- 14 files changed, 54 insertions(+), 51 deletions(-) create mode 100644 .changeset/plenty-kiwis-matter.md diff --git a/.changeset/plenty-kiwis-matter.md b/.changeset/plenty-kiwis-matter.md new file mode 100644 index 0000000000..66afd64413 --- /dev/null +++ b/.changeset/plenty-kiwis-matter.md @@ -0,0 +1,6 @@ +--- +"@react-router/dev": minor +"react-router": minor +--- + +routeRSCServerRequest replace fetchServer with serverResponse diff --git a/docs/api/rsc/RSCStaticRouter.md b/docs/api/rsc/RSCStaticRouter.md index 5f56c30cdc..db7b8dfbdb 100644 --- a/docs/api/rsc/RSCStaticRouter.md +++ b/docs/api/rsc/RSCStaticRouter.md @@ -6,7 +6,7 @@ unstable: true # unstable_RSCStaticRouter +## v7.11.0 + +Date: 2025-12-16 + +### What's Changed + +We've added `vite preview` support and stabilized the client-side `onError` API - please make the appropriate changes if you've adopted the `unstable_onError` API already in a prior release. + +#### `vite preview` Support + +We've added support for [`vite preview`](https://vite.dev/guide/cli#vite-preview) when using Framework mode to make it easy to preview your production build. + +#### Stabilized Client-side `onError` + +The existing ``/`` APIs have been stabilized as ``/``. Please see the [Error Reporting](https://reactrouter.com/7.11.0/how-to/error-reporting#client-errors) docs for more information. + +### Minor Changes + +- `react-router` - Stabilize ``/`` ([#14546](https://github.com/remix-run/react-router/pull/14546)) +- `@react-router/dev` - Add `vite preview` support ([#14507](https://github.com/remix-run/react-router/pull/14507)) + +### Patch Changes + +- `react-router` - Fix `unstable_useTransitions` prop on `` component to permit omission for backwards compatibility ([#14646](https://github.com/remix-run/react-router/pull/14646)) +- `react-router` - Allow redirects to be returned from client side middleware ([#14598](https://github.com/remix-run/react-router/pull/14598)) +- `react-router` - Handle `dataStrategy` implementations that return insufficient result sets by adding errors for routes without any available result ([#14627](https://github.com/remix-run/react-router/pull/14627)) +- `@react-router/serve` - Update `compression` and `morgan` dependencies to address `on-headers` CVE: [GHSA-76c9-3jph-rj3q](https://github.com/advisories/GHSA-76c9-3jph-rj3q) ([#14652](https://github.com/remix-run/react-router/pull/14652)) + +### Unstable Changes + +⚠️ _[Unstable features](https://reactrouter.com/community/api-development-strategy#unstable-flags) are not recommended for production use_ + +- `react-router` - RSC: Support for throwing `data()` and Response from server component render phase ([#14632](https://github.com/remix-run/react-router/pull/14632)) + - Response body is not serialized as async work is not allowed as error encoding phase. + - If you wish to transmit data to the boundary, throw `data()` instead +- `react-router` - RSC: Support for throwing `redirect` Response's at render time ([#14596](https://github.com/remix-run/react-router/pull/14596)) +- `react-router` - RSC: `routeRSCServerRequest` replace `fetchServer` with `serverResponse` ([#14597](https://github.com/remix-run/react-router/pull/14597)) +- `@react-router/dev` - RSC (Framework mode): Manual chunking for `react` and `react-router` deps ([#14655](https://github.com/remix-run/react-router/pull/14655)) +- `@react-router/dev` - RSC (Framework mode): Optimize `react-server-dom-webpack` if in project `package.json` ([#14656](https://github.com/remix-run/react-router/pull/14656)) +- `@react-router/{dev,serve}` - RSC (Framework mode): Support custom entrypoints ([#14643](https://github.com/remix-run/react-router/pull/14643)) +- `react-router` - Add a new `unstable_defaultShouldRevalidate` flag to various APIs to allow opt-ing out of standard revalidation behaviors ([#14542](https://github.com/remix-run/react-router/pull/14542)) + - If active routes include a `shouldRevalidate` function, then your value will be passed as `defaultShouldRevalidate` in those function so that the route always has the final revalidation determination + - `
` + - `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` + - `` + - `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` + - This is also available on non-submission APIs that may trigger revalidations due to changing search params + - `` + - `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })` + - `setSearchParams(params, { unstable_defaultShouldRevalidate: false })` + +**Full Changelog**: [`v7.10.1...v7.11.0`](https://github.com/remix-run/react-router/compare/react-router@7.10.1...react-router@7.11.0) + ## v7.10.1 Date: 2025-12-04 diff --git a/docs/how-to/error-reporting.md b/docs/how-to/error-reporting.md index 424bd6db41..72539d60da 100644 --- a/docs/how-to/error-reporting.md +++ b/docs/how-to/error-reporting.md @@ -46,6 +46,10 @@ export const handleError: HandleErrorFunction = ( }; ``` +See also: + +- [`handleError`][handleError] + ## Client Errors To access these caught errors on the client, use the `onError` prop on your [`HydratedRouter`][hydratedrouter] or [`RouterProvider`][routerprovider] component. @@ -89,6 +93,10 @@ startTransition(() => { }); ``` +See also: + +- [``][hydratedrouter-onerror] + ### Data Mode [modes: data] @@ -113,7 +121,14 @@ function App() { } ``` +See also: + +- [``][routerprovider-onerror] + [entryserver]: ../api/framework-conventions/entry.server.tsx +[handleError]: ../api/framework-conventions/entry.server.tsx#handleerror [entryclient]: ../api/framework-conventions/entry.client.tsx -[hydratedrouter]: ../api//framework-routers/HydratedRouter +[hydratedrouter]: ../api/framework-routers/HydratedRouter [routerprovider]: ../api/data-routers/RouterProvider +[hydratedrouter-onerror]: ../api/framework-routers/HydratedRouter#onError +[routerprovider-onerror]: ../api/data-routers/RouterProvider#onError From 03c8afd5562a32cf5c7f5eb06c2dd5f56e9c1322 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Wed, 17 Dec 2025 11:03:53 -0500 Subject: [PATCH 48/51] Update release notes --- CHANGELOG.md | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5521be552b..cfb493de5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ We manage release notes in this file instead of the paginated Github Releases Pa - [What's Changed](#whats-changed) - [`vite preview` Support](#vite-preview-support) - [Stabilized Client-side `onError`](#stabilized-client-side-onerror) + - [Call-site Revalidation Opt-out (unstable)](#call-site-revalidation-opt-out-unstable) - [Minor Changes](#minor-changes) - [Patch Changes](#patch-changes) - [Unstable Changes](#unstable-changes) @@ -402,7 +403,7 @@ Date: YYYY-MM-DD ## v7.11.0 -Date: 2025-12-16 +Date: 2025-12-17 ### What's Changed @@ -416,6 +417,25 @@ We've added support for [`vite preview`](https://vite.dev/guide/cli#vite-preview The existing ``/`` APIs have been stabilized as ``/``. Please see the [Error Reporting](https://reactrouter.com/7.11.0/how-to/error-reporting#client-errors) docs for more information. +#### Call-site Revalidation Opt-out (unstable) + +We've added initial unstable support for call-site revalidation opt-out via a new `unstable_defaultShouldRevalidate` flag ([RFC](https://github.com/remix-run/react-router/discussions/10006)). This flag is available on all navigation/fetcher submission APIs to alter standard revalidation behavior. If any routes include a `shouldRevalidate` function, then the flag value will be passed to that function so the route has the final say on revalidation behavior. + +```tsx + +submit(data, { method: "post", unstable_defaultShouldRevalidate: false }) + +fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false }) +``` + +This flag is also available on non-submission navigational use cases - for example, you may want to opt-out of revalidation when adding a search param that doesn't impact the UI: + +```tsx +; +navigate("?analytics-param=1", { unstable_defaultShouldRevalidate: false }); +setSearchParams(params, { unstable_defaultShouldRevalidate: false }); +``` + ### Minor Changes - `react-router` - Stabilize ``/`` ([#14546](https://github.com/remix-run/react-router/pull/14546)) @@ -441,15 +461,6 @@ The existing ``/`` - - `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` - - `` - - `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` - - This is also available on non-submission APIs that may trigger revalidations due to changing search params - - `` - - `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })` - - `setSearchParams(params, { unstable_defaultShouldRevalidate: false })` **Full Changelog**: [`v7.10.1...v7.11.0`](https://github.com/remix-run/react-router/compare/react-router@7.10.1...react-router@7.11.0) From 72fd896e37bbe51e030a18dbc1dc64ed00bd7f5d Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Wed, 17 Dec 2025 11:04:06 -0500 Subject: [PATCH 49/51] Exit prerelease mode --- .changeset/pre.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 2aefa8d9f2..600bcfe550 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,5 +1,5 @@ { - "mode": "pre", + "mode": "exit", "tag": "pre", "initialVersions": { "integration": "0.0.0", From b34a9cd1f74231ded97c1e6ca9dff8f09a1b87ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 11:12:24 -0500 Subject: [PATCH 50/51] chore: Update version for release (#14668) * chore: Update version for release * Update release notes --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Matt Brophy --- .changeset/clean-avocados-mix.md | 5 -- .changeset/early-doors-obey.md | 6 --- .changeset/empty-rabbits-live.md | 5 -- .changeset/flat-singers-help.md | 6 --- .changeset/four-sloths-notice.md | 5 -- .changeset/orange-kings-exist.md | 5 -- .changeset/plenty-kiwis-matter.md | 6 --- .changeset/pre.json | 52 ------------------- .changeset/rich-melons-grow.md | 5 -- .changeset/rich-points-talk.md | 18 ------- .changeset/small-flowers-drive.md | 5 -- .changeset/strong-penguins-retire.md | 5 -- .changeset/stupid-forks-admire.md | 5 -- .changeset/violet-needles-impress.md | 5 -- integration/CHANGELOG.md | 1 + packages/create-react-router/CHANGELOG.md | 4 +- packages/create-react-router/package.json | 2 +- packages/react-router-architect/CHANGELOG.md | 9 ++-- packages/react-router-architect/package.json | 2 +- packages/react-router-cloudflare/CHANGELOG.md | 7 ++- packages/react-router-cloudflare/package.json | 2 +- packages/react-router-dev/CHANGELOG.md | 16 ++++-- packages/react-router-dev/package.json | 2 +- packages/react-router-dom/CHANGELOG.md | 4 +- packages/react-router-dom/package.json | 2 +- packages/react-router-express/CHANGELOG.md | 7 +-- packages/react-router-express/package.json | 2 +- packages/react-router-fs-routes/CHANGELOG.md | 4 +- packages/react-router-fs-routes/package.json | 2 +- packages/react-router-node/CHANGELOG.md | 9 +++- packages/react-router-node/package.json | 2 +- .../CHANGELOG.md | 4 +- .../package.json | 2 +- packages/react-router-serve/CHANGELOG.md | 10 ++-- packages/react-router-serve/package.json | 2 +- packages/react-router/CHANGELOG.md | 23 ++++++-- packages/react-router/package.json | 2 +- 37 files changed, 81 insertions(+), 172 deletions(-) delete mode 100644 .changeset/clean-avocados-mix.md delete mode 100644 .changeset/early-doors-obey.md delete mode 100644 .changeset/empty-rabbits-live.md delete mode 100644 .changeset/flat-singers-help.md delete mode 100644 .changeset/four-sloths-notice.md delete mode 100644 .changeset/orange-kings-exist.md delete mode 100644 .changeset/plenty-kiwis-matter.md delete mode 100644 .changeset/pre.json delete mode 100644 .changeset/rich-melons-grow.md delete mode 100644 .changeset/rich-points-talk.md delete mode 100644 .changeset/small-flowers-drive.md delete mode 100644 .changeset/strong-penguins-retire.md delete mode 100644 .changeset/stupid-forks-admire.md delete mode 100644 .changeset/violet-needles-impress.md diff --git a/.changeset/clean-avocados-mix.md b/.changeset/clean-avocados-mix.md deleted file mode 100644 index 919001b3fa..0000000000 --- a/.changeset/clean-avocados-mix.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@react-router/dev": patch ---- - -rsc framework mode manual chunking for react and react-router deps diff --git a/.changeset/early-doors-obey.md b/.changeset/early-doors-obey.md deleted file mode 100644 index 2c3410f1ee..0000000000 --- a/.changeset/early-doors-obey.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@react-router/dev": patch -"react-router": patch ---- - -add support for throwing redirect Response's at RSC render time diff --git a/.changeset/empty-rabbits-live.md b/.changeset/empty-rabbits-live.md deleted file mode 100644 index 405e005aba..0000000000 --- a/.changeset/empty-rabbits-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -Support for throwing `data()` and Response from server component render phase. Response body is not serialized as async work is not allowed as error encoding phase. If you wish to transmit data to the boundary, throw `data()` instead. diff --git a/.changeset/flat-singers-help.md b/.changeset/flat-singers-help.md deleted file mode 100644 index 9fa9160fc3..0000000000 --- a/.changeset/flat-singers-help.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@react-router/serve": patch -"@react-router/dev": patch ---- - -support custom entrypoints for RSC framework mode diff --git a/.changeset/four-sloths-notice.md b/.changeset/four-sloths-notice.md deleted file mode 100644 index 155b4ce9bf..0000000000 --- a/.changeset/four-sloths-notice.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -Fix `unstable_useTransitions` prop on `` component to permit omission for backewards compatibility diff --git a/.changeset/orange-kings-exist.md b/.changeset/orange-kings-exist.md deleted file mode 100644 index af571e26fe..0000000000 --- a/.changeset/orange-kings-exist.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@react-router/serve": patch ---- - -Update `compression` and `morgan` dependencies to address `on-headers` CVE: [GHSA-76c9-3jph-rj3q](https://github.com/advisories/GHSA-76c9-3jph-rj3q) diff --git a/.changeset/plenty-kiwis-matter.md b/.changeset/plenty-kiwis-matter.md deleted file mode 100644 index ac0cc17a33..0000000000 --- a/.changeset/plenty-kiwis-matter.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@react-router/dev": patch -"react-router": patch ---- - -`routeRSCServerRequest` replace `fetchServer` with `serverResponse` diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index 600bcfe550..0000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "mode": "exit", - "tag": "pre", - "initialVersions": { - "integration": "0.0.0", - "integration-cloudflare-dev-proxy-template": "0.0.0", - "integration-rsc-vite": "0.0.0", - "integration-rsc-vite-framework": "0.0.0", - "integration-vite-5-template": "0.0.0", - "integration-vite-6-template": "0.0.0", - "integration-vite-7-beta-template": "0.0.0", - "integration-vite-plugin-cloudflare-template": "0.0.0", - "integration-vite-rolldown-template": "0.0.0", - "create-react-router": "7.10.1", - "react-router": "7.10.1", - "@react-router/architect": "7.10.1", - "@react-router/cloudflare": "7.10.1", - "@react-router/dev": "7.10.1", - "react-router-dom": "7.10.1", - "@react-router/express": "7.10.1", - "@react-router/fs-routes": "7.10.1", - "@react-router/node": "7.10.1", - "@react-router/remix-routes-option-adapter": "7.10.1", - "@react-router/serve": "7.10.1", - "@playground/framework": "0.0.0", - "@playground/framework-express": "0.0.0", - "@playground/framework-rolldown-vite": "0.0.0", - "@playground/framework-spa": "0.0.0", - "@playground/framework-vite-5": "0.0.0", - "@playground/framework-vite-7-beta": "0.0.0", - "@playground/rsc-vite": "0.0.0", - "@playground/rsc-vite-framework": "0.0.0", - "@playground/split-route-modules": "0.0.0", - "@playground/split-route-modules-spa": "0.0.0", - "@playground/vite-plugin-cloudflare": "0.0.0" - }, - "changesets": [ - "clean-avocados-mix", - "early-doors-obey", - "empty-rabbits-live", - "flat-singers-help", - "four-sloths-notice", - "orange-kings-exist", - "plenty-kiwis-matter", - "rich-melons-grow", - "rich-points-talk", - "small-flowers-drive", - "strong-penguins-retire", - "stupid-forks-admire", - "violet-needles-impress" - ] -} diff --git a/.changeset/rich-melons-grow.md b/.changeset/rich-melons-grow.md deleted file mode 100644 index 07ac297701..0000000000 --- a/.changeset/rich-melons-grow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@react-router/dev": patch ---- - -rsc framewlrk mode - optimize react-server-dom-webpack if in project package.json diff --git a/.changeset/rich-points-talk.md b/.changeset/rich-points-talk.md deleted file mode 100644 index 3693c2bbe9..0000000000 --- a/.changeset/rich-points-talk.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -"react-router": patch ---- - -[UNSTABLE] Add a new `unstable_defaultShouldRevalidate` flag to various APIs to allow opt-ing out of standard revalidation behaviors. - -If active routes include a `shouldRevalidate` function, then your value will be passed as `defaultShouldRevalidate` in those function so that the route always has the final revalidation determination. - -- `` -- `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` -- `` -- `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` - -This is also available on non-submission APIs that may trigger revalidations due to changing search params: - -- `` -- `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })` -- `setSearchParams(params, { unstable_defaultShouldRevalidate: false })` diff --git a/.changeset/small-flowers-drive.md b/.changeset/small-flowers-drive.md deleted file mode 100644 index 558916e84c..0000000000 --- a/.changeset/small-flowers-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": minor ---- - -Stabilize ``/`` diff --git a/.changeset/strong-penguins-retire.md b/.changeset/strong-penguins-retire.md deleted file mode 100644 index 020d8f7472..0000000000 --- a/.changeset/strong-penguins-retire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -Allow redirects to be returned from client side middleware diff --git a/.changeset/stupid-forks-admire.md b/.changeset/stupid-forks-admire.md deleted file mode 100644 index e3726eabca..0000000000 --- a/.changeset/stupid-forks-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@react-router/dev": minor ---- - -feat: add `vite preview` support diff --git a/.changeset/violet-needles-impress.md b/.changeset/violet-needles-impress.md deleted file mode 100644 index 03ff10126e..0000000000 --- a/.changeset/violet-needles-impress.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react-router": patch ---- - -Handle `dataStrategy` implementations that return insufficient result sets by adding errors for routes without any available result diff --git a/integration/CHANGELOG.md b/integration/CHANGELOG.md index 2cf67d87b7..6fccf850d7 100644 --- a/integration/CHANGELOG.md +++ b/integration/CHANGELOG.md @@ -5,6 +5,7 @@ ### Minor Changes - Unstable Vite support for Node-based Remix apps ([#7590](https://github.com/remix-run/remix/pull/7590)) + - `remix build` 👉 `vite build && vite build --ssr` - `remix dev` 👉 `vite dev` diff --git a/packages/create-react-router/CHANGELOG.md b/packages/create-react-router/CHANGELOG.md index 7da49ff07a..0037a4ef7c 100644 --- a/packages/create-react-router/CHANGELOG.md +++ b/packages/create-react-router/CHANGELOG.md @@ -1,6 +1,8 @@ # `create-react-router` -## 7.11.0-pre.0 +## 7.11.0 + +_No changes_ ## 7.10.1 diff --git a/packages/create-react-router/package.json b/packages/create-react-router/package.json index b50c8e131a..287ec6d9c4 100644 --- a/packages/create-react-router/package.json +++ b/packages/create-react-router/package.json @@ -1,6 +1,6 @@ { "name": "create-react-router", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Create a new React Router app", "homepage": "https://reactrouter.com", "bugs": { diff --git a/packages/react-router-architect/CHANGELOG.md b/packages/react-router-architect/CHANGELOG.md index fb8efc1b43..e4422e60a8 100644 --- a/packages/react-router-architect/CHANGELOG.md +++ b/packages/react-router-architect/CHANGELOG.md @@ -1,12 +1,12 @@ # `@react-router/architect` -## 7.11.0-pre.0 +## 7.11.0 ### Patch Changes - Updated dependencies: - - `react-router@7.11.0-pre.0` - - `@react-router/node@7.11.0-pre.0` + - `react-router@7.11.0` + - `@react-router/node@7.11.0` ## 7.10.1 @@ -79,6 +79,7 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: + - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -302,6 +303,7 @@ ### Major Changes - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) + - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -310,6 +312,7 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: + - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` diff --git a/packages/react-router-architect/package.json b/packages/react-router-architect/package.json index fe81d8bc80..fc0d12d18a 100644 --- a/packages/react-router-architect/package.json +++ b/packages/react-router-architect/package.json @@ -1,6 +1,6 @@ { "name": "@react-router/architect", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Architect server request handler for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-cloudflare/CHANGELOG.md b/packages/react-router-cloudflare/CHANGELOG.md index 615507ac62..9161c9a8bd 100644 --- a/packages/react-router-cloudflare/CHANGELOG.md +++ b/packages/react-router-cloudflare/CHANGELOG.md @@ -1,11 +1,11 @@ # `@react-router/cloudflare` -## 7.11.0-pre.0 +## 7.11.0 ### Patch Changes - Updated dependencies: - - `react-router@7.11.0-pre.0` + - `react-router@7.11.0` ## 7.10.1 @@ -70,6 +70,7 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: + - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -268,6 +269,7 @@ - For Remix consumers migrating to React Router, all exports from `@remix-run/cloudflare-pages` are now provided for React Router consumers in the `@react-router/cloudflare` package. There is no longer a separate package for Cloudflare Pages. ([#11801](https://github.com/remix-run/react-router/pull/11801)) - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) + - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -276,6 +278,7 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: + - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` diff --git a/packages/react-router-cloudflare/package.json b/packages/react-router-cloudflare/package.json index d248e2bc61..fab63c9307 100644 --- a/packages/react-router-cloudflare/package.json +++ b/packages/react-router-cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "@react-router/cloudflare", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Cloudflare platform abstractions for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-dev/CHANGELOG.md b/packages/react-router-dev/CHANGELOG.md index 3f74519f72..74e12ade55 100644 --- a/packages/react-router-dev/CHANGELOG.md +++ b/packages/react-router-dev/CHANGELOG.md @@ -1,6 +1,6 @@ # `@react-router/dev` -## 7.11.0-pre.0 +## 7.11.0 ### Minor Changes @@ -14,9 +14,9 @@ - `routeRSCServerRequest` replace `fetchServer` with `serverResponse` ([#14597](https://github.com/remix-run/react-router/pull/14597)) - rsc framewlrk mode - optimize react-server-dom-webpack if in project package.json ([#14656](https://github.com/remix-run/react-router/pull/14656)) - Updated dependencies: - - `react-router@7.11.0-pre.0` - - `@react-router/serve@7.11.0-pre.0` - - `@react-router/node@7.11.0-pre.0` + - `react-router@7.11.0` + - `@react-router/serve@7.11.0` + - `@react-router/node@7.11.0` ## 7.10.1 @@ -247,6 +247,7 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: + - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -989,6 +990,7 @@ ``` This initial implementation targets type inference for: + - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module - `ActionData` : Action data from `action` and/or `clientAction` within your route module @@ -1003,6 +1005,7 @@ ``` Check out our docs for more: + - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety) - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety) @@ -1202,6 +1205,7 @@ - Vite: Provide `Unstable_ServerBundlesFunction` and `Unstable_VitePluginConfig` types ([#8654](https://github.com/remix-run/remix/pull/8654)) - Vite: add `--sourcemapClient` and `--sourcemapServer` flags to `remix vite:build` ([#8613](https://github.com/remix-run/remix/pull/8613)) + - `--sourcemapClient` - `--sourcemapClient=inline` @@ -1538,6 +1542,7 @@ - Add support for `clientLoader`/`clientAction`/`HydrateFallback` route exports ([RFC](https://github.com/remix-run/remix/discussions/7634)) ([#8173](https://github.com/remix-run/remix/pull/8173)) Remix now supports loaders/actions that run on the client (in addition to, or instead of the loader/action that runs on the server). While we still recommend server loaders/actions for the majority of your data needs in a Remix app - these provide some levers you can pull for more advanced use-cases such as: + - Leveraging a data source local to the browser (i.e., `localStorage`) - Managing a client-side cache of server data (like `IndexedDB`) - Bypassing the Remix server in a BFF setup and hitting your API directly from the browser @@ -1941,6 +1946,7 @@ - Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772)) Written to server build directory (`build/` by default): + - `metafile.css.json` - `metafile.js.json` (browser JS) - `metafile.server.json` (server JS) @@ -2038,6 +2044,7 @@ - built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483)) New options: + - `--tls-key` / `tlsKey`: TLS key - `--tls-cert` / `tlsCert`: TLS Certificate @@ -2308,6 +2315,7 @@ ``` The dev server will: + - force `NODE_ENV=development` and warn you if it was previously set to something else - rebuild your app whenever your Remix app code changes - restart your app server whenever rebuilds succeed diff --git a/packages/react-router-dev/package.json b/packages/react-router-dev/package.json index 99e5ec349e..de524fe450 100644 --- a/packages/react-router-dev/package.json +++ b/packages/react-router-dev/package.json @@ -1,6 +1,6 @@ { "name": "@react-router/dev", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Dev tools and CLI for React Router", "homepage": "https://reactrouter.com", "bugs": { diff --git a/packages/react-router-dom/CHANGELOG.md b/packages/react-router-dom/CHANGELOG.md index 8336ab1e1a..28cb85d501 100644 --- a/packages/react-router-dom/CHANGELOG.md +++ b/packages/react-router-dom/CHANGELOG.md @@ -1,11 +1,11 @@ # react-router-dom -## 7.11.0-pre.0 +## 7.11.0 ### Patch Changes - Updated dependencies: - - `react-router@7.11.0-pre.0` + - `react-router@7.11.0` ## 7.10.1 diff --git a/packages/react-router-dom/package.json b/packages/react-router-dom/package.json index 8e58cdcb30..665afc85f3 100644 --- a/packages/react-router-dom/package.json +++ b/packages/react-router-dom/package.json @@ -1,6 +1,6 @@ { "name": "react-router-dom", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Declarative routing for React web applications", "keywords": [ "react", diff --git a/packages/react-router-express/CHANGELOG.md b/packages/react-router-express/CHANGELOG.md index e696700fab..c96b99848d 100644 --- a/packages/react-router-express/CHANGELOG.md +++ b/packages/react-router-express/CHANGELOG.md @@ -1,12 +1,12 @@ # `@react-router/express` -## 7.11.0-pre.0 +## 7.11.0 ### Patch Changes - Updated dependencies: - - `react-router@7.11.0-pre.0` - - `@react-router/node@7.11.0-pre.0` + - `react-router@7.11.0` + - `@react-router/node@7.11.0` ## 7.10.1 @@ -79,6 +79,7 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: + - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option diff --git a/packages/react-router-express/package.json b/packages/react-router-express/package.json index 83efbff6b3..bd814bbd18 100644 --- a/packages/react-router-express/package.json +++ b/packages/react-router-express/package.json @@ -1,6 +1,6 @@ { "name": "@react-router/express", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Express server request handler for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-fs-routes/CHANGELOG.md b/packages/react-router-fs-routes/CHANGELOG.md index c1f97b35f7..79aa56218a 100644 --- a/packages/react-router-fs-routes/CHANGELOG.md +++ b/packages/react-router-fs-routes/CHANGELOG.md @@ -1,11 +1,11 @@ # `@react-router/fs-routes` -## 7.11.0-pre.0 +## 7.11.0 ### Patch Changes - Updated dependencies: - - `@react-router/dev@7.11.0-pre.0` + - `@react-router/dev@7.11.0` ## 7.10.1 diff --git a/packages/react-router-fs-routes/package.json b/packages/react-router-fs-routes/package.json index bd96602f62..06199badb9 100644 --- a/packages/react-router-fs-routes/package.json +++ b/packages/react-router-fs-routes/package.json @@ -1,6 +1,6 @@ { "name": "@react-router/fs-routes", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "File system routing conventions for React Router, for use within routes.ts", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-node/CHANGELOG.md b/packages/react-router-node/CHANGELOG.md index 2bc8071ed4..7e6787273e 100644 --- a/packages/react-router-node/CHANGELOG.md +++ b/packages/react-router-node/CHANGELOG.md @@ -1,11 +1,11 @@ # `@react-router/node` -## 7.11.0-pre.0 +## 7.11.0 ### Patch Changes - Updated dependencies: - - `react-router@7.11.0-pre.0` + - `react-router@7.11.0` ## 7.10.1 @@ -71,6 +71,7 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: + - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -270,6 +271,7 @@ - Remove single fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522)) - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) + - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -278,6 +280,7 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: + - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` @@ -685,10 +688,12 @@ - Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920)) Informational Resources: + - - Documentation Resources (better docs specific to Remix are in the works): + - - - diff --git a/packages/react-router-node/package.json b/packages/react-router-node/package.json index 6fd7c02b57..896575b42a 100644 --- a/packages/react-router-node/package.json +++ b/packages/react-router-node/package.json @@ -1,6 +1,6 @@ { "name": "@react-router/node", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Node.js platform abstractions for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-remix-routes-option-adapter/CHANGELOG.md b/packages/react-router-remix-routes-option-adapter/CHANGELOG.md index 9bd1bfb6a3..f1d5bc3644 100644 --- a/packages/react-router-remix-routes-option-adapter/CHANGELOG.md +++ b/packages/react-router-remix-routes-option-adapter/CHANGELOG.md @@ -1,11 +1,11 @@ # `@react-router/remix-config-routes-adapter` -## 7.11.0-pre.0 +## 7.11.0 ### Patch Changes - Updated dependencies: - - `@react-router/dev@7.11.0-pre.0` + - `@react-router/dev@7.11.0` ## 7.10.1 diff --git a/packages/react-router-remix-routes-option-adapter/package.json b/packages/react-router-remix-routes-option-adapter/package.json index 7385537726..564b8afc17 100644 --- a/packages/react-router-remix-routes-option-adapter/package.json +++ b/packages/react-router-remix-routes-option-adapter/package.json @@ -1,6 +1,6 @@ { "name": "@react-router/remix-routes-option-adapter", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Adapter for Remix's \"routes\" config option, for use within routes.ts", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router-serve/CHANGELOG.md b/packages/react-router-serve/CHANGELOG.md index 0878c349b9..6c4a75003f 100644 --- a/packages/react-router-serve/CHANGELOG.md +++ b/packages/react-router-serve/CHANGELOG.md @@ -1,15 +1,15 @@ # `@react-router/serve` -## 7.11.0-pre.0 +## 7.11.0 ### Patch Changes - support custom entrypoints for RSC framework mode ([#14643](https://github.com/remix-run/react-router/pull/14643)) - Update `compression` and `morgan` dependencies to address `on-headers` CVE: [GHSA-76c9-3jph-rj3q](https://github.com/advisories/GHSA-76c9-3jph-rj3q) ([#14652](https://github.com/remix-run/react-router/pull/14652)) - Updated dependencies: - - `react-router@7.11.0-pre.0` - - `@react-router/node@7.11.0-pre.0` - - `@react-router/express@7.11.0-pre.0` + - `react-router@7.11.0` + - `@react-router/node@7.11.0` + - `@react-router/express@7.11.0` ## 7.10.1 @@ -701,10 +701,12 @@ - Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920)) Informational Resources: + - - Documentation Resources (better docs specific to Remix are in the works): + - - - diff --git a/packages/react-router-serve/package.json b/packages/react-router-serve/package.json index d89d7bbe93..7900da4cd4 100644 --- a/packages/react-router-serve/package.json +++ b/packages/react-router-serve/package.json @@ -1,6 +1,6 @@ { "name": "@react-router/serve", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Production application server for React Router", "bugs": { "url": "https://github.com/remix-run/react-router/issues" diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 9291a157a2..2838f0b346 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -1,6 +1,6 @@ # `react-router` -## 7.11.0-pre.0 +## 7.11.0 ### Minor Changes @@ -9,23 +9,30 @@ ### Patch Changes - add support for throwing redirect Response's at RSC render time ([#14596](https://github.com/remix-run/react-router/pull/14596)) + - Support for throwing `data()` and Response from server component render phase. Response body is not serialized as async work is not allowed as error encoding phase. If you wish to transmit data to the boundary, throw `data()` instead. ([#14632](https://github.com/remix-run/react-router/pull/14632)) + - Fix `unstable_useTransitions` prop on `` component to permit omission for backewards compatibility ([#14646](https://github.com/remix-run/react-router/pull/14646)) + - `routeRSCServerRequest` replace `fetchServer` with `serverResponse` ([#14597](https://github.com/remix-run/react-router/pull/14597)) -- [UNSTABLE] Add a new `unstable_defaultShouldRevalidate` flag to various APIs to allow opt-ing out of standard revalidation behaviors. ([#14542](https://github.com/remix-run/react-router/pull/14542)) + +- \[UNSTABLE] Add a new `unstable_defaultShouldRevalidate` flag to various APIs to allow opt-ing out of standard revalidation behaviors. ([#14542](https://github.com/remix-run/react-router/pull/14542)) If active routes include a `shouldRevalidate` function, then your value will be passed as `defaultShouldRevalidate` in those function so that the route always has the final revalidation determination. + - `` - `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` - `` - `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` This is also available on non-submission APIs that may trigger revalidations due to changing search params: + - `` - `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })` - `setSearchParams(params, { unstable_defaultShouldRevalidate: false })` - Allow redirects to be returned from client side middleware ([#14598](https://github.com/remix-run/react-router/pull/14598)) + - Handle `dataStrategy` implementations that return insufficient result sets by adding errors for routes without any available result ([#14627](https://github.com/remix-run/react-router/pull/14627)) ## 7.10.1 @@ -42,6 +49,7 @@ - ⚠️ 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: @@ -170,6 +178,7 @@ - Ensure action handlers run for routes with middleware even if no loader is present ([#14443](https://github.com/remix-run/react-router/pull/14443)) - Add `unstable_instrumentations` API to allow users to add observablity to their apps by instrumenting route loaders, actions, middlewares, lazy, as well as server-side request handlers and client side navigations/fetches ([#14412](https://github.com/remix-run/react-router/pull/14412)) + - Framework Mode: - `entry.server.tsx`: `export const unstable_instrumentations = [...]` - `entry.client.tsx`: `` @@ -331,6 +340,7 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: + - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -357,7 +367,7 @@ - \[UNSTABLE] Add ``/`` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162)) -- server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154)) +- server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154)) - Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530)) @@ -406,6 +416,7 @@ - Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059)) - Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206)) + - When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary - The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered - ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios. @@ -439,6 +450,7 @@ - \[UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#14097](https://github.com/remix-run/react-router/pull/14097)) - \[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#14103](https://github.com/remix-run/react-router/pull/14103)) + - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity - The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling - The `query` version of the API now has a signature of `(query: (r: Request) => Promise) => Promise` @@ -1084,6 +1096,7 @@ ``` Similar to server-side requests, a fresh `context` will be created per navigation (or `fetcher` call). If you have initial data you'd like to populate in the context for every request, you can provide an `unstable_getContext` function at the root of your app: + - Library mode - `createBrowserRouter(routes, { unstable_getContext })` - Framework mode - `` @@ -1271,6 +1284,7 @@ _No changes_ - Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697)) - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) + - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -1279,6 +1293,7 @@ _No changes_ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: + - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` @@ -1434,6 +1449,7 @@ _No changes_ ``` This initial implementation targets type inference for: + - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module - `ActionData` : Action data from `action` and/or `clientAction` within your route module @@ -1448,6 +1464,7 @@ _No changes_ ``` Check out our docs for more: + - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety) - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety) diff --git a/packages/react-router/package.json b/packages/react-router/package.json index b6fd23010c..672d61c465 100644 --- a/packages/react-router/package.json +++ b/packages/react-router/package.json @@ -1,6 +1,6 @@ { "name": "react-router", - "version": "7.11.0-pre.0", + "version": "7.11.0", "description": "Declarative routing for React", "keywords": [ "react", From cbaf077e5239a64913130098dc2830ab92e6b45a Mon Sep 17 00:00:00 2001 From: Remix Run Bot Date: Wed, 17 Dec 2025 16:13:16 +0000 Subject: [PATCH 51/51] chore: format --- integration/CHANGELOG.md | 1 - packages/react-router-architect/CHANGELOG.md | 3 --- packages/react-router-cloudflare/CHANGELOG.md | 3 --- packages/react-router-dev/CHANGELOG.md | 8 -------- packages/react-router-express/CHANGELOG.md | 1 - packages/react-router-node/CHANGELOG.md | 5 ----- packages/react-router-serve/CHANGELOG.md | 2 -- packages/react-router/CHANGELOG.md | 14 +------------- 8 files changed, 1 insertion(+), 36 deletions(-) diff --git a/integration/CHANGELOG.md b/integration/CHANGELOG.md index 6fccf850d7..2cf67d87b7 100644 --- a/integration/CHANGELOG.md +++ b/integration/CHANGELOG.md @@ -5,7 +5,6 @@ ### Minor Changes - Unstable Vite support for Node-based Remix apps ([#7590](https://github.com/remix-run/remix/pull/7590)) - - `remix build` 👉 `vite build && vite build --ssr` - `remix dev` 👉 `vite dev` diff --git a/packages/react-router-architect/CHANGELOG.md b/packages/react-router-architect/CHANGELOG.md index e4422e60a8..0d7909cbe9 100644 --- a/packages/react-router-architect/CHANGELOG.md +++ b/packages/react-router-architect/CHANGELOG.md @@ -79,7 +79,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -303,7 +302,6 @@ ### Major Changes - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) - - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -312,7 +310,6 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: - - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` diff --git a/packages/react-router-cloudflare/CHANGELOG.md b/packages/react-router-cloudflare/CHANGELOG.md index 9161c9a8bd..4e3dab77ba 100644 --- a/packages/react-router-cloudflare/CHANGELOG.md +++ b/packages/react-router-cloudflare/CHANGELOG.md @@ -70,7 +70,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -269,7 +268,6 @@ - For Remix consumers migrating to React Router, all exports from `@remix-run/cloudflare-pages` are now provided for React Router consumers in the `@react-router/cloudflare` package. There is no longer a separate package for Cloudflare Pages. ([#11801](https://github.com/remix-run/react-router/pull/11801)) - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) - - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -278,7 +276,6 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: - - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` diff --git a/packages/react-router-dev/CHANGELOG.md b/packages/react-router-dev/CHANGELOG.md index 74e12ade55..b9f7dd23f5 100644 --- a/packages/react-router-dev/CHANGELOG.md +++ b/packages/react-router-dev/CHANGELOG.md @@ -247,7 +247,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -990,7 +989,6 @@ ``` This initial implementation targets type inference for: - - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module - `ActionData` : Action data from `action` and/or `clientAction` within your route module @@ -1005,7 +1003,6 @@ ``` Check out our docs for more: - - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety) - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety) @@ -1205,7 +1202,6 @@ - Vite: Provide `Unstable_ServerBundlesFunction` and `Unstable_VitePluginConfig` types ([#8654](https://github.com/remix-run/remix/pull/8654)) - Vite: add `--sourcemapClient` and `--sourcemapServer` flags to `remix vite:build` ([#8613](https://github.com/remix-run/remix/pull/8613)) - - `--sourcemapClient` - `--sourcemapClient=inline` @@ -1542,7 +1538,6 @@ - Add support for `clientLoader`/`clientAction`/`HydrateFallback` route exports ([RFC](https://github.com/remix-run/remix/discussions/7634)) ([#8173](https://github.com/remix-run/remix/pull/8173)) Remix now supports loaders/actions that run on the client (in addition to, or instead of the loader/action that runs on the server). While we still recommend server loaders/actions for the majority of your data needs in a Remix app - these provide some levers you can pull for more advanced use-cases such as: - - Leveraging a data source local to the browser (i.e., `localStorage`) - Managing a client-side cache of server data (like `IndexedDB`) - Bypassing the Remix server in a BFF setup and hitting your API directly from the browser @@ -1946,7 +1941,6 @@ - Output esbuild metafiles for bundle analysis ([#6772](https://github.com/remix-run/remix/pull/6772)) Written to server build directory (`build/` by default): - - `metafile.css.json` - `metafile.js.json` (browser JS) - `metafile.server.json` (server JS) @@ -2044,7 +2038,6 @@ - built-in tls support ([#6483](https://github.com/remix-run/remix/pull/6483)) New options: - - `--tls-key` / `tlsKey`: TLS key - `--tls-cert` / `tlsCert`: TLS Certificate @@ -2315,7 +2308,6 @@ ``` The dev server will: - - force `NODE_ENV=development` and warn you if it was previously set to something else - rebuild your app whenever your Remix app code changes - restart your app server whenever rebuilds succeed diff --git a/packages/react-router-express/CHANGELOG.md b/packages/react-router-express/CHANGELOG.md index c96b99848d..7d278c4dcb 100644 --- a/packages/react-router-express/CHANGELOG.md +++ b/packages/react-router-express/CHANGELOG.md @@ -79,7 +79,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option diff --git a/packages/react-router-node/CHANGELOG.md b/packages/react-router-node/CHANGELOG.md index 7e6787273e..a0015b86dc 100644 --- a/packages/react-router-node/CHANGELOG.md +++ b/packages/react-router-node/CHANGELOG.md @@ -71,7 +71,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -271,7 +270,6 @@ - Remove single fetch future flag. ([#11522](https://github.com/remix-run/react-router/pull/11522)) - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) - - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -280,7 +278,6 @@ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: - - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` @@ -688,12 +685,10 @@ - Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920)) Informational Resources: - - - Documentation Resources (better docs specific to Remix are in the works): - - - - diff --git a/packages/react-router-serve/CHANGELOG.md b/packages/react-router-serve/CHANGELOG.md index 6c4a75003f..20c0cbbb48 100644 --- a/packages/react-router-serve/CHANGELOG.md +++ b/packages/react-router-serve/CHANGELOG.md @@ -701,12 +701,10 @@ - Introduces the `defer()` API from `@remix-run/router` with support for server-rendering and HTTP streaming. This utility allows you to defer values returned from `loader` functions by returning promises instead of resolved values. This has been refered to as _"sending a promise over the wire"_. ([#4920](https://github.com/remix-run/remix/pull/4920)) Informational Resources: - - - Documentation Resources (better docs specific to Remix are in the works): - - - - diff --git a/packages/react-router/CHANGELOG.md b/packages/react-router/CHANGELOG.md index 2838f0b346..950b634a69 100644 --- a/packages/react-router/CHANGELOG.md +++ b/packages/react-router/CHANGELOG.md @@ -19,14 +19,12 @@ - \[UNSTABLE] Add a new `unstable_defaultShouldRevalidate` flag to various APIs to allow opt-ing out of standard revalidation behaviors. ([#14542](https://github.com/remix-run/react-router/pull/14542)) If active routes include a `shouldRevalidate` function, then your value will be passed as `defaultShouldRevalidate` in those function so that the route always has the final revalidation determination. - - `` - `submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` - `` - `fetcher.submit(data, { method: "post", unstable_defaultShouldRevalidate: false })` This is also available on non-submission APIs that may trigger revalidations due to changing search params: - - `` - `navigate("/?foo=bar", { unstable_defaultShouldRevalidate: false })` - `setSearchParams(params, { unstable_defaultShouldRevalidate: false })` @@ -49,7 +47,6 @@ - ⚠️ 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: @@ -178,7 +175,6 @@ - Ensure action handlers run for routes with middleware even if no loader is present ([#14443](https://github.com/remix-run/react-router/pull/14443)) - Add `unstable_instrumentations` API to allow users to add observablity to their apps by instrumenting route loaders, actions, middlewares, lazy, as well as server-side request handlers and client side navigations/fetches ([#14412](https://github.com/remix-run/react-router/pull/14412)) - - Framework Mode: - `entry.server.tsx`: `export const unstable_instrumentations = [...]` - `entry.client.tsx`: `` @@ -340,7 +336,6 @@ - Stabilize middleware and context APIs. ([#14215](https://github.com/remix-run/react-router/pull/14215)) We have removed the `unstable_` prefix from the following APIs and they are now considered stable and ready for production use: - - [`RouterContextProvider`](https://reactrouter.com/api/utils/RouterContextProvider) - [`createContext`](https://reactrouter.com/api/utils/createContext) - `createBrowserRouter` [`getContext`](https://reactrouter.com/api/data-routers/createBrowserRouter#optsgetcontext) option @@ -367,7 +362,7 @@ - \[UNSTABLE] Add ``/`` prop for client side error reporting ([#14162](https://github.com/remix-run/react-router/pull/14162)) -- server action revalidation opt out via $SKIP\_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154)) +- server action revalidation opt out via $SKIP_REVALIDATION field ([#14154](https://github.com/remix-run/react-router/pull/14154)) - Properly escape interpolated param values in `generatePath()` ([#13530](https://github.com/remix-run/react-router/pull/13530)) @@ -416,7 +411,6 @@ - Remove dependency on `@types/node` in TypeScript declaration files ([#14059](https://github.com/remix-run/react-router/pull/14059)) - Fix types for `UIMatch` to reflect that the `loaderData`/`data` properties may be `undefined` ([#12206](https://github.com/remix-run/react-router/pull/12206)) - - When an `ErrorBoundary` is being rendered, not all active matches will have loader data available, since it may have been their `loader` that threw to trigger the boundary - The `UIMatch.data` type was not correctly handing this and would always reflect the presence of data, leading to the unexpected runtime errors when an `ErrorBoundary` was rendered - ⚠️ This may cause some type errors to show up in your code for unguarded `match.data` accesses - you should properly guard for `undefined` values in those scenarios. @@ -450,7 +444,6 @@ - \[UNSTABLE] When middleware is enabled, make the `context` parameter read-only (via `Readonly`) so that TypeScript will not allow you to write arbitrary fields to it in loaders, actions, or middleware. ([#14097](https://github.com/remix-run/react-router/pull/14097)) - \[UNSTABLE] Rename and alter the signature/functionality of the `unstable_respond` API in `staticHandler.query`/`staticHandler.queryRoute` ([#14103](https://github.com/remix-run/react-router/pull/14103)) - - The API has been renamed to `unstable_generateMiddlewareResponse` for clarity - The main functional change is that instead of running the loaders/actions before calling `unstable_respond` and handing you the result, we now pass a `query`/`queryRoute` function as a parameter and you execute the loaders/actions inside your callback, giving you full access to pre-processing and error handling - The `query` version of the API now has a signature of `(query: (r: Request) => Promise) => Promise` @@ -1096,7 +1089,6 @@ ``` Similar to server-side requests, a fresh `context` will be created per navigation (or `fetcher` call). If you have initial data you'd like to populate in the context for every request, you can provide an `unstable_getContext` function at the root of your app: - - Library mode - `createBrowserRouter(routes, { unstable_getContext })` - Framework mode - `` @@ -1284,7 +1276,6 @@ _No changes_ - Remove `future.v7_normalizeFormMethod` future flag ([#11697](https://github.com/remix-run/react-router/pull/11697)) - For Remix consumers migrating to React Router, the `crypto` global from the [Web Crypto API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API) is now required when using cookie and session APIs. This means that the following APIs are provided from `react-router` rather than platform-specific packages: ([#11837](https://github.com/remix-run/react-router/pull/11837)) - - `createCookie` - `createCookieSessionStorage` - `createMemorySessionStorage` @@ -1293,7 +1284,6 @@ _No changes_ For consumers running older versions of Node, the `installGlobals` function from `@remix-run/node` has been updated to define `globalThis.crypto`, using [Node's `require('node:crypto').webcrypto` implementation.](https://nodejs.org/api/webcrypto.html) Since platform-specific packages no longer need to implement this API, the following low-level APIs have been removed: - - `createCookieFactory` - `createSessionStorageFactory` - `createCookieSessionStorageFactory` @@ -1449,7 +1439,6 @@ _No changes_ ``` This initial implementation targets type inference for: - - `Params` : Path parameters from your routing config in `routes.ts` including file-based routing - `LoaderData` : Loader data from `loader` and/or `clientLoader` within your route module - `ActionData` : Action data from `action` and/or `clientAction` within your route module @@ -1464,7 +1453,6 @@ _No changes_ ``` Check out our docs for more: - - [_Explanations > Type Safety_](https://reactrouter.com/dev/guides/explanation/type-safety) - [_How-To > Setting up type safety_](https://reactrouter.com/dev/guides/how-to/setting-up-type-safety)