ruby-babel-transpiler icon indicating copy to clipboard operation
ruby-babel-transpiler copied to clipboard

WIP: Support babel-source 6.0.x

Open tricknotes opened this issue 9 years ago • 16 comments

The following issues are blocker:

  • https://github.com/babel/babel/issues/2635
  • https://github.com/babel/babel/pull/2768

tricknotes avatar Nov 03 '15 04:11 tricknotes

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.

lucasmazza avatar Nov 08 '15 23:11 lucasmazza

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

ralekna avatar Nov 24 '15 02:11 ralekna

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 avatar Dec 01 '15 06:12 Daniel15

@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.

Daniel15 avatar Jan 18 '16 02:01 Daniel15

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?

rmacklin avatar Jun 15 '16 07:06 rmacklin

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" [email protected] 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 .

Daniel15 avatar Jun 15 '16 15:06 Daniel15

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

rmacklin avatar Jun 15 '16 17:06 rmacklin

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

guilleiguaran avatar Nov 01 '16 02:11 guilleiguaran

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.

pjg avatar Mar 10 '17 09:03 pjg

@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.

rmacklin avatar Mar 10 '17 19:03 rmacklin

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?

itay-grudev avatar Dec 04 '17 18:12 itay-grudev

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).

pjg avatar Dec 04 '17 19:12 pjg

@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)

guilleiguaran avatar Dec 04 '17 19:12 guilleiguaran

Fair enough @guilleiguaran :)

pjg avatar Dec 07 '17 16:12 pjg

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

pedrofurtado avatar May 28 '18 15:05 pedrofurtado

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

brauliobo avatar Oct 05 '18 16:10 brauliobo