Skip to content
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

Create generator for routes #6

Closed
SpencerCDixon opened this issue Feb 14, 2016 · 4 comments
Closed

Create generator for routes #6

SpencerCDixon opened this issue Feb 14, 2016 · 4 comments

Comments

@SpencerCDixon
Copy link
Owner

Curious as to how I could inject a route into a pre-built routes.js file.

Maybe there could be a routes manifest and the routes.js gets built dynamically from the routes manifest. That way it's easy to add lines to the generated routes manifest and have the app always reflect the right routes. Kind of like how Rails has a routes config.

Route generator should also probably create the appropriate View container file for that route by appending RouteName + View.

@enyachoke
Copy link
Contributor

Am really thinking something on this lines https://github.com/yeoman/generator-angular#route. So that when you generate a a routes you pretty much get a ready to go crud ui and all you need to is define the actually data model or even be more railsy and do something like redux generate route users first_name second_name last_name which will create a route with a datatable and a create and edit form.
https://github.com/yeoman/generator-angular/blob/master/route/index.js#L58-L80

@narehart
Copy link

narehart commented May 6, 2016

I've been thinking about this too. Specifically about storing a components name and path in a routes manifest whenever a route is generated. If that route is a child route you could use babel-core to parse the parent's route file, inject the route into the getChildRoutes function (or add it if its not present), and then write the transformed code back to the file. When uninstall becomes a thing you could use the same process to remove the route. This way you'd get automatic route upkeep without being too prescriptive about what a route file should look like.

@SpencerCDixon
Copy link
Owner Author

That sounds like a great approach! Would you have any interest in working on a PR for it? It would also be important to design the blueprint with a specific version of the react-redux-starter kit in mind.

@anithri
Copy link
Collaborator

anithri commented Sep 25, 2017

Continuing discussion at #115

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants