Skip to content
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

Merged
merged 54 commits into from Oct 1, 2018

Conversation

dhh
Copy link
Member

@dhh dhh commented Jun 7, 2018

Make Webpacker the default Javascript compiler for Rails 6 with the following changes:

  • Webpacker gem is installed by default and webpacker:install is run by the Rails application generator.
  • Action Cable channel generators will create ES6 stubs rather than use CoffeeScript
  • Active Storage, Action Cable, Turbolinks, and Rails-UJS is loaded by a new application.js pack in app/javascript by default (unless any of the frameworks have been opted out).
  • Active Storage, Action Cable, Turbolinks, and Rails-UJS npm modules are automatically listed as dependencies in the default package.json.
  • All the JavaScript-related auxiliaries for Sprockets, like compression and uglifying, is no longer configured or included by default.
  • No JavaScript stubs will be created by default when using the scaffold generators any more.

@dhh dhh added this to the 6.0.0 milestone Jun 7, 2018
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") ]
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhh
Copy link
Member Author

dhh commented Jun 7, 2018 via email

@dhh
Copy link
Member Author

dhh commented Jun 19, 2018 via email

@rainerborene
Copy link

@dhh that means that sprockets will no longer be a dependency on Rails?

@dhh
Copy link
Member Author

dhh commented Jun 25, 2018 via email

bogdanvlviv added a commit to bogdanvlviv/rails that referenced this pull request Oct 22, 2018
@shashiprab
Copy link

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

@dhh
Copy link
Member Author

dhh commented Nov 29, 2018 via email

bogdanvlviv added a commit to bogdanvlviv/rails that referenced this pull request Jan 13, 2019
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
suketa added a commit to suketa/rails_sandbox that referenced this pull request Jun 15, 2019
Make Webpacker the default JavaScript compiler for Rails 6
rails/rails#33079
suketa added a commit to suketa/rails_sandbox that referenced this pull request Jun 16, 2019
Make Webpacker the default JavaScript compiler for Rails 6
rails/rails#33079
bluz71 added a commit to bluz71/platters that referenced this pull request Jun 23, 2019
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
JoshAshby added a commit to transientBug/transientbug-rails that referenced this pull request Jul 20, 2019
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 )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet