Skip to content

Commit

Permalink
Drop webpacker from development dependencies
Browse files Browse the repository at this point in the history
Webpacker has been abandoned in the past few years. I might consider
leaving the Webpacker logic in the gem until a major version release,
but trying to upgrade development dependencies to get Webpacker to work
in CI isn’t worth my time.
  • Loading branch information
Ross Kaffenberger committed Jul 22, 2024
1 parent 701af47 commit e9d7bcf
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 7,636 deletions.
1 change: 0 additions & 1 deletion gemfiles/rails_6.0.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source 'https://rubygems.org'

gem 'rails', '~> 6.0.0'
gem 'webpacker', '>= 4.1'

group :development, :test do
gem 'guard', require: false
Expand Down
9 changes: 0 additions & 9 deletions gemfiles/rails_6.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ GEM
pry (>= 0.13, < 0.15)
racc (1.8.0)
rack (2.2.9)
rack-proxy (0.7.7)
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (6.0.6.1)
Expand Down Expand Up @@ -214,7 +212,6 @@ GEM
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
semantic_range (3.0.0)
shellany (0.0.1)
simplecov (0.22.0)
docile (~> 1.1)
Expand Down Expand Up @@ -249,11 +246,6 @@ GEM
tzinfo (1.2.11)
thread_safe (~> 0.1)
unicode-display_width (2.5.0)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down Expand Up @@ -289,7 +281,6 @@ DEPENDENCIES
sprockets (~> 3.0)
sprockets-rails
standard
webpacker (>= 4.1)

BUNDLED WITH
2.5.16
1 change: 0 additions & 1 deletion gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source 'https://rubygems.org'

gem 'rails', '~> 6.1.0'
gem 'webpacker', '>= 4.1'

group :development, :test do
gem 'guard', require: false
Expand Down
9 changes: 0 additions & 9 deletions gemfiles/rails_6.1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ GEM
pry (>= 0.13, < 0.15)
racc (1.8.0)
rack (2.2.9)
rack-proxy (0.7.7)
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (6.1.7.8)
Expand Down Expand Up @@ -218,7 +216,6 @@ GEM
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
semantic_range (3.0.0)
shellany (0.0.1)
simplecov (0.22.0)
docile (~> 1.1)
Expand Down Expand Up @@ -252,11 +249,6 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down Expand Up @@ -292,7 +284,6 @@ DEPENDENCIES
sprockets (~> 3.0)
sprockets-rails
standard
webpacker (>= 4.1)

BUNDLED WITH
2.5.16
1 change: 0 additions & 1 deletion gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source 'https://rubygems.org'

gem 'rails', '~> 7.0.0'
gem 'webpacker', '>= 4.1'

group :development, :test do
gem 'guard', require: false
Expand Down
9 changes: 0 additions & 9 deletions gemfiles/rails_7.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,6 @@ GEM
pry (>= 0.13, < 0.15)
racc (1.8.0)
rack (2.2.9)
rack-proxy (0.7.7)
rack
rack-test (2.1.0)
rack (>= 1.3)
rails (7.0.8.4)
Expand Down Expand Up @@ -224,7 +222,6 @@ GEM
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
semantic_range (3.0.0)
shellany (0.0.1)
simplecov (0.22.0)
docile (~> 1.1)
Expand Down Expand Up @@ -258,11 +255,6 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand Down Expand Up @@ -298,7 +290,6 @@ DEPENDENCIES
sprockets (~> 3.0)
sprockets-rails
standard
webpacker (>= 4.1)

BUNDLED WITH
2.5.16
1 change: 0 additions & 1 deletion gemfiles/rails_7.1.gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
source 'https://rubygems.org'

gem 'rails', '~> 7.1.0'
gem 'webpacker', '>= 4.1'

group :development, :test do
gem 'guard', require: false
Expand Down
9 changes: 0 additions & 9 deletions gemfiles/rails_7.1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ GEM
stringio
racc (1.8.0)
rack (2.2.9)
rack-proxy (0.7.7)
rack
rack-session (1.0.2)
rack (< 3)
rack-test (2.1.0)
Expand Down Expand Up @@ -253,7 +251,6 @@ GEM
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
semantic_range (3.0.0)
shellany (0.0.1)
simplecov (0.22.0)
docile (~> 1.1)
Expand Down Expand Up @@ -288,11 +285,6 @@ GEM
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
Expand Down Expand Up @@ -329,7 +321,6 @@ DEPENDENCIES
sprockets (~> 3.0)
sprockets-rails
standard
webpacker (>= 4.1)

BUNDLED WITH
2.5.16
14 changes: 9 additions & 5 deletions lib/serviceworker/handlers/webpacker_handler.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# frozen_string_literal: true

require "rack/file"
require "webpacker"
require 'rack/file'
begin
require 'webpacker'
rescue LoadError
# ignore
end

module ServiceWorker
module Handlers
class WebpackerHandler
def call(env)
path_info = env.fetch("serviceworker.asset_name")
path_info = env.fetch('serviceworker.asset_name')

path = Webpacker.manifest.lookup(path_info)

if Webpacker.dev_server.running?
proxy = Webpacker::DevServerProxy.new
proxy.call(env.merge("PATH_INFO" => path))
proxy.call(env.merge('PATH_INFO' => path))
else
file_server.call(env.merge("PATH_INFO" => path))
file_server.call(env.merge('PATH_INFO' => path))
end
end

Expand Down
2 changes: 0 additions & 2 deletions test/sample/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"dependencies": {
"@rails/webpacker": "3.5.5"
},
"devDependencies": {
"webpack-dev-server": "3.7.2"
}
}
Loading

0 comments on commit e9d7bcf

Please sign in to comment.