Skip to content

Commit 3cb7cdc

Browse files
fix: Remove obsolete using_packer? method references
- Remove call to undefined ReactOnRails::PackerUtils.using_packer? method - Update test mocks to use Shakapacker directly instead of packer abstraction - Fix Shakapacker::Manifest::MissingEntryError reference in tests The using_packer? method was removed in a recent refactor that eliminated the unnecessary packer abstraction layer. This commit aligns the code with those changes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent b478d61 commit 3cb7cdc

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

lib/react_on_rails/utils.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ def self.bundle_js_file_path(bundle_name)
8686
end
8787

8888
private_class_method def self.bundle_js_file_path_with_packer(bundle_name)
89-
# Handle test scenarios where packer is mocked as unavailable
90-
return File.join(generated_assets_full_path, bundle_name) unless ReactOnRails::PackerUtils.using_packer?
91-
9289
is_server_bundle = server_bundle?(bundle_name)
9390
config = ReactOnRails.configuration
9491
root_path = Rails.root || "."

spec/react_on_rails/test_helper/webpack_assets_status_checker_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
let(:fixture_dirname) { "assets_with_manifest_exist_server_bundle_separate" }
6363

6464
before do
65-
Packer = ReactOnRails::PackerUtils.packer # rubocop:disable Lint/ConstantDefinitionInBlock, RSpec/LeakyConstantDeclaration
6665
allow(ReactOnRails::PackerUtils).to receive_messages(
6766
manifest_exists?: true,
6867
packer_public_output_path: generated_assets_full_path
@@ -73,7 +72,7 @@
7372
.and_return(File.join(generated_assets_full_path, "manifest.json"))
7473
allow(ReactOnRails::PackerUtils).to receive(:bundle_js_uri_from_packer)
7574
.with("server-bundle.js")
76-
.and_raise(Packer::Manifest::MissingEntryError)
75+
.and_raise(Shakapacker::Manifest::MissingEntryError)
7776
touch_files_in_dir(generated_assets_full_path)
7877
end
7978

spec/react_on_rails/utils_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def mock_dev_server_running
256256

257257
# Since server_bundle_output_path is configured, should return path immediately
258258
# without trying manifest lookup
259-
expect(ReactOnRails::PackerUtils.packer).not_to receive(:manifest)
259+
expect(::Shakapacker).not_to receive(:manifest)
260260
expect(File).not_to receive(:exist?)
261261

262262
path = described_class.server_bundle_js_file_path

0 commit comments

Comments
 (0)