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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/release-comments-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Release Comments (manual)

on:
workflow_dispatch:
inputs:
release:
required: true
description: Release version, e.g. 7.18.0

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -35,4 +39,4 @@ jobs:
- name: Comment on released issues and pull requests
env:
GH_TOKEN: ${{ github.token }}
run: pnpm run release-comments
run: pnpm run release-comments --release=${{ github.event.inputs.release }}
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ on:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
# Don't cancel in-progress runs - once a release flow has started we want it
# to run all the way through so subsequent commits (like formatting) don't
# interrupt publishing/commenting
cancel-in-progress: false

jobs:
check:
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ We manage release notes in this file instead of the paginated Github Releases Pa
<summary>Table of Contents</summary>

- [React Router Releases](#react-router-releases)
- [v8.0.1](#v801)
- [v8.0.0](#v800)
- [Baseline Support](#baseline-support)
- [Adopted Future Flag Behavior](#adopted-future-flag-behavior)
Expand Down Expand Up @@ -103,6 +104,16 @@ We manage release notes in this file instead of the paginated Github Releases Pa

</details>

## v8.0.1

Date: 2026-06-18

### Patch Changes

- `react-router` - Remove the obsolete `AppLoadContext` type export accidentally left over from v7 now that middleware is always enabled and server request context is provided through `RouterContextProvider`. ([#15207](https://github.com/remix-run/react-router/pull/15207))

**Full Changelog**: [`v8.0.0...v8.0.1`](https://github.com/remix-run/react-router/compare/react-router@8.0.0...react-router@8.0.1)

## v8.0.0

Date: 2026-06-17
Expand Down
26 changes: 13 additions & 13 deletions docs/api/other-api/adapter.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,16 +144,16 @@ export const handler = createRequestHandler({
Here's an example with Cloudflare:

```ts
import { createRequestHandler } from "react-router";

declare module "react-router" {
export interface AppLoadContext {
cloudflare: {
env: Env;
ctx: ExecutionContext;
};
}
}
import {
RouterContextProvider,
createContext,
createRequestHandler,
} from "react-router";

const cloudflareContext = createContext<{
env: Env;
ctx: ExecutionContext;
}>();

const requestHandler = createRequestHandler(
() => import("virtual:react-router/server-build"),
Expand All @@ -162,9 +162,9 @@ const requestHandler = createRequestHandler(

export default {
async fetch(request, env, ctx) {
return requestHandler(request, {
cloudflare: { env, ctx },
});
let routerContext = new RouterContextProvider();
routerContext.set(cloudflareContext, { env, ctx });
return requestHandler(request, routerContext);
},
} satisfies ExportedHandler<Env>;
```
Expand Down
2 changes: 1 addition & 1 deletion docs/how-to/middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Client middleware is simpler because since we are already on the client and are

### Context API

The new context system provides type safety and prevents naming conflicts and allows you to provide data to nested middlewares and `action`/`loader` functions. In Framework Mode, this replaces the previous `AppLoadContext` API.
The context system provides type safety, prevents naming conflicts, and allows you to provide data to nested middlewares and `action`/`loader` functions.

```ts
// ✅ Type-safe
Expand Down
17 changes: 1 addition & 16 deletions docs/how-to/route-module-type-safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,7 @@ If you want to run type checking as its own command — for example, as part of
}
```

## 4. Typing `AppLoadContext`

## Extending app `Context` types

To define your app's `context` type, add the following in a `.ts` or `.d.ts` file within your project:

```typescript
import "react-router";
declare module "react-router" {
interface AppLoadContext {
// add context properties here
}
}
```

## 5. Type-only auto-imports (optional)
## 4. Type-only auto-imports (optional)

When auto-importing the `Route` type helper, TypeScript will generate:

Expand Down
12 changes: 10 additions & 2 deletions eslint.config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { createRequire } from "node:module";
import { fixupPluginRules } from "@eslint/compat";
import { defineConfig } from "eslint/config";
import globals from "globals";

const require = createRequire(import.meta.url);
const eslintRequire = createRequire(require.resolve("eslint/package.json"));

const globals = eslintRequire("globals");
const reactAppConfig = require("eslint-config-react-app");

const flowtypePlugin = fixupPluginRules(require("eslint-plugin-flowtype"));
Expand All @@ -27,6 +26,9 @@ const reactAppTsOverride = reactAppConfig.overrides.find(
if (!reactAppTsOverride) {
throw new Error("Could not find the react-app TypeScript override.");
}
if (!jestPlugin.configs) {
throw new Error("Could not find the jest plugin configs.");
}

const jestRecommended = jestPlugin.configs["flat/recommended"];

Expand Down Expand Up @@ -119,6 +121,12 @@ export default defineConfig([
"react/jsx-uses-vars": "warn",
},
},
{
files: ["**/*.config.js", "**/jest.config*.js"],
rules: {
"import/no-anonymous-default-export": "off",
},
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AppLoadContext, EntryContext } from "react-router";
import type { EntryContext, RouterContextProvider } from "react-router";
import { ServerRouter } from "react-router";
import { isbot } from "isbot";
import { renderToReadableStream } from "react-dom/server";
Expand All @@ -8,7 +8,7 @@ export default async function handleRequest(
responseStatusCode: number,
responseHeaders: Headers,
routerContext: EntryContext,
_loadContext: AppLoadContext,
_loadContext: RouterContextProvider,
) {
let shellRendered = false;
const userAgent = request.headers.get("user-agent");
Expand Down
2 changes: 1 addition & 1 deletion integration/middleware-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1986,7 +1986,7 @@ test.describe("Middleware", () => {
"app/entry.server.tsx": js`
import { PassThrough } from "node:stream";

import type { AppLoadContext, EntryContext } from "react-router";
import type { EntryContext } from "react-router";
import { createReadableStreamFromReadable } from "@react-router/node";
import { ServerRouter } from "react-router";
import type { RenderToPipeableStreamOptions } from "react-dom/server";
Expand Down
4 changes: 2 additions & 2 deletions integration/vite-spa-mode-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ test.describe("SPA Mode", () => {
import * as path from "node:path";
import { PassThrough } from "node:stream";

import type { AppLoadContext, EntryContext } from "react-router";
import type { EntryContext, RouterContextProvider } from "react-router";
import { createReadableStreamFromReadable } from "@react-router/node";
import { ServerRouter } from "react-router";
import { renderToPipeableStream } from "react-dom/server";
Expand All @@ -387,7 +387,7 @@ test.describe("SPA Mode", () => {
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext,
loadContext: AppLoadContext
loadContext: RouterContextProvider
) {
return handleBotRequest(
request,
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.1.1",
"fast-glob": "3.3.3",
"globals": "^17.6.0",
"isbot": "^5.1.40",
"jest": "^30.4.2",
"jest-environment-jsdom": "^30.4.1",
"jsdom": "^29.1.1",
"react": "catalog:",
"react-dom": "catalog:",
"picocolors": "^1.1.1",
"prettier": "^3.8.3",
"prompts": "^2.4.2",
Expand Down
6 changes: 6 additions & 0 deletions packages/create-react-router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# `create-react-router`

## v8.0.1

### Patch Changes

- _No changes_

## v8.0.0

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

## v8.0.1

### Patch Changes

- Updated dependencies:
- [`react-router@8.0.1`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.1)
- [`@react-router/node@8.0.1`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@8.0.1)

## v8.0.0

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

## v8.0.1

### Patch Changes

- Updated dependencies:
- [`react-router@8.0.1`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.1)

## v8.0.0

### Major Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@react-router/cloudflare",
"type": "module",
"version": "8.0.0",
"version": "8.0.1",
"description": "Cloudflare platform abstractions for React Router",
"bugs": {
"url": "https://github.com/remix-run/react-router/issues"
Expand Down
9 changes: 9 additions & 0 deletions packages/react-router-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# `@react-router/dev`

## v8.0.1

### Patch Changes

- Updated dependencies:
- [`react-router@8.0.1`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.1)
- [`@react-router/node@8.0.1`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@8.0.1)
- [`@react-router/serve@8.0.1`](https://github.com/remix-run/react-router/releases/tag/@react-router/serve@8.0.1)

## v8.0.0

### Major Changes
Expand Down
2 changes: 0 additions & 2 deletions packages/react-router-dev/cli/run.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { readFileSync } from "node:fs";
import path from "node:path";
import arg from "arg";
import semver from "semver";
import colors from "picocolors";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PassThrough } from "node:stream";

import type { AppLoadContext, EntryContext } from "react-router";
import type { EntryContext, RouterContextProvider } from "react-router";
import { createReadableStreamFromReadable } from "@react-router/node";
import { ServerRouter } from "react-router";
import { isbot } from "isbot";
Expand All @@ -14,9 +14,7 @@ export default function handleRequest(
responseStatusCode: number,
responseHeaders: Headers,
routerContext: EntryContext,
loadContext: AppLoadContext,
// If you have middleware enabled:
// loadContext: RouterContextProvider
loadContext: RouterContextProvider,
) {
// https://httpwg.org/specs/rfc9110.html#HEAD
if (request.method.toUpperCase() === "HEAD") {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@react-router/dev",
"type": "module",
"version": "8.0.0",
"version": "8.0.1",
"description": "Dev tools and CLI for React Router",
"homepage": "https://reactrouter.com",
"bugs": {
Expand Down
5 changes: 4 additions & 1 deletion packages/react-router-dev/vite/has-dependency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ export function hasDependency({
}) {
try {
return Boolean(nodeRequire.resolve(name, { paths: [rootDirectory] }));
} catch (err) {
} catch (
// eslint-disable-next-line @typescript-eslint/no-unused-vars
e
) {
return false;
}
}
24 changes: 1 addition & 23 deletions packages/react-router-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// context but want to use Vite's ESM build since Vite 7+ is ESM only
import type * as Vite from "vite";
import { type BinaryLike, createHash } from "node:crypto";
import { existsSync, readFileSync, readdirSync, rmSync } from "node:fs";
import { existsSync, readFileSync, readdirSync } from "node:fs";
import {
cp,
mkdir,
Expand Down Expand Up @@ -221,28 +221,6 @@ const isRouteVirtualModule = (id: string): boolean => {
return isRouteEntryModuleId(id) || isRouteChunkModuleId(id);
};

const isServerBuildVirtualModuleId = (id: string): boolean => {
return id.split("?")[0] === virtual.serverBuild.id;
};

const getServerBuildFile = (viteManifest: Vite.Manifest): string => {
let serverBuildIds = Object.keys(viteManifest).filter(
isServerBuildVirtualModuleId,
);

invariant(
serverBuildIds.length <= 1,
"Multiple server build files found in manifest",
);

invariant(
serverBuildIds.length === 1,
"Server build file not found in manifest",
);

return viteManifest[serverBuildIds[0]].file;
};

type ReactRouterPluginContext = {
buildManifest: BuildManifest | null;
rootDirectory: string;
Expand Down
8 changes: 8 additions & 0 deletions packages/react-router-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# `@react-router/express`

## v8.0.1

### Patch Changes

- Updated dependencies:
- [`react-router@8.0.1`](https://github.com/remix-run/react-router/releases/tag/react-router@8.0.1)
- [`@react-router/node@8.0.1`](https://github.com/remix-run/react-router/releases/tag/@react-router/node@8.0.1)

## v8.0.0

### Major Changes
Expand Down
Loading