chore(deps): upgrade react 18 -> 19#1273
Merged
Merged
Conversation
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>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Bump React and React DOM from 18.3 to 19.2 in root devDependencies and the
resolutionsblock. 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 || ^19dockview-vue: doesn't depend on ReactLibrary 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.tsximportedactfromreact-dom/test-utils. That subpath was removed in React 19 —actnow lives directly onreact. Changed toimport React, { act } from 'react'.No production-source changes needed. Surveyed for the usual React 19 breakage:
ReactDOM.render/hydrate/unmountComponentAtNode— not used (we only useReactDOM.createPortalinreact.ts, unchanged in 19).findDOMNode— not used.defaultPropson function components — not used.PropTypes— not used.forwardRefstill works in 19 (refs-as-props is additive);ReactComponentBridgeand friends keep their existing shape.Test plan
yarn installcleanyarn build— all 5 packagesyarn test— 1077 tests passyarn lint— 0 errorsNot included
typescript5.9 → 6.0 (blocked:ng-packagr@21pins<6.0)vite7 → 8 (just released; staying on 7)ag-grid31 → 35 (legacy sandbox only; needs rewrite)zone.js0.15 → 0.16 (safe but Angular-territory; can do as a separate small PR)🤖 Generated with Claude Code