-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Import routes from NPM packages #848
Comments
Yes divide on conquer :) Then use those libs inside your main app repo, which is a next.js app. |
hey @arunoda thank you for your reply! Talking about another project you built , Flow-Router, I started using group routes a lot in my workflow. It might seems like a small thing, but I think it's a big step-up. Think about this approach:
People doesn't have to worry about other people job. This approach scales out VERY well, I've had one 10+ people team working on a very complex engineering app. It blown me away to see how easier it is when things are compartmentalized so well. Talking about a more concrete example, let's say that:
I want that both modules work just by importing them, without modifying my app. I can cover 1, or 2, but not both. I mean I could make it work with a little bit of boilerplate, but I would have to think about it and I think that eventually I would copy group routes. What do you think? I propose we either implement group routes like in flow-router, or offer NPM modules a way to attach to the default routing mechanism. Right now I'm trying with symbolic links, by creating symbolic links in the |
ok after a bit of playing I understood that this is easier than what I thought. https://github.com/zeit/next.js#custom-server-and-routing Does this mean that I can use React Router? how does this play with the default routing scheme? it simply overrides it? |
@servermeta You can't use React Router. You can use any server side router to do the routing. |
Upon further research this looks like doable. I recreated a route object, and i'm using it to programmatically create routes. I will refine my approach and eventually publish it. |
Hello everybody,
a common pattern is to split a big app into several smaller modules, most often NPM packages, and import them in the app. This is especially useful for bigger teams.
How could I import multiple routes from multiple NPM packages?
Is filesystem-based routing something useful for smaller apps, but unfit for bigger development teams?
The text was updated successfully, but these errors were encountered: