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

Use AST transforms for adding new routes and resources + path option #2748

Merged

Conversation

abuiles
Copy link
Member

@abuiles abuiles commented Dec 15, 2014

This uses the following micro lib
https://github.com/abuiles/ember-router-generator, we still need
support for deletions.

A full list of scenarios can be seen in the following test file
https://github.com/abuiles/ember-router-generator/blob/master/tests/generator-test.js

Instead of using esprima + escodegen I went with https://github.com/benjamn/recast which seems more estable and offers a nicer support for printing code, also works the ES6 features we are using.

I also added the path option so we can now do ember g route friends/edit --path=:friend_id/edit or ember g route account --path=my/account

The following gif shows the new generator in action:

refs: #2729 closes #2724

@abuiles abuiles force-pushed the apply-ast-transforms-to-router branch from 7cd03ac to 8eddc20 Compare December 15, 2014 05:52
This uses the following micro lib
https://github.com/abuiles/ember-router-generator, we still need
support for deletions.

A full list of scenarios can be seen in the following test file
https://github.com/abuiles/ember-router-generator/blob/master/tests/generator-test.js
@abuiles abuiles force-pushed the apply-ast-transforms-to-router branch from 8eddc20 to 690b164 Compare December 15, 2014 15:21
@stefanpenner
Copy link
Contributor

Instead of using esprima + escodegen I went with https://github.com/benjamn/recast which seems more estable and offers a nicer support for printing code, also works the ES6 features we are using.

+1, this is the right tool for the job.

@stefanpenner
Copy link
Contributor

I suspect the appveyor failure is unrelated, so this seems good to go.

Someone will need to fix those failures soon, maybe i'll have time tonight.

@jgwhite
Copy link
Contributor

jgwhite commented Dec 15, 2014

<3

abuiles added a commit that referenced this pull request Dec 15, 2014
@chadhietala
Copy link
Member

👍

@Frozenfire92
Copy link

Can't wait until this is released, a real pain to manually fix the map each time

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

Successfully merging this pull request may close these issues.

Move route.js related blueprints to use esprima + escodegen
5 participants