Skip to content

Commit 70b4c7d

Browse files
justin808claude
andcommitted
Remove redundant shakapacker_gem_available? checks
Since Shakapacker is a required dependency in gemspec (>= 6.0), the shakapacker_gem_available? checks are unnecessary and misleading. - Remove redundant checks from supports_basic_pack_generation? and supports_auto_registration? - Remove unused shakapacker_gem_available? method entirely - Simplify code and improve clarity - Consistent with supports_async_loading? which correctly doesn't check availability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 27eda87 commit 70b4c7d

File tree

1 file changed

+0
-15
lines changed

1 file changed

+0
-15
lines changed

lib/react_on_rails/packer_utils.rb

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,31 +45,16 @@ def self.supports_async_loading?
4545
end
4646

4747
def self.supports_basic_pack_generation?
48-
return false unless shakapacker_gem_available?
49-
5048
shakapacker_version_requirement_met?(ReactOnRails::PacksGenerator::MINIMUM_SHAKAPACKER_VERSION)
5149
end
5250

5351
def self.supports_auto_registration?
54-
return false unless shakapacker_gem_available?
55-
5652
min_version = ReactOnRails::PacksGenerator::MINIMUM_SHAKAPACKER_VERSION_FOR_AUTO_REGISTRATION
5753
packer.config.respond_to?(:nested_entries?) && shakapacker_version_requirement_met?(min_version)
5854
rescue StandardError
5955
false
6056
end
6157

62-
def self.shakapacker_gem_available?
63-
return @shakapacker_gem_available if defined?(@shakapacker_gem_available)
64-
65-
@shakapacker_gem_available = begin
66-
require "shakapacker"
67-
true
68-
rescue LoadError
69-
false
70-
end
71-
end
72-
7358
# This returns either a URL for the webpack-dev-server, non-server bundle or
7459
# the hashed server bundle if using the same bundle for the client.
7560
# Otherwise returns a file path.

0 commit comments

Comments
 (0)