Skip to content

chore(deps): migrate to React 19 + @vitejs/plugin-react 6#18

Merged
andresdefi merged 1 commit into
mainfrom
chore/react-19
May 22, 2026
Merged

chore(deps): migrate to React 19 + @vitejs/plugin-react 6#18
andresdefi merged 1 commit into
mainfrom
chore/react-19

Conversation

@andresdefi
Copy link
Copy Markdown
Owner

Summary

Bumps react + react-dom to 19.2.6, @types/react + @types/react-dom to 19.2.x, and @vitejs/plugin-react to 6.0.2 (v6 dropped React 18 support, so it's gated on React 19).

Replaces Dependabot PRs #12 (incomplete — left react-dom at 18, version-major mismatch with react@19) and #14 (blocked on React 19).

Pre-flight verification

Confirmed every React-using dep supports React 19 by reading peer deps directly:

Package Version React peer dep
@tiptap/react 3.23.4 ^17 || ^18 || ^19
zustand 4.5.7 >=16.8 (open-ended)
modern-screenshot 4.7.0 none — DOM utility, React-agnostic

Migration changes (4 lines of code)

React 19 made RefObject<T> invariant in T and removed the global JSX namespace. Three small adjustments:

  • ColorPickerPopover.tsx — widened triggerRef from RefObject<HTMLElement> to RefObject<HTMLElement | null>. Now correctly accepts useRef<HTMLButtonElement>(null) from callers (ColorPicker, RichTextEditor).
  • Sidebar/Elements/RootView.tsximport type { JSX } from 'react'.
  • Sidebar/Elements/utils.ts — same JSX import.

Test plan

  • pnpm typecheck clean across all 3 packages
  • pnpm test — 534 / 534 passing
  • pnpm build succeeds
  • pnpm audit clean
  • Manual browser smoke test end-to-end:
    • Text editing (Tiptap on React 19)
    • Color picker open/close (exercises triggerRef fix)
    • Elements tab open (exercises JSX namespace import)
    • Canvas drag interactions
    • No warnings or errors in browser devtools console

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

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>
@andresdefi andresdefi merged commit f837e0e into main May 22, 2026
4 checks passed
@andresdefi andresdefi deleted the chore/react-19 branch May 22, 2026 14:15
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