best-practices-badge icon indicating copy to clipboard operation
best-practices-badge copied to clipboard

Add yarn and maybe webpack

Open david-a-wheeler opened this issue 7 years ago • 2 comments

Rails 5.1 optionally integrates yarn and webpack. Yarn makes it easier to bring in JavaScript modules, and webpack creates a compiler pipeline for JavaScript. Yarn might make it easier to keep up-to-date with JavaScript modules directly, in particular chart.js. Webpack would meeting me could use JavaScript es6 constructs directly, without depending on browser updates.

david-a-wheeler avatar Mar 14 '18 11:03 david-a-wheeler

@jdossett @dankohn - any objections? Rails 5 switched to this convention, but when we updated to Rails 5 we never did this part.

Some documentation: https://prograils.com/posts/adding-webpacker-legacy-rails-app http://blog.blackninjadojo.com/ruby/rails/2019/03/01/webpack-webpacker-and-modules-oh-my-how-to-add-javascript-to-ruby-on-rails.html

We currently bring in JavaScript using ruby wrappers, but that depends on others keeping the wrappers up to date (which is increasingly less likely since newer Rails applications don't need to dot that). It should also mean that we can write future JavaScript with more features, and let babel translate it back.

david-a-wheeler avatar Sep 01 '19 18:09 david-a-wheeler

I strongly support.

dankohn avatar Sep 01 '19 18:09 dankohn