ruby-coffee-script icon indicating copy to clipboard operation
ruby-coffee-script copied to clipboard

Please make a new release for coffee-script-source with CoffeeScript 2.0.1

Open joeldrapper opened this issue 7 years ago • 21 comments

The documentation says, “This library depends on the coffee-script-source gem which is updated any time a new version of CoffeeScript is released.”

Several new versions of CoffeeScript have been released, the latest of which is version 2.0.1.

joeldrapper avatar Sep 27 '17 08:09 joeldrapper

Pretty please.

kWhittington avatar Oct 13 '17 14:10 kWhittington

I created this pull request to update the coffee-script-source gem to version 2. https://github.com/rails/ruby-coffee-script/pull/23

gobijan avatar Oct 22 '17 05:10 gobijan

It just got merged. Since CoffeeScript 2 transpiles into ES6 (see http://coffeescript.org/#whats-new-in-coffeescript-2): Is another 6to5 step wanted?

gobijan avatar Oct 24 '17 20:10 gobijan

Oh, yeah, we will need es5 code.

rafaelfranca avatar Oct 24 '17 20:10 rafaelfranca

You have any recommendation here? Should this be up to the user wether to enable 6to5 transpiling or not? I saw that in the uglifier gem description https://github.com/babel/ruby-babel-transpiler is given as an example for 6to5 transpiling.

gobijan avatar Oct 25 '17 21:10 gobijan

I saw the @gobijan’s PR got merged. Is there anything holding back the gem release?

joeldrapper avatar Nov 02 '17 12:11 joeldrapper

Anyone knows what's the current "official" sentiment in regard to coffeescript in rails? Will it still be the default? Is ES6 now preferred?

I saw that basecamp released stimulusjs (https://github.com/stimulusjs/stimulus) and it's written in Typescript. Rails action cable on the other hand is written in Coffeescript (v1?).

I contributed a patch that enables the automatic build of the coffee-script-source gem supporting coffeescript2 (rails/ruby-coffee-script#23) and it got merged. But there is no new release of that gem as you can see in this issue: rails/ruby-coffee-script#22 .

I did not get any feedback yet and I don't know what the plans are in regard to Coffeescript 1 vs 2 vs ES6 vs Typescript.

What direction is the Rails core team heading here? @rafaelfranca @dhh

gobijan avatar Jan 07 '18 12:01 gobijan

Webpacker is in contention to become the preferred/default JavaScript compiler for Rails 6. With that comes the freedom to use whatever transpiler steps available through Webpack and Babel. Which means that in many ways it doesn’t really matter where “things are going”, you can write your JS in whatever flavor you please, and it will all compile together harmoniously.

That being said, CoffeeScript’s previous advantage over vanilla JS has shrunk considerably after ES2015 was released. I don’t think as many developers are going to be drawn to CS now as were in the past because of this. But that’s a triumph of CS! It helped show the way forward for vanilla JS, so we should celebrate its achievement rather than mourn its decline.

On Jan 7, 2018, at 07:57, Bijan Rahnema [email protected] wrote:

Anyone knows what's the current "official" sentiment in regard to coffeescript in rails? Will it still be the default? Is ES6 now preferred?

I saw that basecamp released stimulusjs (https://github.com/stimulusjs/stimulus) and it's written in Typescript. Rails action cable on the other hand is written in Coffeescript (v1?).

I contributed a patch that enables the automatic build of the coffee-script-source gem supporting coffeescript2 (rails/ruby-coffee-script#23) and it got merged. But there is no new release of that gem as you can see in this issue: rails/ruby-coffee-script#22 .

I did not get any feedback yet and I don't know what the plans are in regard to Coffeescript 1 vs 2 vs ES6 vs Typescript.

What direction is the Rails core team heading here? @rafaelfranca @dhh

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

dhh avatar Jan 07 '18 13:01 dhh

Hi! Even if Webpack seems to be the future of assets management in Rails, it would be nice to have this PR merged to ease the transition from assets pipeline to Webpack.

my 2 cents. thank you!

n-rodriguez avatar Feb 22 '18 13:02 n-rodriguez

@n-rodriguez I don't see any PR open related to this, feel free to open one upgrading the version of CS

guilleiguaran avatar Feb 22 '18 14:02 guilleiguaran

@guilleiguaran actually it's already merged: https://github.com/rails/ruby-coffee-script/pull/23. It just needs a new release.

n-rodriguez avatar Feb 22 '18 14:02 n-rodriguez

@n-rodriguez you can configure your Gemfile to pull this repo from GitHub, but I recommend using CoffeeScript2 with WebPacker.

joeldrapper avatar Feb 22 '18 15:02 joeldrapper

@joeldrapper : that's what I do but i'd prefer to not do it :/

n-rodriguez avatar Feb 22 '18 15:02 n-rodriguez

I recommend using CoffeeScript2 with WebPacker.

I'd love to, but unfortunately migrating from assets pipeline to Webpacker is not free.

n-rodriguez avatar Feb 22 '18 15:02 n-rodriguez

In order to release a version compatible with CoffeeScript 2 we need to transpile the ES6 to ES5. Please open a PR with that step that I'll release a new version.

rafaelfranca avatar Feb 23 '18 04:02 rafaelfranca

I think it can be closed now. Thank you!

n-rodriguez avatar Dec 22 '20 18:12 n-rodriguez

I also just added this to my Gemfile and it works quite well:

gem 'coffee-rails', '~> 5.0.0'
gem 'coffee-script-source',  github: 'joeldrapper/coffee-script-source

If you don't need to support IE11 (no transpiling) then this will work fine with Sprockets 4.

pomartel avatar Dec 22 '20 19:12 pomartel

@rafaelfranca do you plan on adding ES6 to ES5 transpiling option to be able to use coffeescript 2?

pravi avatar Jun 20 '22 15:06 pravi

I don't. This project is pretty much deprecated at this point.

rafaelfranca avatar Jun 21 '22 22:06 rafaelfranca

@pravi All major browsers now support ES6. I use Coffeescript 2 without transpiling in my Rails app and it works just fine.

pomartel avatar Jun 22 '22 14:06 pomartel

@rafaelfranca my interest here is limited to building rails actionview from source. Alternatively if https://github.com/rails/rails/issues/45407 is addressed, that will suffice my usecase. blade / execjs don't seem to work with coffeescript 2 output, though using coffee command line and passing javascript instead of coffeescript to blade seems to work. So my immediate need is addressed.

pravi avatar Jun 23 '22 10:06 pravi