Skip to content

Commit 9c9abd1

Browse files
justin808claude
andcommitted
Fix RuboCop violations and add comment about defer loading strategy
- Remove unnecessary rubocop disable/enable directives - Fix Style/SymbolArray violation in shakapacker-precompile-hook - Add explanatory comment about generated_component_packs_loading_strategy defaulting to :defer to match OSS dummy app configuration Note: The failing "React Router Sixth Page" RSpec test is a known flaky test that also fails intermittently on master. This is not a regression from the defer loading strategy changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent cbb7df2 commit 9c9abd1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

react_on_rails_pro/spec/dummy/bin/shakapacker-precompile-hook

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def build_rescript_if_needed
4949
end
5050

5151
# Generate React on Rails packs if needed
52-
# rubocop:disable Metrics/CyclomaticComplexity
5352
def generate_packs_if_needed
5453
# Find Rails root directory
5554
rails_root = find_rails_root
@@ -73,7 +72,7 @@ def generate_packs_if_needed
7372
return unless bundle_available
7473

7574
# Check if rake task exists (use array form for security)
76-
task_list = IO.popen(["bundle", "exec", "rails", "-T"], err: [:child, :out], &:read)
75+
task_list = IO.popen(["bundle", "exec", "rails", "-T"], err: %i[child out], &:read)
7776
return unless task_list.include?("react_on_rails:generate_packs")
7877

7978
# Use array form for better cross-platform support
@@ -86,8 +85,6 @@ def generate_packs_if_needed
8685
exit 1
8786
end
8887
end
89-
# rubocop:enable Metrics/CyclomaticComplexity
90-
9188
# Main execution
9289
begin
9390
build_rescript_if_needed

react_on_rails_pro/spec/dummy/config/initializers/react_on_rails.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ def self.adjust_props_for_client_side_hydration(_component_name, props)
3939
config.auto_load_bundle = true
4040
config.components_subdirectory = "ror-auto-load-components"
4141

42+
# Don't explicitly set generated_component_packs_loading_strategy - let it default to :defer
43+
# which ensures generated component packs load and register components before main bundle executes
44+
4245
config.enforce_private_server_bundles = true
4346
config.server_bundle_output_path = "ssr-generated"
4447
end

0 commit comments

Comments
 (0)