Commit 57de0bc
Update spec/dummy for React 19 compatibility (#2127)
## Summary
Updates `spec/dummy` dependencies to be compatible with React 19:
### Dependency Updates
| Package | Old Version | New Version | Reason |
|---------|-------------|-------------|--------|
| `react` | 18.0.0 | ^19.0.0 | Latest React |
| `react-dom` | 18.0.0 | ^19.0.0 | Latest React |
| `react-redux` | ^8.0.2 | ^9.2.0 | React 19 support |
| `redux` | ^4.0.1 | ^5.0.1 | Required by react-redux 9.x |
| `redux-thunk` | ^2.2.0 | ^3.1.0 | Required by redux 5.x |
| `react-helmet` | ^6.1.0 | **Replaced** with
`@dr.pogodin/react-helmet@^3.0.4` | Thread-safe React 19 fork |
### Code Changes
1. **redux-thunk imports** - Updated from default export to named
export:
- `import middleware from 'redux-thunk'` → `import { thunk } from
'redux-thunk'`
- Files: `SharedReduxStore.jsx`, `ReduxApp.server.jsx`,
`ReduxApp.client.jsx`
2. **react-helmet migration** - Updated to `@dr.pogodin/react-helmet`:
- Uses `HelmetProvider` wrapper (required for both client and server)
- Server-side uses `context` prop for thread-safe data capture
- Uses defensive optional chaining (`helmet?.title?.toString() || ''`)
to prevent runtime errors
- Files: `ReactHelmet.jsx`, `ReactHelmetApp.server.jsx`,
`ReactHelmetAppBroken.server.jsx`, client entry points
## Test Plan
### Automated Tests (CI)
- [x] Integration Tests pass
- [x] Lint passes
- [x] Build passes
### Manual Testing Required
These tests require running the spec/dummy app locally and verifying
React Helmet SSR functionality:
1. **Server-rendered pages show correct `<title>` in HTML source**
- Start the dummy app: `cd react_on_rails/spec/dummy && ./bin/dev`
- Visit React Helmet test pages
- View page source (not devtools) and verify `<title>` tag is correctly
rendered
2. **Client hydration doesn't cause React warnings**
- Check browser console for hydration mismatch errors
- Verify no "Cannot read property 'toString' of undefined" errors
3. **Helmet data renders correctly in page source**
- Use `view-source:` to verify server-rendered helmet data
4. **Thread-safety (Pro SSR pool)**
- Run concurrent requests to helmet pages
- Verify responses have correct, non-mixed helmet data
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added Redux and Redux-Thunk support.
* **Bug Fixes**
* Improved null-safe access for metadata handling in server-side
rendering.
* Enhanced CI environment detection for build processes.
* **Dependencies**
* Updated React and React-DOM versions.
* Updated bundler dependencies for compatibility.
* Improved helmet library integration for better metadata management
across client and server rendering.
* **Documentation**
* Enhanced development guidelines and testing recommendations.
<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: Claude <[email protected]>1 parent ce10b69 commit 57de0bc
File tree
22 files changed
+264
-130
lines changed- react_on_rails_pro
- docs
- spec/dummy
- app/views/pages/pro
- client/app
- components
- Loadable
- pages
- loadable
- ror-auto-load-components
- react_on_rails
- lib/react_on_rails
- spec
- dummy
- client/app/startup
- react_on_rails
- script
22 files changed
+264
-130
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
62 | 76 | | |
63 | 77 | | |
64 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
Lines changed: 4 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 25 | + | |
32 | 26 | | |
33 | 27 | | |
34 | 28 | | |
35 | 29 | | |
36 | 30 | | |
37 | 31 | | |
38 | 32 | | |
39 | | - | |
| 33 | + | |
40 | 34 | | |
41 | 35 | | |
42 | 36 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | 21 | | |
| 22 | + | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
| |||
22 | 30 | | |
23 | 31 | | |
24 | 32 | | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
25 | 53 | | |
26 | 54 | | |
27 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
28 | 64 | | |
29 | 65 | | |
30 | 66 | | |
| |||
36 | 72 | | |
37 | 73 | | |
38 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
39 | 83 | | |
40 | 84 | | |
41 | 85 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments