Revert: Fix component registration race condition (#1972)#1981
Revert: Fix component registration race condition (#1972)#1981
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe PR modifies generated component pack loading strategy handling to support async loading when Shakapacker version permits. The configuration validator now checks PackerUtils support and defaults to async for newer versions, sync for older versions with warnings, while retaining deprecation handling. Templates and tests are updated accordingly. Changes
Sequence Diagram(s)sequenceDiagram
participant Config as Configuration<br/>(validate method)
participant Utils as PackerUtils
participant Log as Rails.logger
Config->>Utils: supports_async_loading?
alt Async supported (v8.2.0+)
Utils-->>Config: true
Note over Config: Default to :async
else Async not supported (< v8.2.0)
Utils-->>Config: false
alt Strategy is nil
Config->>Log: warn async not supported
Note over Config: Default to :sync
else Strategy is explicitly :async
Config-->>Config: raise error
end
end
Note over Config: Validate final strategy is one of<br/>:async, :defer, or :sync
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Reverts commit d1a8a1a which changed the default component loading strategy from :sync to :defer.
This reverts the fix for the component registration race condition that was introduced in #1972.
Changes
This change is
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Tests