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
Make Webpacker the default JavaScript compiler for Rails 6 #33079
Conversation
…ramework setup now
Need some work on how to set the global consumer that channels will work with. @javan?
else | ||
GemfileEntry.new "mini_racer", nil, comment, { platforms: :ruby }, true | ||
[ GemfileEntry.version("turbolinks", "~> 5", | ||
"Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks") ] |
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.
Turbolinks is added on package.json, so it looks unnecessary to add turbolinks to Gemfile.
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.
I see. Thanks. https://github.com/turbolinks/turbolinks-rails
There’s a Ruby and a JS component. Both are needed.
… On Jun 7, 2018, at 23:23, yhirano55 ***@***.***> wrote:
@yhirano55 commented on this pull request.
In railties/lib/rails/generators/app_base.rb:
> - end
-
- gems
- end
- end
-
- def javascript_runtime_gemfile_entry
- comment = "See https://github.com/rails/execjs#readme for more supported runtimes"
- if defined?(JRUBY_VERSION)
- GemfileEntry.version "therubyrhino", nil, comment
- elsif RUBY_PLATFORM =~ /mingw|mswin/
- GemfileEntry.version "duktape", nil, comment
- else
- GemfileEntry.new "mini_racer", nil, comment, { platforms: :ruby }, true
+ [ GemfileEntry.version("turbolinks", "~> 5",
+ "Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks") ]
Turbolinks is added on package.json, so it looks unnecessary to add turbolinks to Gemfile.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Because JavaScript is a language, not a classification of a domain type,
like controllers or views or models. JavaScript has all those things.
Saying "JavaScripts" imply that it's a collection of isolated, independent
files, when it's not. It's the part of the application written in
JavaScript.
…On Fri, Jun 15, 2018 at 6:18 PM, Rainer Borene ***@***.***> wrote:
@dhh <https://github.com/dhh> any reason to keep the javascript folder
name in singular? why not following the pattern of plural name like
controllers, models and views?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#33079 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAKtdNf_Y4N_9wLEZE3ZnZR08tvrNhiks5t895pgaJpZM4UegdM>
.
|
@dhh that means that sprockets will no longer be a dependency on Rails? |
No, Sprockets is still to be used for SCSS (and other CSS processors) as
well as copying all other static assets.
…On Mon, Jun 25, 2018 at 3:25 PM, Rainer Borene ***@***.***> wrote:
@dhh <https://github.com/dhh> that means that sprockets will no longer be
a dependency on Rails?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#33079 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAKtUSOtzstvc81TfoLi1IQVNJijU_Zks5uAOTngaJpZM4UegdM>
.
|
…ators [ci skip] This option is unused since rails#33079. Follow up rails#34277
@dhh keeping my eyes peeled for the promised new JS framework for Rails 6.0 reveal! (Haven't found anything satisfying so far with either React, or Stimulus or Ember - hope its a new "Rails Way" framework) |
It's been revealed! https://www.youtube.com/watch?v=HJZ9TnKrt7Q
There's another Rails 6 reveal in the wings still, but that's not a JS
related framework.
…On Thu, Nov 29, 2018 at 2:24 PM Shashi Prabhakar ***@***.***> wrote:
@dhh <https://github.com/dhh> keeping my eyes peeled for the promised new
JS framework for Rails 6.0 reveal! (Haven't found anything satisfying so
far with either React, or Stimulus or Ember - hope its a new "Rails Way"
framework)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#33079 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAKtSfFeAoI1p87DRkq8ikb7a14INOPks5u0F6LgaJpZM4UegdM>
.
|
Fix path to channel files. `rails generate channel Chat` generates `app/javascript/channels/chat_channel.js`. See also, railties/lib/rails/generators/rails/app/templates/app/javascript/packs/application.js.tt, actioncable/lib/rails/generators/channel/templates/javascript/index.js.tt by default `application.js` imports "channels", where `app/javascript/channels/index.js` loads all the channels within this directory and all subdirectories. Follow up rails#34709 Related to rails#33079
Make Webpacker the default JavaScript compiler for Rails 6 rails/rails#33079
Make Webpacker the default JavaScript compiler for Rails 6 rails/rails#33079
webpacker will be the default JavaScript compiler for Rails 6: - rails/rails#33079 Note, webpacker and the asset pipeline can run side-by-side. - webpacker and yarn are now used to manage: jquery, rails-ujs, turbolinks and local-time JavaScript libraries. - jQuery is exported globally from webpacker and is used in the asset pipeline and JS remote responses - the album tracks visibility JS sprinkle is now ES6 served by webpacker instead CoffeeScript via the asset pipeline. Upcoming work: - Move/convert all CoffeeScript sprinkles from the asset pipeline to ES6 via webpacker - Replace Gemified Bootstrap via the asset pipeline with yarn and webpacker managed Bootstrap (v3) - Move images and stylesheets from the asset pipeline to webpacker - Delete the asset pipeline
seems like webpacker is increasingly the way to go for new js/css asset work in rails with it being the default in rails 6, so lets start working on transitioning to better practices and get some rewrites of the old code in ( rails/rails#33079 )
Make Webpacker the default Javascript compiler for Rails 6 with the following changes: