Replies: 2 comments 6 replies
-
What I like about Filesystem Routing is that it gives you a rigid structure. It's Convention Over Configuration. That said, being able to define the entire Vike interface in a single file is on the radar: #341. Is that what you want? Why do you have such a strong preference? The more I know why users want something, the better we can prioritize accordingly. As for flexibility, why do you think it would be more flexible? Do you have concrete use cases in mind? I'm genuinely curious. And, yes, flexibility is a top priority. |
Beta Was this translation helpful? Give feedback.
-
Appreciate the reply and thanks for all of the time you've invested into this. I recently built a smallish project in Next.js, so I had a chance to get a feel for file routing. I can't say I hated it exactly or would die on a hill over a routing pattern, but I guess I just don't get the hype. I agree that structure can be good (people do all kinds of crazy stuff), but at least in my opinion I'd prefer if it were something framework agnostic. That said, I can't speak for Vike but I wouldn't say the overall file structure of Next.js has that much a convention benefit. You can try to colocate everything together in the app directory, but I doubt most people do and they end up having to make all kinds of bespoke structures outside of the routes. Aside from that, I like the separation of concerns when it comes to routes. Filesystem routing is a touch faster to bang things up, but it weds a lot more to the framework. It's much easier to move a frontend (or a backend) to a new framework without file routing. Lastly I haven't explored this one very far, but it seems a lot less clean to define dynamic routes aside from route segment params, etc. (I think you have to do a catch all, then write a bunch of code on a page.tsx). Thanks for sending the single file config idea. That seems pretty promising I think! Would it be nestable? One of the nice things about React Router (or an express.js with an express.Router(), etc.) is that you can colocate child routers with sections of the app. |
Beta Was this translation helpful? Give feedback.
-
I've superficially eyed this project for a while but every time I consider it I get turned off by the default file routing. Why has file routing become seemingly dominant in the React world? Is it really because of the 5 minutes saved by starting without a little boilerplate or am I missing something else? How are the hacky naming conventions, forced file structure, lack of flexibility, etc. better than say traditional React Router with nested routes when needed?
Until recently, I actually avoided Next.js for years in part because of file routing so I'm curious! This project seems to be premised around offering more flexibility which sounds like a good thing, yet it still defaults to file routing (I'm aware there is an option to use a dynamic router, but it seemed there were caveats last I checked). This isn't meant as a complaint or a put down on the project (which seems great), just curious.
Beta Was this translation helpful? Give feedback.
All reactions