Skip to content

feat: support React 19 - #39

Merged
taochu merged 8 commits into
mainfrom
react19-upgrade
Jun 13, 2026
Merged

feat: support React 19#39
taochu merged 8 commits into
mainfrom
react19-upgrade

Conversation

@taochu

@taochu taochu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Widen react / react-dom / react-is peer ranges to include ^19.0.0
  • Replace global JSX.Element with React.ReactElement in index.d.ts and the committed types/ artifacts; add JSDoc @returns annotations so yarn build-types emits React.ReactElement permanently instead of regressing on rebuild (React 19 upgrade guide: The JSX namespace in TypeScript)
  • Guard Toaster against the removed ReactDOM.render — the fallback only runs where it exists; otherwise the original react-dom/client error surfaces (React 19 upgrade guide: Removed ReactDOM.render)
  • Bump @maestroqa/ui-box to ^5.8.0 (React 19 Box.defaultProps fix, feat: support React 19 mqa-ui-box#29) and rebuild commonjs/ / esm/ / types/ (React 19 upgrade guide: Removed propTypes and defaultProps)
  • Pin @types/react to ^18.3.0 via resolutions so ui-box 5.8.0's React.JSX typings resolve in this repo's toolchain (under @types/react 17 they silently degrade to any, defeating tsd — this is what the earlier CI failure was)
  • Retype _Pane against the concrete 'div' default, removing the @ts-expect-error on the Box spread; public signature and emitted Pane.d.ts unchanged

Note: types/layers/src/Pane.d.ts references React.JSX.IntrinsicElements, raising the floor for typed consumers to @types/react ≥ 18.2.21.

Validation

Tested end-to-end in the analytics app on React 19.2.7 (branch consuming this PR's head by git SHA, with the app's global-JSX shim and peer-rule workarounds removed):

  • lint:types passes; strict-mode failures are pre-existing app issues, none referencing evergreen/ui-box
  • In-browser: login flow, workspace page, Dialog, SideSheet/Overlay transitions (the nodeRef/findDOMNode path), Tooltips, and Toaster (React 19 createRoot path) all work with zero console errors
  • All 3,346 ui-box-rendered elements on the workspace page compute box-sizing: border-box, confirming the ui-box 5.8.0 defaultProps fix end-to-end

Release

After merge: npm version minor (→ 7.7.0) and git push --tags.

cursoragent and others added 3 commits June 11, 2026 11:36
- Widen react / react-dom / react-is peer ranges to include ^19.0.0
- Replace global `JSX.Element` references with `React.ReactElement` in the
  hand-written index.d.ts, the committed types/ build artifacts, and
  src/layers/src/Pane.tsx. React 19's typings removed the global JSX
  namespace, so these references stopped resolving (degrading the affected
  types to `any`) for consumers on @types/react 19. `React.ReactElement`
  is equivalent here and resolves under @types/react 17, 18, and 19, so the
  package keeps working with the repo's current toolchain.

Runtime is already React 19-compatible: every react-transition-group
usage (Overlay, Positioner, Toast, CornerDialog) passes nodeRef, so the
removed findDOMNode fallback is never hit.
react-dom 19 no longer exports render, so the catch branch in the
createRoot path would crash with 'undefined is not a function' in
environments where require('react-dom/client') throws (e.g. native ESM
consuming the esm build). Only fall back when render actually exists;
otherwise surface the original error.
Requires the ui-box release containing the React 19 `Box.defaultProps`
fix (adtribute/mqa-ui-box#29) so consumers can't resolve 5.7.0, which
loses box-sizing: border-box under React 19.
@taochu

taochu commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Blocked by adtribute/mqa-ui-box#29.

This branch pins @maestroqa/ui-box@^5.8.0, which doesn't exist on npm yet — yarn install (and therefore yarn build) will fail until the ui-box PR is merged and released as 5.8.0 (yarn release; ui-box resolves from the npm registry, not GitHub).

Order of operations:

  1. Merge ui-box Create dependabot.yml #29, release as 5.8.0
  2. Here: yarn install (refreshes yarn.lock), yarn build (regenerates the committed commonjs/ / esm/ / types/), then merge and tag per the usual release flow

@taochu taochu added the on hold Pull requests that need to wait for some other tasks label Jun 11, 2026
taochu added 5 commits June 12, 2026 12:35
ui-box 5.8.0's React.JSX typings make the Box spread type-check, so
the suppression itself became a TS2578 build error.
…ment`

tsc infers the global JSX.Element for JSX-returning .js sources, which
no longer resolves under @types/react 19. Explicit @returns annotations
make yarn build-types emit React.ReactElement, so the committed types/
artifacts stop regressing on every rebuild.
Lockfile picks up the published 5.8.0 (React 19 Box.defaultProps fix);
commonjs/, esm/, and types/ rebuilt from the updated source.
ui-box 5.8.0 uses React.JSX.*, which doesn't exist in @types/react 17
(the lockfile's previous resolution for @types/react@*). Under
skipLibCheck the Box types silently degraded to any in this repo's own
toolchain — tsd's expectError assertions stopped erroring (CI failure)
and Pane's @ts-expect-error looked stale (restored here). Pinning the
resolution to ^18.3.0 matches the dev react 18.2 and makes the types
real again; commonjs/esm/types rebuilt with the 18 emissions.
Type _Pane against the concrete 'div' default instead of an open
generic. TS can't prove assignability of spread props into Box's
polymorphic props for an unresolved type parameter (deferred
LibraryManagedAttributes), which is all the suppression was hiding.
The public polymorphic signature is unchanged — it was already applied
by the cast on the memo(forwardRef(...)) export, and the emitted
types/layers/src/Pane.d.ts is byte-identical.
@taochu

taochu commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Unblocked@maestroqa/ui-box@5.8.0 (adtribute/mqa-ui-box#29) is published on npm and this branch now resolves it (the earlier "Blocked by" comment is obsolete). End-to-end validation against the analytics app on React 19.2.7 is documented in the updated PR description; everything passed. Ready for review/merge.

@taochu taochu added ready for review Pull requests that are ready for review and removed on hold Pull requests that need to wait for some other tasks labels Jun 13, 2026
@taochu
taochu requested review from harrisonhunter and suzmas June 13, 2026 03:55
@taochu
taochu merged commit 0061d17 into main Jun 13, 2026
4 checks passed
@taochu
taochu deleted the react19-upgrade branch June 13, 2026 04:30
@taochu taochu mentioned this pull request Jun 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants