Repository navigation
Commit 5ede721
authored
EPBDS-16211 React 19: declare it, and gate it like 16 and 17 (#131)
On master since #130 merged, which fixed the `npm install` peer conflict
this change needed gone to add a devDependency. The rebased tree is
identical to the one the local gates below ran on.
## The flip
`peerDependencies`: `react` and `react-dom` now read **`^16.14.0 ||
^17.0.0 || ^18.0.0 || ^19.0.0`**. The range is widened additively, so
hosts on 16.14, 17 and 18 change nothing. This closes §8's fast path:
- gates 1 (Semantic UI React gone) and 3 (`defaultProps`, then the
automatic JSX runtime in #129) were met;
- gate 2 (the form stack) lapsed when `dependencies` was emptied (#128
records why);
- this PR is gate 4.
## How 19 is gated, in three matrices
| | 16.14 | 17 | 18 | 19 |
|---|---|---|---|---|
| whole jest suite | `test:react16` | `test:react17` | `npx jest` /
`test:coverage` | **`test:react19` (new)** |
| packed artifact server-rendered | `test:pack:peers` |
`test:pack:peers` | `test:pack:consumer` | **`test:pack:peers` (added
19.3.0)** |
| published `.d.ts` compiled | `test:types` | `test:types` |
`test:types` | **`test:types` (added `@types/react` 19.3.0)** |
- **The suite on React 19 is a fixture leg, like 16.14 and 17.**
`scripts/fixtures/react19` is an install-only package pinning
`react`/`react-dom` 19.3.0. Plain `npm ci` nests it, it is mapped in at
resolve time, and `npm run test:react19` runs it locally too. The
harness still asserts the loaded React (19.3.0) and scheduler (0.28) in
every worker.
- **What differs for 19.** React 19 has no legacy root and ships
`react-dom/client`, so the leg renders through `createRoot` as the
default suite does. `floors.js` records `legacyRoot: false`, which skips
three things that exist only for 16/17: the RTL `legacyRoot` patch, the
`ReactDOM.render` assertion and the `react-dom/client` stub.
- **CI.** The new `react-19` job replaces the `continue-on-error`
`react-19-advisory` job, which installed React 19 over the lock with
`--legacy-peer-deps`; the new job needs neither. No required checks are
configured on master today, so `react-19` gates exactly as
`react-16-floor` and `react-17` do. If branch protection ever named
`react-19-advisory`, it should name `react-19` now.
- **Types.** The published declarations compile against `@types/react`
19, with both the interop default import and the direct CommonJS import.
That matters because 19 removed the global `JSX` namespace. `gen-ts`
stays on the dev tree's 18; the plan's "pin `@types/react@19` for
`gen-ts`" item was written assuming the dev tree would move to 19, and
it does not.
## Docs
- README and the demo's docs page state the new range.
- The demo's changelog (Unreleased) says React 19 is supported and how
it is tested. It also records #129's change: the bundle imports
`react/jsx-runtime` from the host's React, which a host that aliases
`react` to one copy has to alias too. Two older Unreleased paragraphs
that said the range was not widened yet are updated, so the section does
not contradict itself.
- `CLAUDE.md` lists the three React legs.
- The plan closes §8's gate 4, the CI-coverage row, the `gen-ts` row,
the Appendix C "React 19 flip" checklist and §10's Phase 7 React 19
item.
## Gates
All exited 0:
- `lint:js`, `lint:css`, `typecheck`, `typecheck:contract`;
- `css:fixture:check`, `docs:props:check`, `docs:views:check`;
- `test:env-flags`, `test:types`, `test:coverage`, `build`;
- `test:pack`, `test:pack:peers` (16.14.0, 17.0.2, 19.3.0);
- `test:react16`, `test:react17`, `test:react19`, 2907 tests on each, as
on 18;
- `test:e2e`, 41 Playwright tests;
- the manifest contract.
Two first runs lost a jest worker to `SIGSEGV`, each killing one suite
before its tests ran: `test:react19` once and `test:react17` once. That
is the Node 24 V8 garbage-collector crash
([nodejs/node#62393](nodejs/node#62393)),
fixed on `v24.x-staging` but not in a release yet. Both passed 2907/2907
on rerun. CI runs Linux, where it has not been seen.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent 844e601 commit 5ede721
17 files changed
Lines changed: 206 additions & 98 deletions
File tree
- .github/workflows
- docs
- scripts
- fixtures
- react-legacy
- react19
- src/demo
- examples/__tests__
- markdowns
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
152 | | - | |
153 | | - | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| |||
272 | 273 | | |
273 | 274 | | |
274 | 275 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
279 | 285 | | |
280 | 286 | | |
281 | | - | |
282 | 287 | | |
283 | 288 | | |
284 | 289 | | |
| |||
293 | 298 | | |
294 | 299 | | |
295 | 300 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
| 301 | + | |
| 302 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | | - | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
55 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments