-
Notifications
You must be signed in to change notification settings - Fork 755
New Babel Transformer #295
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
Conversation
… ruby-babel-transpiler - Make new BabelTransformer the default transformer - README changes to reflect new Babel Transformer - Added deprecation warning for usage of old transformer options - Move old transformer to JSXTransformer - Fixed component generator test after changes to new transformer Fixes reactjs#292, reactjs#278
Couple of notes about the default transformer options:
|
👏 👏 Your implementation looks great! I don't understand your question about "plugins: [constants]" (I'm not familiar with babel yet), what do you mean by that? |
@@ -85,6 +114,8 @@ config.react.jsx_transform_options = { | |||
} | |||
``` | |||
|
|||
#### CoffeeScript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we merge this with the "## Coffeescript" section below?
Could we get a few minimal tests for |
Sorry to just jump in here, but does this implementation by any chance have any relation to the work done to support es6 in sprockets? https://github.com/TannerRogalsky/sprockets-es6 Thanks for the great work! |
@netikular not at all, "just jumping in" is the beauty of a public project, thanks for speaking up :) I noticed that project as I was sizing up some options. I didn't it very compelling because:
So, I think it's ok to have a custom transformer! |
I have been using this alongside react-rails in our application without any issues, to support es6. |
@rmosolgo I agree that the documentation is quite sparse, it took me a little while to get it working. @vipulnsward are you using es6 and JSX together or are you writing your react components in the react-rails style and using the helpers? I noticed that I can rename my JSX files to es6 and with some hoisting up to window get them to work, but it seems like a lot of setup work. I was just wondering how you are handling working between es6 and jsx and if you are using a module loader or just es6 syntax. |
👍 if you guys prefer it, I'm open to it! |
…ils has deprecated it and we dont rely on it from tests
…r= option is available post Rails 4.2
- Cleaned up Babel transformer test - Refactored and cleaned up Babel Transformer
Ok, here's the current status-
|
… transformation options - Fixed passing of transform options to the transformer
ee02ea5
to
caa8df4
Compare
The plugins: constants bit in the React build config shouldn't apply here. That's a custom plugin to transform I don't know how custom plugins would hook into this, I'll let you figure that out :) Might be best to not support them initially unless you've tested and documented how it works. |
Cool, sounds like we don't need As for coffee-script, what if we left Either way, I don't think it's a deal-breaker. |
Custom plugins are as simple as just passing to I think instead of shipping with PS: Even if we ship with breaking changes for CS later, Babel can still be used with passing custom transform options - |
I have pushed an updated version with above changes. I think it makes sense to disable strict by default, to be backwards compatible, since thats how |
Travis looks happy now :-) |
👍 looks good to me 😀 |
🎊 the future is now 😄 |
Fixes #292, #278