Skip to content

Commit dca37ba

Browse files
authored
Upgrade to shakapacker 7 (#527)
* Upgrade to Shakapacker 7.0.0.rc.0 * Use shakapacker binstubs * Rename to shakapacker.yml and some of its entries * Rename spelling in other parts of the project * Update webpackConfig with new Shakapacker interface * Upgrade Shakapacker to 7.0.0.rc.1 * Upgrade shakapacker to 7.0.0
1 parent 7c3bcf8 commit dca37ba

17 files changed

+56
-60
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
- name: Build i18n libraries
6666
run: bundle exec rake react_on_rails:locale
6767

68-
- name: Build webpacker chunks
69-
run: NODE_ENV=development bundle exec bin/webpacker
68+
- name: Build shakapacker chunks
69+
run: NODE_ENV=development bundle exec bin/shakapacker
7070

7171
- name: Run tests with xvfb
7272
uses: GabrielBB/xvfb-action@v1

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ruby "3.1.2"
77

88
gem "cpl", "~> 0.3.3"
99
gem "react_on_rails", "13.2.0"
10-
gem "shakapacker", "6.5.5"
10+
gem "shakapacker", "7.0.0"
1111

1212
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
1313
gem "listen"

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ GEM
332332
websocket (~> 1.0)
333333
semantic_range (3.0.0)
334334
sexp_processor (4.16.1)
335-
shakapacker (6.5.5)
335+
shakapacker (7.0.0)
336336
activesupport (>= 5.2)
337337
rack-proxy (>= 0.6.1)
338338
railties (>= 5.2)
@@ -432,7 +432,7 @@ DEPENDENCIES
432432
scss_lint
433433
sdoc
434434
selenium-webdriver (~> 4)
435-
shakapacker (= 6.5.5)
435+
shakapacker (= 7.0.0)
436436
spring
437437
spring-commands-rspec
438438
uglifier

Procfile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
# You can run these commands in separate shells
33
redis: redis-server
44
rails: bundle exec rails s -p 3000
5-
wp-client: HMR=true RAILS_ENV=development NODE_ENV=development bin/webpacker-dev-server
6-
wp-server: bundle exec rake react_on_rails:locale && HMR=true SERVER_BUNDLE_ONLY=yes bin/webpacker --watch
5+
wp-client: HMR=true RAILS_ENV=development NODE_ENV=development bin/shakapacker-dev-server
6+
wp-server: bundle exec rake react_on_rails:locale && HMR=true SERVER_BUNDLE_ONLY=yes bin/shakapacker --watch

Procfile.dev-static

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ redis: redis-server
66
# When making frequent changes to client side assets, you will prefer building webpack assets
77
# upon saving rather than when you refresh your browser page.
88
# Note, if using React on Rails localization you will need to run
9-
# `bundle exec rake react_on_rails:locale` before you run bin/webpacker
10-
webpack: sh -c 'bundle exec rake react_on_rails:locale && rm -rf public/packs/* || true && bin/webpacker -w'
9+
# `bundle exec rake react_on_rails:locale` before you run bin/shakapacker
10+
webpack: sh -c 'bundle exec rake react_on_rails:locale && rm -rf public/packs/* || true && bin/shakapacker -w'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ line in the `rails_helper.rb` file. If you are using this project as an example
173173
174174
## Webpack
175175
176-
_Converted to use @rails/webpacker webpack configuration_.
176+
_Converted to use Shakapacker webpack configuration_.
177177
178178
179179
### Additional Resources

bin/shakapacker

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env ruby
2+
3+
ENV["RAILS_ENV"] ||= "development"
4+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
5+
6+
require "bundler/setup"
7+
require "shakapacker"
8+
require "shakapacker/webpack_runner"
9+
10+
APP_ROOT = File.expand_path("..", __dir__)
11+
Dir.chdir(APP_ROOT) do
12+
Shakapacker::WebpackRunner.run(ARGV)
13+
end

bin/shakapacker-dev-server

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env ruby
2+
3+
ENV["RAILS_ENV"] ||= "development"
4+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
5+
6+
require "bundler/setup"
7+
require "shakapacker"
8+
require "shakapacker/dev_server_runner"
9+
10+
APP_ROOT = File.expand_path("..", __dir__)
11+
Dir.chdir(APP_ROOT) do
12+
Shakapacker::DevServerRunner.run(ARGV)
13+
end

bin/webpacker

Lines changed: 0 additions & 15 deletions
This file was deleted.

bin/webpacker-dev-server

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)