Commit 80a1220
Fix core package behavior: render all components after page load
Corrected misunderstanding of core vs pro behavior:
**Core Package (MIT):**
- Waits for FULL page load before rendering
- Then renders/hydrates ALL components at once
- Simple, synchronous approach
- Added renderAllComponents() and renderAllStores() functions
**Pro Package (Commercial):**
- Can hydrate BEFORE page load (immediate_hydration: true)
- Can hydrate on-demand with async component loading
- More advanced lifecycle management with unmounting
Updated ClientRenderer.ts:
- Added renderAllComponents() to render all components after page load
- Added renderAllStores() to initialize all stores
- Kept reactOnRailsComponentLoaded() for individual component rendering
Updated clientStartup.ts:
- Now calls renderAllComponents() when page is fully loaded
- Correct comments explaining core vs pro behavior
This matches the original React on Rails behavior where core package
renders all components after page load, and pro package adds advanced
features like immediate hydration and on-demand rendering.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 56f3b30 commit 80a1220
File tree
2 files changed
+34
-6
lines changed- packages/react-on-rails/src
2 files changed
+34
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
129 | 156 | | |
130 | 157 | | |
131 | 158 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | | - | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
0 commit comments