Skip to content

chore(deps): upgrade react 18 -> 19#1273

Merged
mathuo merged 3 commits into
masterfrom
chore/upgrade-react
May 12, 2026
Merged

chore(deps): upgrade react 18 -> 19#1273
mathuo merged 3 commits into
masterfrom
chore/upgrade-react

Conversation

@mathuo
Copy link
Copy Markdown
Owner

@mathuo mathuo commented May 12, 2026

Summary

Bump React and React DOM from 18.3 to 19.2 in root devDependencies and the resolutions block. Types (@types/react, @types/react-dom) follow.

Consumer impact

Zero. Peer dep ranges on the publishable packages already allow ^19:

  • dockview / dockview-react: ^16.8 || ^17 || ^18 || ^19
  • dockview-vue: doesn't depend on React

Library users on React 18 keep working unchanged; users on React 19 get types that match.

Source changes

One test-only fix: packages/dockview/src/__tests__/dockview/defaultTab.spec.tsx imported act from react-dom/test-utils. That subpath was removed in React 19 — act now lives directly on react. Changed to import React, { act } from 'react'.

No production-source changes needed. Surveyed for the usual React 19 breakage:

  • ReactDOM.render / hydrate / unmountComponentAtNode — not used (we only use ReactDOM.createPortal in react.ts, unchanged in 19).
  • findDOMNode — not used.
  • defaultProps on function components — not used.
  • PropTypes — not used.
  • Legacy context, string refs, module-pattern factories — not used.
  • forwardRef still works in 19 (refs-as-props is additive); ReactComponentBridge and friends keep their existing shape.

Test plan

  • yarn install clean
  • yarn build — all 5 packages
  • yarn test — 1077 tests pass
  • yarn lint — 0 errors
  • Spot-check docs build (sandbox examples run against the resolved 19.x via root resolutions)

Not included

  • typescript 5.9 → 6.0 (blocked: ng-packagr@21 pins <6.0)
  • vite 7 → 8 (just released; staying on 7)
  • ag-grid 31 → 35 (legacy sandbox only; needs rewrite)
  • zone.js 0.15 → 0.16 (safe but Angular-territory; can do as a separate small PR)

🤖 Generated with Claude Code

mathuo and others added 3 commits May 12, 2026 20:00
Bump react, react-dom, @types/react, @types/react-dom in root
devDependencies and resolutions to 19.x.

dockview, dockview-react, and dockview-vue peer dep ranges already allow
^19, so no consumer-facing changes. Internal source compiles cleanly
against React 19 — only the React HOCs in packages/dockview/src/react.ts
needed sanity-checking and they remain valid (forwardRef is still
supported, createPortal unchanged).

One test-only source change: react-dom/test-utils was removed in React
19, so packages/dockview/src/__tests__/dockview/defaultTab.spec.tsx
now imports `act` from 'react' instead.

All 5 packages build, 1077 tests pass, lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ag-grid 31 doesn't support React 19 — its ResizeObserver hook calls
observer.observe(ref.current) before refs settle under React 19's
stricter effect timing, surfacing as "parameter 1 is not of type
'Element'" on the orders panel of the docs demo.

Bump ag-grid-community / ag-grid-react in packages/docs to ^35.3.0
(peer deps already permit React 19) and migrate the demo sandbox to
the v33+ JS Theming API: themeAlpine + colorSchemeDark replace the
old className-based theme switching, AllCommunityModule replaces the
narrower ClientSideRowModelModule registration, and the legacy
ag-grid.css / ag-theme-alpine.css imports are dropped from
custom.scss (the new API injects styles itself).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The earlier React 19 bump appeared clean only because tsc --build was
incremental and short-circuited via .build/tsconfig.tsbuildinfo.cjs.
A fresh build surfaces two real regressions from the new types:

1. useRef<T>() no longer compiles — React 19's signature requires an
   explicit initial value. The four xxxRef hooks (dockview, gridview,
   splitview, paneview) now declare `useRef<Api | undefined>(undefined)`
   so the later `ref.current = undefined` cleanup also typechecks.

2. FunctionComponent<P> is now invariant in P, which makes ReactPart<P>
   invariant via its `component: FunctionComponent<P>` field. Inference
   from the constructor's parameters argument produced a too-narrow P
   (e.g. `location: DockviewGroupLocation` vs the interface's optional
   `location?: ...`) that no longer assigns to the declared field type.
   Fixed by passing the target props interface as an explicit type
   argument to `new ReactPart<...>(...)` in the four affected sites:
   headerActionsRenderer, reactWatermarkPart, paneview/view,
   splitview/view.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@mathuo mathuo merged commit d648cb4 into master May 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant