Skip to content

Commit 5ede721

Browse files
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/ci.yml‎

Lines changed: 19 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090
- name: Smoke the packed tarball
9191
run: npm run test:pack:consumer
9292

93-
# The step above only ever sees the React the lockfile installs, so the declared 16.14 and 17 ends of
93+
# The step above only ever sees the React the lockfile installs, so the declared 16.14, 17 and 19 ends of
9494
# peerDependencies had no runtime coverage at all. This re-runs the same smoke against React installed
9595
# into a throwaway directory — the repository's own node_modules is never touched. It checks the
9696
# published artifact, which is what a peer range is a claim about; it is not a substitute for running
@@ -114,9 +114,10 @@ jobs:
114114
# `verify` job above only ever exercises 18; `test:pack:peers` proves the published artifact server-renders
115115
# on 16 and 17, which is narrower than running the suite. This runs the whole suite on React 16.14.
116116
#
117-
# No `--legacy-peer-deps` here, unlike `react-19-advisory` below: React 16.14 comes from an install-only
118-
# fixture package (`scripts/fixtures/react16-floor`, linked as the `react-16-floor` devDependency), so npm
119-
# nests it instead of competing for the hoisted `node_modules/react` slot and plain `npm ci` installs it.
117+
# No `--legacy-peer-deps` here, as in the other fixture legs (the React 19 one used to need it): React
118+
# 16.14 comes from an install-only fixture package (`scripts/fixtures/react16-floor`, linked as the
119+
# `react-16-floor` devDependency), so npm nests it instead of competing for the hoisted
120+
# `node_modules/react` slot and plain `npm ci` installs it.
120121
# Aliased devDependencies -- the trick `react-types-16` uses -- cannot work for a runtime package, because
121122
# `[email protected]` peer-requires `react` and npm resolves that against the hoisted copy React 18 owns.
122123
#
@@ -148,9 +149,9 @@ jobs:
148149
- name: Test on the React 16.14 peer floor
149150
run: npm run test:react16
150151

151-
# Gating, and the other half of the peer matrix: `peerDependencies` declares `^16.14 || ^17 || ^18`, and
152-
# with this leg every one of the three ends runs the whole suite (18 in `verify`, 16.14 above, 17 here)
153-
# rather than only the packed-artifact smoke `test:pack:peers` gives 17. Same shape as `react-16-floor`:
152+
# Gating, and the other half of the peer matrix: `peerDependencies` declares `^16.14 || ^17 || ^18 || ^19`,
153+
# and with this leg and `react-19` every one of the four runs the whole suite (18 in `verify`, 16.14 above,
154+
# 17 here, 19 below) rather than only the packed-artifact smoke `test:pack:peers` gives 17. Same shape as `react-16-floor`:
154155
# React 17.0.2 comes from an install-only fixture package (`scripts/fixtures/react17-floor`, linked as the
155156
# `react-17-floor` devDependency), so plain `npm ci` installs it and no `--legacy-peer-deps` is needed.
156157
# 17 needs the fixture even more than 16 does: [email protected] peer-requires `react` at the EXACT version,
@@ -272,13 +273,17 @@ jobs:
272273
path: playwright-report/
273274
retention-days: 7
274275

275-
# Advisory only — React 19 is NOT declared in peerDependencies (see docs/UPGRADE-PLAN.md §8).
276-
# Purpose: make upstream drift visible on every PR without gating it, so the 19 flip is a
277-
# measurement rather than a discovery. `continue-on-error: true` keeps a red leg off the merge path.
278-
react-19-advisory:
276+
# Gating since 2026-09-30, when React 19 joined `peerDependencies` (docs/UPGRADE-PLAN.md §8), and the top of
277+
# the peer matrix: 16.14 and 17 below the installed 18, 19 above it. Until then this was
278+
# `react-19-advisory`, a `continue-on-error` job that installed React 19 over the lock with
279+
# `--legacy-peer-deps`. It is now a fixture leg like `react-16-floor` and `react-17`: React 19.3.0 comes from
280+
# `scripts/fixtures/react19` (the `react-19` devDependency), so plain `npm ci` installs it, no flag is
281+
# needed, and `npm run test:react19` runs the same leg locally. The same two-level self-check applies.
282+
# Unlike the older two, this leg renders through createRoot, not the legacy root: React 19 removed it
283+
# (scripts/fixtures/react-legacy/floors.js). Its own job, like `react-17`, for the reason given there.
284+
react-19:
279285
runs-on: ubuntu-latest
280286
timeout-minutes: 20
281-
continue-on-error: true
282287

283288
steps:
284289
- name: Checkout repository
@@ -293,26 +298,5 @@ jobs:
293298
- name: Install dependencies
294299
run: npm ci
295300

296-
# `--legacy-peer-deps` is deliberate, not carelessness: installed packages still declare a
297-
# `react ^16.8.0 || ^17.0.0 || ^18.0.0` peer, so npm would abort this install with ERESOLVE.
298-
# 1. react-final-form 6.5.9 (19-ready line is 7.0.1 — §9.7-F4)
299-
# 2. react-final-form-arrays 3.1.4 (19-ready line is 5.0.0 — same §9.7-F4 bump)
300-
# There were THREE. `semantic-ui-react` was the third, and §9.7-F1 step 3½ removed it — which
301-
# is the whole point of that step: the dependency ENTRY is what caps a host's React, not the
302-
# bundled code (§2.6-11). Corrected 2026-09-17: this comment used to say "One cap left" and
303-
# list only react-final-form. It was wrong — react-final-form-arrays carries the identical cap,
304-
# so the flag is needed for it too, and the §9.7-F4 bump has to move both packages together.
305-
#
306-
# Updated 2026-09-22: both are now devDependencies, not dependencies (§2.6-11 — they are
307-
# bundled, so a consumer was installing copies it never loaded). THE FLAG IS STILL NEEDED HERE,
308-
# because this job installs React 19 over the DEV tree, where they are still present. What
309-
# changed is who else sees the cap: nobody. A consumer no longer inherits it, and the only
310-
# React ceiling they meet is the one we declare ourselves in peerDependencies — which still
311-
# says ^18, so nothing about React 19 support moved. The flag overrides the peer check for this
312-
# throwaway install only and never touches what we declare to consumers.
313-
# `--no-save` leaves package.json alone.
314-
- name: Install React 19 over the lock
315-
run: npm install --no-save --legacy-peer-deps react@19 react-dom@19
316-
317-
- name: Test on React 19
318-
run: npx jest
301+
- name: Test on React 19.3.0
302+
run: npm run test:react19

‎CLAUDE.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ The modernization roadmap (React 17/18 upgrade, `semantic-ui-react` exit, projec
1717
- `npm run yalc-publish` — Build lib and publish locally via yalc (for testing in consuming apps)
1818
- `npm run yalc-watch` — Auto-rebuild and yalc-publish on src changes
1919
- `npm run deploy` — Deploy demo to GitHub Pages (run `build` first)
20-
- `npm test` — Run Jest tests
20+
- `npm test` — Run Jest tests (on the installed React 18)
21+
- `npm run test:react16` / `test:react17` / `test:react19` — The same suite on React 16.14, 17.0.2 and 19.3.0, each from an install-only fixture package (`scripts/fixtures/react16-floor`, `react17-floor`, `react19`). Never run these configs with bare `jest`; the harness asserts the React it loaded.
2122
- `npm run test:watch` — Run Jest in watch mode
2223
- `npm run build-css` — Standalone CSS build (LESS → PostCSS prefixwrap → CSS)
2324
- `npm run test:env-flags` — Compiles the source with each real webpack config (library, demo dev/prod, the e2e shape) and checks the env flags and `FILE.PATH_IMAGES` each ships, in a realm with no `process`. jest cannot see these: it runs the source against Node's real `process.env`. `_envs.ts` reads `process.env.NODE_ENV`/`REACT_APP_HOMEPAGE` as literals on purpose — never reintroduce `ENV.NODE_ENV` or a `typeof process` guard in front of them
@@ -84,7 +85,7 @@ Examples live in `src/demo/examples/` (e.g., `example_meta.json` / `example_data
8485

8586
## Tech Stack
8687

87-
- React 16 (peer dependency). **No Semantic UI at all**: the components went in-house at §9.7-F1 steps 1-3 and the CSS at step 4, where the two modules still in use were compiled into `src/style/vendor/` and the package removed. Components still emit Semantic's class tokens (`ui selection dropdown`, `ui table`) because the vendored CSS selects on them.
88+
- React `^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0` (peer dependency); development and the default suite run on 18.3, and each of the other three has its own gating CI leg. **No Semantic UI at all**: the components went in-house at §9.7-F1 steps 1-3 and the CSS at step 4, where the two modules still in use were compiled into `src/style/vendor/` and the package removed. Components still emit Semantic's class tokens (`ui selection dropdown`, `ui table`) because the vendored CSS selects on them.
8889
- react-final-form for form state management
8990
- moment for dates (peer dependency, externalized); charts are custom SVG (`src/core/components/charts/` — no recharts)
9091
- TypeScript is wired up but the source is still JavaScript: `@babel/preset-typescript` compiles

‎README.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ must be supplied by the host because the library build externalizes it.
3333

3434
| Package | Required version | Why it must be a peer |
3535
|---|---|---|
36-
| `react` | `^16.14.0 \|\| ^17.0.0 \|\| ^18.0.0` | A second copy of React in the tree triggers `Invalid hook call` and breaks Context (forms, providers). pnpm with strict node_modules will not deduplicate copies across non-overlapping ranges. |
37-
| `react-dom` | `^16.14.0 \|\| ^17.0.0 \|\| ^18.0.0` | Must use the same major version as `react` so the renderer pair matches. |
36+
| `react` | `^16.14.0 \|\| ^17.0.0 \|\| ^18.0.0 \|\| ^19.0.0` | A second copy of React in the tree triggers `Invalid hook call` and breaks Context (forms, providers). pnpm with strict node_modules will not deduplicate copies across non-overlapping ranges. |
37+
| `react-dom` | `^16.14.0 \|\| ^17.0.0 \|\| ^18.0.0 \|\| ^19.0.0` | Must use the same major version as `react` so the renderer pair matches. |
3838
| `moment` | `^2.29.4` | The library externalizes Moment and uses it for date pickers and formatters, so the host must provide a compatible 2.x version. |
3939

4040
Install (npm):
@@ -50,9 +50,9 @@ peer dependencies are **not installed automatically**, so they must be listed ex
5050
pnpm add eis-ui-render react@^18.0.0 react-dom@^18.0.0 moment@^2.29.4
5151
```
5252

53-
React 16.14 and 17 hosts remain supported and may keep matching `react@^16.14.0` or `react@^17.0.0`
54-
dependencies while migrating on their own schedule. The library is developed and tested against
55-
React 18.3.
53+
React 16.14, 17 and 19 hosts are supported as well, and may keep matching `react@^16.14.0`,
54+
`react@^17.0.0` or `react@^19.0.0` dependencies. The library is developed against React 18.3, and the
55+
whole test suite runs on 16.14, 17, 18 and 19 in CI.
5656

5757
If the host project relies on transitive copies of `react`/`react-dom`/`moment` from another
5858
package instead of declaring them directly, pnpm in isolated mode will not resolve our peer

0 commit comments

Comments
 (0)