Skip to content

Commit

Permalink
Update changeset
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed Oct 29, 2024
1 parent 0df3455 commit 5f98394
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .changeset/popular-humans-attend.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@
"@remix-run/dev": minor
---

Add unstable support for `routes.ts` to assist with the migration to React Router v7.
Add support for `routes.ts` behind `future.v3_routeConfig` flag to assist with the migration to React Router v7.

Config-based routing is the new default in React Router v7. 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. Since React Router v7 is not yet stable, these APIs are also considered unstable.
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.

The presence of an `app/routes.ts` file when using the Remix Vite plugin will disable Remix's built-in file system routing and opt your project into React Router v7's config-based routing.
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 enable the flag, in your `vite.config.ts` file:

```ts
remix({
future: {
v3_routeConfig: true,
},
})
```

A minimal `routes.ts` file to support Remix's built-in file system routing looks like this:

Expand Down

0 comments on commit 5f98394

Please sign in to comment.