babel / ruby-babel-transpiler

Ruby Babel is a bridge to the JS Babel transpiler.
https://github.com/babel/ruby-babel-transpiler
MIT License
160 stars 27 forks source link

WIP: Support babel-source 6.0.x #282

Open tricknotes opened 9 years ago

tricknotes commented 9 years ago

The following issues are blocker:

lucasmazza commented 9 years ago

Hey @tricknotes,

I'm using this gem with Sprockets and based on how Babel 6 does not contains any transformations by default I'm wondering if this gem will bundle any preset on top of babel-browser? I couldn't find any documentation on what is bundled on babel-browser so I want to know how the babel 5 -> 6 upgrade will affect the users of the Ruby transpiler.

ralekna commented 8 years ago

I also miss mechanics on adding and loading Babel plugins into ExecJS context.

Daniel15 commented 8 years ago

browser.js no longer exists, you'll need to build your own version of Babel. I'm currently attempting to do the same thing for ReactJS.NET. Here's the relevant Babel issue: https://phabricator.babeljs.io/T6651

Daniel15 commented 8 years ago

@tricknotes In December I released a package called babel-standalone that works the same as the old babel-browser. It should (hopefully) be a drop-in replacement for Babel 5.

rmacklin commented 8 years ago

I'm interested in this. It would be nice if arbitrary Babel plugins were supported. @Daniel15, would your package allow additional plugins to be used?

Daniel15 commented 8 years ago

Yes, you can use additional plugins, you just pass the plugin objects themselves to the Babel.transform call.

Sent from my phone. On Jun 15, 2016 12:14 AM, "rmacklin" notifications@github.com wrote:

I'm interested in this. It would be nice if arbitrary Babel plugins were supported. @Daniel15 https://github.com/Daniel15, would your package allow additional plugins to be used?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/babel/ruby-babel-transpiler/pull/282#issuecomment-226106955, or mute the thread https://github.com/notifications/unsubscribe/AAFnHf7C-OYinMm6k2UX11V11Oh0V4Ugks5qL6ZugaJpZM4Gap9I .

rmacklin commented 8 years ago

I also found this https://github.com/fnando/babel-schmooze-sprockets (based on https://github.com/Shopify/schmooze) which can use Babel 6 today.

Edit: babel-schmooze-sprockets is restricted to sprockets 4 (which is still in beta). I went ahead and created a similar sprockets plugin myself that works on sprockets 3 and has some extra stuff geared specifically toward migrating large codebases to ES6 modules (since that was my use case at work) but it also works for general purpose babel transpilation: https://github.com/rmacklin/sprockets-bumble_d

guilleiguaran commented 8 years ago

@tricknotes are you interested in a pull request with a solution for this based in babel-standalone by @Daniel15?

pjg commented 7 years ago

What is the current status of this? Will we have Babel 6 support or is this still blocked? The two blocking issues mentioned in the description are closed at babel, so I think a workaround needs to be implemented for them.

rmacklin commented 7 years ago

@pjg Can you introduce node into your stack alongside ruby? If so, my recommendation would be to use babel on node. If you're using sprockets, you can use https://github.com/rmacklin/sprockets-bumble_d which bridges sprockets with babel running on node.

itay-grudev commented 6 years ago

Bump. It's almost 2018 and we are still stuck with Babel 5.x. Is there any chance this can be completed any time soon?

pjg commented 6 years ago

I think the maintainers of this gem are just trying to tell us that Ruby and modern Javascript don't go well together (despite what @dhh et. al. would make you want to believe).

guilleiguaran commented 6 years ago

@pjg this project is out of control of Rails team, we have decided to embrace modern JavaScript using modern tools shipped directly from JS community, that's why we decided to support Yarn/Webpack directly in Rails with Webpacker (and yes, we can use the last version of Babel)

pjg commented 6 years ago

Fair enough @guilleiguaran :)

pedrofurtado commented 6 years ago

Any progress in this issue? It's an important upgrade.

brauliobo commented 6 years ago

@tricknotes is https://github.com/tricknotes/ruby-babel-transpiler/tree/babel-source-6 usable?