rails / sprockets

Rack-based asset packaging system
MIT License
943 stars 787 forks source link

sprockets-es6 gem #45

Closed jonricaurte closed 9 years ago

jonricaurte commented 9 years ago

Tried looking for sprockets-es6 gem and I don't see it anymore. Was this merged into sprockets? I don't see it in the changelog. I just see: Support circular dependencies. For parity with ES6 modules.

rafaelfranca commented 9 years ago

See https://github.com/TannerRogalsky/sprockets-es6.

jonricaurte commented 9 years ago

Thanks! There should be a note somewhere cause everything was pointing to josh online still.

jonricaurte commented 9 years ago

Also, in that repository there are no issues and you can only make pull requests. There were a lot of good comments on how to get started with es6 and systemjs. If anyone wants a sample repository on how to get started, @nfm made a good sample repository here:

https://github.com/nfm/rails-es6-modules/

jonricaurte commented 9 years ago

@rafaelfranca @josh I'm not sure how people can get started using es6, systemjs, and rails when there is no documentation on using this: https://github.com/nfm/rails-es6-modules/blob/master/config/application.rb

Rails.application.config.assets.configure do |env| env.register_transformer 'text/ecmascript-6', 'application/javascript', Sprockets::ES6.new('modules' => 'system', 'moduleIds' => true) end

Unless this is now integrated into sprockets-es6 or sprockets?

nfm commented 9 years ago

@jonricaurte I believe the work that was done in @josh's sprockets-es6 repo has been ported into the 4.x branch of rails/sprockets. I haven't played around with it yet so I'm not sure where it's up to, Josh would be better placed to answer that.

At first glance it does look like SystemJS is now baked in (https://github.com/rails/sprockets/blob/4.x/test/test_babel_processor.rb), but I'm not sure if you need to do anything to opt into it.

jonricaurte commented 9 years ago

@nfm Thanks for the link. Was just wondering because I have had a few people that want to use it now ask me and didn't know where I should point them to, so I put them to your sample app as a good way to get started using it now.