Our job as framework authors is to strike a balance b/w prescribing a solution and scaling a solution from small apps to large apps.
We should only strongly prescribe when:
- There's already a clear winner (TypeScript)
- when the whole team believes should be the one obvious way to do something
import { route } from "remix"
/*
/about -> routes/about.tsx
/products/:id
-> layout: routes/products/layout.tsx
-> route itself: routes/product.tsx
*/
export default [ // manually defining routes without any sort of convention
route("about", "./routes/about.tsx"),
route("products", "./routes/products_layout.tsx", [
route(":id", "./routes/product.tsx")
])
]
// ^ array API
export default {
"/about": "./routes/about",
"/products": {
index: "",
layout: "./routes/products_layout",
"/:id": "./routes/product"
}
}
// ^ object API
// third-party or in-house convention for routes
export default kilimansAwesomeNewFilesystemRoutes("./app/routes")