Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/react_on_rails/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@ def validate_generated_component_packs_loading_strategy

msg = <<~MSG
ReactOnRails: Your current version of shakapacker \
does not support async script loading, which may cause performance issues. Please either:
1. Use :sync or :defer loading strategy instead of :async
does not support async script loading. Please either:
1. Use :defer or :sync loading strategy instead of :async
2. Upgrade to Shakapacker v8.2.0 or above to enable async script loading
MSG
if generated_component_packs_loading_strategy.nil?
Expand Down
2 changes: 2 additions & 0 deletions spec/dummy/spec/helpers/react_on_rails_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ def self.pro_attribution_comment
allow(helper).to receive(:append_stylesheet_pack_tag)
expect { helper.load_pack_for_generated_component("component_name", render_options) }.not_to raise_error

# Default loading strategy is now always :defer to prevent race conditions
# between component registration and hydration, regardless of async support
expect(helper).to have_received(:append_javascript_pack_tag).with("generated/component_name", { defer: true })
expect(helper).to have_received(:append_stylesheet_pack_tag).with("generated/component_name")
end
Expand Down
Loading