You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add doctor checks for :async usage without React on Rails Pro (#2010)
## Summary
Adds proactive doctor checks to detect `:async` loading strategy usage
in projects without React on Rails Pro, which can cause component
registration race conditions.
## Changes
The doctor now checks for and reports errors when it detects:
- `javascript_pack_tag` with `:async` in view files
- `config.generated_component_packs_loading_strategy = :async` in
initializer
When detected without Pro, provides clear guidance to either upgrade to
Pro or use `:defer`/`:sync` loading strategies.
This complements PR #1993's configuration validation by adding runtime
detection during development to help developers identify and fix async
usage issues.
## Testing
All new tests pass (155+ examples in doctor spec). The checks are
skipped when React on Rails Pro is installed.
<!-- Reviewable:start -->
- - -
This change is [<img src="https://reviewable.io/review_button.svg"
height="34" align="absmiddle"
alt="Reviewable"/>](https://reviewable.io/reviews/shakacode/react_on_rails/2010)
<!-- Reviewable:end -->
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Diagnostic that detects async component-loading usage when the Pro
edition is not present, reporting affected view and initializer
locations, distinguishing commented/false-positive cases, and providing
guidance and upgrade options.
* **Tests**
* Expanded tests for async-detection across template formats,
comment-aware and multiline scanning, initializer strategies, error
handling, and skipping when Pro is installed.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <[email protected]>
0 commit comments