-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for routes.ts
#11773
Add support for routes.ts
#11773
Conversation
|
routes.ts
Apologies for barging in, but can I ask what the benefit is of having to specify the /routes prefix for every route path? Can't we assume that 99.9% of apps will use this convention? Also, was wondering about having to import from @react-router/dev instead of react-router? |
Anything that's only required at dev time comes from In terms of the
That said, there might be room to add a |
@romansndlr Oh and by the way, you're not barging in at all, I appreciate the feedback 🙂 |
Couple notes from our discussion:
|
To simplify this and make it more type-safe, route helpers are provided:
Remix v2 routes
For back compat of Remix's file-based routing API.
With different root directory, relative to the app directory (default being
"./routes"
):With custom routes:
With third-party Remix routing strategies, e.g. remix-flat-routes,
Mixed usage
An array of multiple routing strategies can be exported. The resulting route manifests will be merged together. This is particularly useful when migrating from one routing strategy to another.