File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ AllCops:
2525 - ' **/node_modules/**/*'
2626 - ' **/public/**/*'
2727 - ' **/tmp/**/*'
28+ - ' bin/*' # Shell scripts
2829 - ' coverage/**/*'
2930 - ' gen-examples/examples/**/*'
3031 - ' node_modules/**/*'
Original file line number Diff line number Diff line change @@ -172,8 +172,8 @@ def validate_generated_component_packs_loading_strategy
172172
173173 msg = <<~MSG
174174 ReactOnRails: Your current version of shakapacker \
175- does not support async script loading, which may cause performance issues . Please either:
176- 1. Use :sync or :defer loading strategy instead of :async
175+ does not support async script loading. Please either:
176+ 1. Use :defer or :sync loading strategy instead of :async
177177 2. Upgrade to Shakapacker v8.2.0 or above to enable async script loading
178178 MSG
179179 if generated_component_packs_loading_strategy . nil?
Original file line number Diff line number Diff line change @@ -77,6 +77,8 @@ def self.pro_attribution_comment
7777 allow ( helper ) . to receive ( :append_stylesheet_pack_tag )
7878 expect { helper . load_pack_for_generated_component ( "component_name" , render_options ) } . not_to raise_error
7979
80+ # Default loading strategy is now always :defer to prevent race conditions
81+ # between component registration and hydration, regardless of async support
8082 expect ( helper ) . to have_received ( :append_javascript_pack_tag ) . with ( "generated/component_name" , { defer : true } )
8183 expect ( helper ) . to have_received ( :append_stylesheet_pack_tag ) . with ( "generated/component_name" )
8284 end
You can’t perform that action at this time.
0 commit comments