chore(deps): migrate to React 19 + @vitejs/plugin-react 6#18
Merged
Conversation
Bumps react + react-dom to 19.2.6 (was 18.3.1), @types/react to 19.2.x, @types/react-dom to 19.2.x, and @vitejs/plugin-react to 6.0.2 (was 4.7; v6 dropped React 18 support so this bump is gated on React 19). Replaces Dependabot PR #12 (which left react-dom at 18 — version-major mismatch with react@19 — Dependabot grouping bug) and PR #14 (blocked on React 19). Verified peer-dep coverage before migrating: - @tiptap/react 3.23.4 declares react ^17 || ^18 || ^19 - zustand 4.5.7 declares react >=16.8 (open-ended) - modern-screenshot has no React peer dep (DOM utility) - @vitejs/plugin-react v4 had no React peer dep at all Three small code changes the React 19 type changes required: - ColorPickerPopover triggerRef widened from `RefObject<HTMLElement>` to `RefObject<HTMLElement | null>`. React 19 made `RefObject<T>` invariant in T, so the callers (ColorPicker, RichTextEditor) that pass `useRef<HTMLButtonElement>(null)` no longer narrow. - src/client/components/Sidebar/Elements/RootView.tsx adds `import type { JSX } from 'react'`. The global JSX namespace was removed in React 19's types. - Same JSX import added to Sidebar/Elements/utils.ts. Verified locally: - pnpm typecheck clean across all 3 packages - pnpm test 534/534 passing - pnpm build succeeds (web-preview bundle ~10% larger from React 19's runtime baseline, expected) - pnpm audit clean - Manual browser smoke test: text editing, color picker (exercises triggerRef fix), Elements tab (exercises JSX import fix), drag interactions — no warnings or errors in devtools. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
929153c to
a22a4be
Compare
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
Bumps
react+react-domto 19.2.6,@types/react+@types/react-domto 19.2.x, and@vitejs/plugin-reactto 6.0.2 (v6 dropped React 18 support, so it's gated on React 19).Replaces Dependabot PRs #12 (incomplete — left
react-domat 18, version-major mismatch withreact@19) and #14 (blocked on React 19).Pre-flight verification
Confirmed every React-using dep supports React 19 by reading peer deps directly:
@tiptap/react^17 || ^18 || ^19zustand>=16.8(open-ended)modern-screenshotMigration changes (4 lines of code)
React 19 made
RefObject<T>invariant inTand removed the globalJSXnamespace. Three small adjustments:ColorPickerPopover.tsx— widenedtriggerReffromRefObject<HTMLElement>toRefObject<HTMLElement | null>. Now correctly acceptsuseRef<HTMLButtonElement>(null)from callers (ColorPicker, RichTextEditor).Sidebar/Elements/RootView.tsx—import type { JSX } from 'react'.Sidebar/Elements/utils.ts— same JSX import.Test plan
pnpm typecheckclean across all 3 packagespnpm test— 534 / 534 passingpnpm buildsucceedspnpm auditcleantriggerReffix)Bundle size
Client bundle ~10% larger from React 19's runtime baseline (367 KB → 410 KB gzipped before/after). Expected; React 19 ships some new infrastructure even when its compiler isn't enabled.
🤖 Generated with Claude Code