Skip to content

Commit

Permalink
Merge branch 'release-next'
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Nov 22, 2024
2 parents bff2d58 + 6ee7f68 commit f503b49
Show file tree
Hide file tree
Showing 48 changed files with 290 additions and 139 deletions.
79 changes: 49 additions & 30 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,126 +13,128 @@ We manage release notes in this file instead of the paginated Github Releases Pa
<summary>Table of Contents</summary>

- [Remix Releases](#remix-releases)
- [v2.15.0-pre.0](#v2150-pre0)
- [Patch Changes](#patch-changes)
- [v2.14.0](#v2140)
- [Minor Changes](#minor-changes)
- [Patch Changes](#patch-changes)
- [Patch Changes](#patch-changes-1)
- [Updated Dependencies](#updated-dependencies)
- [Changes by Package](#changes-by-package)
- [v2.13.1](#v2131)
- [Patch Changes](#patch-changes-1)
- [Patch Changes](#patch-changes-2)
- [v2.13.0](#v2130)
- [What's Changed](#whats-changed)
- [Stabilized APIs](#stabilized-apis)
- [Minor Changes](#minor-changes-1)
- [Patch Changes](#patch-changes-2)
- [Patch Changes](#patch-changes-3)
- [Updated Dependencies](#updated-dependencies-1)
- [Changes by Package](#changes-by-package-1)
- [v2.12.1](#v2121)
- [Patch Changes](#patch-changes-3)
- [Patch Changes](#patch-changes-4)
- [Changes by Package](#changes-by-package-2)
- [v2.12.0](#v2120)
- [What's Changed](#whats-changed-1)
- [Future Flag for Automatic Dependency Optimization (unstable)](#future-flag-for-automatic-dependency-optimization-unstable)
- [Improved Single Fetch Type Safety (unstable)](#improved-single-fetch-type-safety-unstable)
- [Updates to Single Fetch Revalidation Behavior (unstable)](#updates-to-single-fetch-revalidation-behavior-unstable)
- [Minor Changes](#minor-changes-2)
- [Patch Changes](#patch-changes-4)
- [Patch Changes](#patch-changes-5)
- [Updated Dependencies](#updated-dependencies-2)
- [Changes by Package](#changes-by-package-3)
- [v2.11.2](#v2112)
- [Patch Changes](#patch-changes-5)
- [Patch Changes](#patch-changes-6)
- [Updated Dependencies](#updated-dependencies-3)
- [Changes by Package](#changes-by-package-4)
- [v2.11.1](#v2111)
- [Patch Changes](#patch-changes-6)
- [Patch Changes](#patch-changes-7)
- [Changes by Package](#changes-by-package-5)
- [v2.11.0](#v2110)
- [What's Changed](#whats-changed-2)
- [Renamed `unstable_fogOfWar` future flag to `unstable_lazyRouteDiscovery` (unstable)](#renamed-unstable_fogofwar-future-flag-to-unstable_lazyroutediscovery-unstable)
- [Removed `response` stub in Single Fetch (unstable)](#removed-response-stub-in-single-fetch-unstable)
- [Minor Changes](#minor-changes-3)
- [Patch Changes](#patch-changes-7)
- [Patch Changes](#patch-changes-8)
- [Updated Dependencies](#updated-dependencies-4)
- [Changes by Package](#changes-by-package-6)
- [v2.10.3](#v2103)
- [Patch Changes](#patch-changes-8)
- [Patch Changes](#patch-changes-9)
- [Updated Dependencies](#updated-dependencies-5)
- [Changes by Package](#changes-by-package-7)
- [v2.10.2](#v2102)
- [Patch Changes](#patch-changes-9)
- [Patch Changes](#patch-changes-10)
- [Changes by Package](#changes-by-package-8)
- [v2.10.1](#v2101)
- [Patch Changes](#patch-changes-10)
- [Patch Changes](#patch-changes-11)
- [Updated Dependencies](#updated-dependencies-6)
- [Changes by Package](#changes-by-package-9)
- [v2.10.0](#v2100)
- [What's Changed](#whats-changed-3)
- [Lazy Route Discovery (a.k.a. "Fog of War")](#lazy-route-discovery-aka-fog-of-war)
- [Minor Changes](#minor-changes-4)
- [Patch Changes](#patch-changes-11)
- [Patch Changes](#patch-changes-12)
- [Updated Dependencies](#updated-dependencies-7)
- [Changes by Package](#changes-by-package-10)
- [v2.9.2](#v292)
- [What's Changed](#whats-changed-4)
- [Updated Type-Safety for Single Fetch](#updated-type-safety-for-single-fetch)
- [Patch Changes](#patch-changes-12)
- [Patch Changes](#patch-changes-13)
- [Updated Dependencies](#updated-dependencies-8)
- [Changes by Package](#changes-by-package-11)
- [v2.9.1](#v291)
- [Patch Changes](#patch-changes-13)
- [Patch Changes](#patch-changes-14)
- [Changes by Package](#changes-by-package-12)
- [v2.9.0](#v290)
- [What's Changed](#whats-changed-5)
- [Single Fetch (unstable)](#single-fetch-unstable)
- [Undici](#undici)
- [Minor Changes](#minor-changes-5)
- [Patch Changes](#patch-changes-14)
- [Patch Changes](#patch-changes-15)
- [Updated Dependencies](#updated-dependencies-9)
- [Changes by Package](#changes-by-package-13)
- [v2.8.1](#v281)
- [Patch Changes](#patch-changes-15)
- [Patch Changes](#patch-changes-16)
- [Updated Dependencies](#updated-dependencies-10)
- [Changes by Package](#changes-by-package-14)
- [v2.8.0](#v280)
- [Minor Changes](#minor-changes-6)
- [Patch Changes](#patch-changes-16)
- [Patch Changes](#patch-changes-17)
- [Updated Dependencies](#updated-dependencies-11)
- [Changes by Package](#changes-by-package-15)
- [2.7.2](#272)
- [Patch Changes](#patch-changes-17)
- [2.7.1](#271)
- [Patch Changes](#patch-changes-18)
- [2.7.1](#271)
- [Patch Changes](#patch-changes-19)
- [v2.7.0](#v270)
- [What's Changed](#whats-changed-6)
- [Stabilized Vite Plugin](#stabilized-vite-plugin)
- [New `Layout` Export](#new-layout-export)
- [Basename support](#basename-support)
- [Cloudflare Proxy as a Vite Plugin](#cloudflare-proxy-as-a-vite-plugin)
- [Minor Changes](#minor-changes-7)
- [Patch Changes](#patch-changes-19)
- [Patch Changes](#patch-changes-20)
- [Updated Dependencies](#updated-dependencies-12)
- [Changes by Package](#changes-by-package-16)
- [v2.6.0](#v260)
- [What's Changed](#whats-changed-7)
- [Unstable Vite Plugin updates](#unstable-vite-plugin-updates)
- [Minor Changes](#minor-changes-8)
- [Patch Changes](#patch-changes-20)
- [Patch Changes](#patch-changes-21)
- [Updated Dependencies](#updated-dependencies-13)
- [Changes by Package](#changes-by-package-17)
- [v2.5.1](#v251)
- [Patch Changes](#patch-changes-21)
- [Patch Changes](#patch-changes-22)
- [Updated Dependencies](#updated-dependencies-14)
- [Changes by Package](#changes-by-package-18)
- [v2.5.0](#v250)
- [What's Changed](#whats-changed-8)
- [SPA Mode (unstable)](#spa-mode-unstable)
- [Server Bundles (unstable)](#server-bundles-unstable)
- [Minor Changes](#minor-changes-9)
- [Patch Changes](#patch-changes-22)
- [Patch Changes](#patch-changes-23)
- [Updated Dependencies](#updated-dependencies-15)
- [Changes by Package](#changes-by-package-19)
- [v2.4.1](#v241)
- [Patch Changes](#patch-changes-23)
- [Patch Changes](#patch-changes-24)
- [Updated Dependencies](#updated-dependencies-16)
- [Changes by Package](#changes-by-package-20)
- [v2.4.0](#v240)
Expand All @@ -141,19 +143,19 @@ We manage release notes in this file instead of the paginated Github Releases Pa
- [`future.v3_relativeSplatPath`](#futurev3_relativesplatpath)
- [Vite Updates (Unstable)](#vite-updates-unstable)
- [Minor Changes](#minor-changes-10)
- [Patch Changes](#patch-changes-24)
- [Patch Changes](#patch-changes-25)
- [Updated Dependencies](#updated-dependencies-17)
- [Changes by Package](#changes-by-package-21)
- [v2.3.1](#v231)
- [Patch Changes](#patch-changes-25)
- [Patch Changes](#patch-changes-26)
- [Updated Dependencies](#updated-dependencies-18)
- [Changes by Package](#changes-by-package-22)
- [v2.3.0](#v230)
- [What's Changed](#whats-changed-10)
- [Stabilized `useBlocker`](#stabilized-useblocker)
- [`unstable_flushSync` API](#unstable_flushsync-api)
- [Minor Changes](#minor-changes-11)
- [Patch Changes](#patch-changes-26)
- [Patch Changes](#patch-changes-27)
- [Updated Dependencies](#updated-dependencies-19)
- [Changes by Package](#changes-by-package-23)
- [v2.2.0](#v220)
Expand All @@ -162,19 +164,19 @@ We manage release notes in this file instead of the paginated Github Releases Pa
- [New Fetcher APIs](#new-fetcher-apis)
- [Persistence Future Flag](#persistence-future-flag)
- [Minor Changes](#minor-changes-12)
- [Patch Changes](#patch-changes-27)
- [Patch Changes](#patch-changes-28)
- [Updated Dependencies](#updated-dependencies-20)
- [Changes by Package](#changes-by-package-24)
- [v2.1.0](#v210)
- [What's Changed](#whats-changed-12)
- [View Transitions](#view-transitions)
- [Stable `createRemixStub`](#stable-createremixstub)
- [Minor Changes](#minor-changes-13)
- [Patch Changes](#patch-changes-28)
- [Patch Changes](#patch-changes-29)
- [Updated Dependencies](#updated-dependencies-21)
- [Changes by Package](#changes-by-package-25)
- [v2.0.1](#v201)
- [Patch Changes](#patch-changes-29)
- [Patch Changes](#patch-changes-30)
- [Changes by Package 🔗](#changes-by-package-)
- [v2.0.0](#v200)
- [Breaking Changes](#breaking-changes)
Expand Down Expand Up @@ -238,6 +240,23 @@ Date: YYYY-MM-DD
-->

## v2.15.0-pre.0

Date: 2025-11-19

### Patch Changes

- Stabilize the `future.v3_routeConfig` future flag, replacing `future.unstable_routeConfig`. This enables support for `routes.ts` to assist with the migration to React Router v7. ([#10236](https://github.com/remix-run/remix/pull/10236))

Note that if you had already enabled the `future.unstable_routeConfig` flag, your route config in `app/routes.ts` is no longer defined via the `routes` export and must now be defined via the default export.

```diff
import { type RouteConfig } from "@remix-run/route-config";

-export const routes: RouteConfig = [];
+export default [] satisfies RouteConfig;
```

## v2.14.0

Date: 2024-11-08
Expand Down
66 changes: 43 additions & 23 deletions docs/start/future-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,29 @@ function handleBrowserRequest(/* ... */) {
}
```

## unstable_routeConfig
## v3_lazyRouteDiscovery

**Background**

With this flag, Remix no longer sends the full route manifest up to the client on initial load. Instead, Remix only sends the server-rendered routes up in the manifest and then fetches the remaining routes as the user navigated around the application. Additional details are available in the [docs][lazy-route-discovery] and the [blog post][lazy-route-discovery-blog-post]

👉 **Enable the Flag**

```ts filename=vite.config.ts
remix({
future: {
v3_lazyRouteDiscovery: true,
},
});
```

**Update your Code**

You shouldn't need to make any changes to your application code for this feature to work.

You may find some usage for the new [`<Link discover>`][discover-prop] API if you wish to disable eager route discovery on certain links.

## v3_routeConfig

<docs-warning>

Expand All @@ -521,7 +543,7 @@ This flag requires the [Vite plugin][vite-plugin].

Config-based routing is the new default in React Router v7, configured via the `routes.ts` file in the app directory. Support for `routes.ts` and its related APIs in Remix are designed as a migration path to help minimize the number of changes required when moving your Remix project over to React Router v7. While some new packages have been introduced within the `@remix-run` scope, these new packages only exist to keep the code in `routes.ts` as similar as possible to the equivalent code for React Router v7.

When the `unstable_routeConfig` future flag is enabled, Remix's built-in file system routing will be disabled and your project will opted into React Router v7's config-based routing. If you prefer to keep using Remix's file-based routing we cover how to enable it in `routes.ts` below.
When the `v3_routeConfig` future flag is enabled, Remix's built-in file system routing will be disabled and your project will opted into React Router v7's config-based routing. To opt back in to file system routing, this can be explicitly configured within `routes.ts` as we'll cover below.

**Update your code**

Expand All @@ -532,7 +554,7 @@ To migrate Remix's file system routing and route config to the equivalent setup
```ts filename=vite.config.ts
remix({
future: {
unstable_routeConfig: true,
v3_routeConfig: true,
},
});
```
Expand All @@ -556,7 +578,7 @@ touch app/routes.ts
```ts filename=app/routes.ts
import type { RouteConfig } from "@remix-run/route-config";

export const routes: RouteConfig = [];
export default [] satisfies RouteConfig;
```

This is a good way to check that your new `routes.ts` file is being picked up successfully. Your app should now be rendering a blank page since there aren't any routes defined yet.
Expand All @@ -575,7 +597,7 @@ This package matches the API of React Router v7's `@react-router/fs-routes`, mak
import { flatRoutes } from "@remix-run/fs-routes";
import type { RouteConfig } from "@remix-run/route-config";

export const routes: RouteConfig = flatRoutes();
export default flatRoutes() satisfies RouteConfig;
```

👉 **If you used the `routes` config option, add `@remix-run/routes-option-adapter` and use it in `routes.ts`**
Expand All @@ -601,9 +623,9 @@ import { type RouteConfig } from "@remix-run/route-config";
import { remixRoutesOptionAdapter } from "@remix-run/routes-option-adapter";
import { flatRoutes } from "remix-flat-routes";

export const routes: RouteConfig = remixRoutesOptionAdapter(
(defineRoutes) => flatRoutes("routes", defineRoutes)
);
export default remixRoutesOptionAdapter((defineRoutes) =>
flatRoutes("routes", defineRoutes)
) satisfies RouteConfig;
```

Or, if you were using the `routes` option to define config-based routes:
Expand All @@ -613,18 +635,16 @@ import { flatRoutes } from "@remix-run/fs-routes";
import { type RouteConfig } from "@remix-run/route-config";
import { remixRoutesOptionAdapter } from "@remix-run/routes-option-adapter";

export const routes: RouteConfig = remixRoutesOptionAdapter(
(defineRoutes) => {
return defineRoutes((route) => {
route("/", "home/route.tsx", { index: true });
route("about", "about/route.tsx");
route("", "concerts/layout.tsx", () => {
route("trending", "concerts/trending.tsx");
route(":city", "concerts/city.tsx");
});
export default remixRoutesOptionAdapter((defineRoutes) => {
return defineRoutes((route) => {
route("/", "home/route.tsx", { index: true });
route("about", "about/route.tsx");
route("", "concerts/layout.tsx", () => {
route("trending", "concerts/trending.tsx");
route(":city", "concerts/city.tsx");
});
}
);
});
}) satisfies RouteConfig;
```

If you're defining config-based routes in this way, you might want to consider migrating to the new route config API since it's more streamlined while still being very similar to the old API. For example, the routes above would look like this:
Expand All @@ -637,14 +657,14 @@ import {
index,
} from "@remix-run/route-config";

export const routes: RouteConfig = [
export default [
index("home/route.tsx"),
route("about", "about/route.tsx"),
layout("concerts/layout.tsx", [
route("trending", "concerts/trending.tsx"),
route(":city", "concerts/city.tsx"),
]),
];
] satisfies RouteConfig;
```

Note that if you need to mix and match different route config approaches, they can be merged together into a single array of routes. The `RouteConfig` type ensures that everything is still valid.
Expand All @@ -655,13 +675,13 @@ import type { RouteConfig } from "@remix-run/route-config";
import { route } from "@remix-run/route-config";
import { remixRoutesOptionAdapter } from "@remix-run/routes-option-adapter";

export const routes: RouteConfig = [
export default [
...(await flatRoutes({ rootDirectory: "fs-routes" })),

...(await remixRoutesOptionAdapter(/* ... */)),

route("/hello", "routes/hello.tsx"),
];
] satisfies RouteConfig;
```

## Deprecations
Expand Down
6 changes: 3 additions & 3 deletions integration/helpers/vite-cloudflare-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"typecheck": "tsc"
},
"dependencies": {
"@remix-run/cloudflare": "2.14.0",
"@remix-run/cloudflare-pages": "2.14.0",
"@remix-run/react": "2.14.0",
"@remix-run/cloudflare": "2.15.0",
"@remix-run/cloudflare-pages": "2.15.0",
"@remix-run/react": "2.15.0",
"isbot": "^4.1.0",
"miniflare": "^3.20231030.4",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const viteConfig = {
export default {
${await viteConfig.server(args)}
plugins: [remix(${
args.routeConfig ? "{ future: { unstable_routeConfig: true } }" : ""
args.routeConfig ? "{ future: { v3_routeConfig: true } }" : ""
})]
}
`;
Expand Down
Loading

0 comments on commit f503b49

Please sign in to comment.