Eject webpacker for jsbundling-rails #127
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rails has retired the
webpacker
gem and it's general strategy: https://github.com/rails/webpacker. This project made fairly heavy use ofwebpacker
given it was used to compile typescript, react components, JS dependencies, and more.Continuing to use
webpacker
is not an option, as it blocks upgrades of many other things, including Node.js, the runtime openssl version, and numerous webpack plugins.The options to replace webpacker are:
jsbundling-rails
: This is a lightweight gem that basically addsyarn build
into therake assets:precompile
task. This means most of the asset pipeline is compiled with node tooling (in our case:webpack
).shakapacker
: This is the spiritual successor towebpacker
. It's bigger, more robust, has more features. We weren't using most of the headline features (code splitting, hot module reloading) anyway, so I thought this might be overkill.For the most part, the changes here are the result of the process outlined here: https://github.com/rails/jsbundling-rails/blob/main/docs/switch_from_webpacker.md.
I've deployed this to staging and it works as expected.