Skip to content

Commit f22029b

Browse files
committed
Fix CI: Set generated_component_packs_loading_strategy to :defer in spec/dummy for tests
The spec/dummy tests expect :defer as the default loading strategy to prevent race conditions during testing. Since ReactOnRailsPro is stubbed in tests, the configuration would default to :async, but tests expect :defer. This explicitly sets it to :defer for testing purposes while maintaining the Pro-only validation for production use.
1 parent f4bc390 commit f22029b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/dummy/config/initializers/react_on_rails.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,9 @@ def self.adjust_props_for_client_side_hydration(component_name, props)
4141
config.rendering_props_extension = RenderingPropsExtension
4242
config.components_subdirectory = "startup"
4343
config.auto_load_bundle = true
44+
45+
# For spec/dummy tests, we use :defer to prevent component registration race conditions.
46+
# This is explicitly set for testing purposes. Real user apps should rely on the Pro default (:async).
47+
# Note: This setting requires React on Rails Pro in production use.
48+
config.generated_component_packs_loading_strategy = :defer
4449
end

0 commit comments

Comments
 (0)