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
Transition to using Babel 6 #73
Comments
This would require a change to recast/ast-types benjamn/ast-types#132 right? |
Yeah, and I believe a change in how recast accepts its parser option, as Babel 6 now exposes the |
Using babel6 primarily depends on support from recast / ast-types, yes. However, it may not be as simple as adding new types, depending on how far babel6/babylon will diverge from the ESTree spec. That said, it's probably possible to ditch recast completely and directly use babel6 for traversal and other mutations. No work has been done in this direction, ideas / opinions / help are welcome :) |
Sounds like fun, have any suggestions for where to start figuring out how this integration might work? |
I added the transforms for babel 6 in babel-eslint (beta) https://github.com/babel/acorn-to-esprima/blob/744f2a986d31700d8e9f24fd5487fb71ab6ca9e0/src/toAST.js#L56-L153 - there are some bugs to fix though and it can be a pain to do so (not fun 😄) |
Adding There's already a file for Babel-specific types: https://github.com/benjamn/ast-types/blob/master/def/babel.js Happy to help. |
@benjamn Sure! I was more concerned with things that may impact other parts, like scope evaluation (e.g. if Babel adds new types around |
@fkling There's nothing like that as far as I understand |
this is a cool idea. If jscodeshift can use multiple parsers it will essentially be http://astexplorer.net and will be able to migrate legacy code better. I can support with some development on this. |
Just wanted to add a note for those Googling. Currently, trying to run jscodeshift with Babel 6 returns this error:
|
@globexdesigns: Did you really install the development version of jscodeshift and upgraded jscodeshift's dependency from Babel v5 to Babel v6, or is that some other strange error that happens when using jscodeshift alongside Babel v6? |
@fkling This was a result of using jscodeshift (installed globally) on a code base that uses Babel 6. I did NOT install jscodeshift's development version or do any manual upgrades. |
@globexdesigns: This seems to be a different problem and has nothing to do with the topic discussed here. This topic is about upgrading jscodeshift's internal / ownl version of Babel to v6. jscodeshift shouldn't care whether the files it transforms happen to be converted with Babel or not, that's complete irrelevant. However, there might be an issue with jscodeshift's Babel version picking up the |
@fkling I can confirm that the issue @globexdesigns identified was indeed jscodeshift picking up the project's .babelrc. I will open an issue for that now. |
I would prefer fixing I am toying with auto-generating a It's currently blocked awaiting benjamn/ast-types#145 or other similar solution to benjamn/ast-types#57 . Sample output:
|
This should be implemented now with #119. |
Following up on facebook#67, this adds the manual-bind-to-arrow to the README's transform documentation.
Just wanted to say I love this project! Thank you so much to all the contributor's for their work on this.
After getting used to using jscodeshift inside of http://astexplorer.net, one of the problems I ran into when going to use this on my own machine was the absence of support for Babel 6. Was just curious if there were any plans for supporting Babel 6 in the near future, or if any kind of work has been done already on this front.
The text was updated successfully, but these errors were encountered: