feat!: align core, demo, and CLI template on React 19 (#319)#369
feat!: align core, demo, and CLI template on React 19 (#319)#369thedavidweng wants to merge 4 commits into
Conversation
Upgrade react/react-dom and matching types to 19.2.x across core, demo, and the generated template. Update RefObject typings for the React 19 nullability contract. Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
React 19 widens HTMLImageElement src to include Blob, which is incompatible with Next/fumadocs ImageProps. Keep string sources only for ImageZoom. Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
|
@thedavidweng is attempting to deploy a commit to the open-slide Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughReact dependencies and type packages are upgraded to React 19 across the demo, core package, and CLI template. Related ref contracts now allow nullable targets, and MDX image mappings normalize ChangesReact 19 alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/template/package.json`:
- Around line 14-19: Revert the dependency changes in the CLI template
package.json, restoring the file to its prior state; do not modify this excluded
template file unless repository instructions are explicitly updated.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 18c39da4-5040-4131-8a88-111c19ad6eb6
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (9)
.changeset/react-19-alignment.mdapps/demo/package.jsonapps/web/components/mdx.tsxpackages/cli/template/package.jsonpackages/core/package.jsonpackages/core/src/app/components/inspector/inspect-overlay.tsxpackages/core/src/app/lib/use-click-page-navigation.tspackages/core/src/app/lib/use-wheel-page-navigation.tspackages/core/src/app/routes/slide.tsx
| "react": "^19.2.7", | ||
| "react-dom": "^19.2.7" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/react": "^18.3.12", | ||
| "@types/react-dom": "^18.3.1", | ||
| "@types/react": "^19.2.14", | ||
| "@types/react-dom": "^19.2.3", |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
Do not modify the CLI template package.json.
packages/cli/template/package.json is explicitly excluded by the path instructions. Revert this file’s changes or obtain an updated repository instruction before proceeding.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/cli/template/package.json` around lines 14 - 19, Revert the
dependency changes in the CLI template package.json, restoring the file to its
prior state; do not modify this excluded template file unless repository
instructions are explicitly updated.
Source: Path instructions
|
Addressed CodeRabbit review: Template The |
Issue reference
Implements #319 (roadmap #318).
This PR is independent of #317 — it branches directly from
mainand contains only the React 19 alignment changes. It can be reviewed and merged on its own; the Node 24 baseline (#317 / #326) is orthogonal.Exact scope
React 19 alignment only:
react/react-dom→^19.2.7inpackages/core,apps/demo,packages/cli/template@types/react/@types/react-dom→ React 19 types (aligned withapps/web)main)RefObjectnullabilityOut of scope: Vite, Oxlint, TypeScript major, Turbo/Vitest/tsdown, unrelated deps, React Compiler.
Versions before and after
packages/corereact/react-dom^18.3.1^19.2.7packages/core@types/react^18.3.12^19.2.14packages/core@types/react-dom^18.3.1^19.2.3apps/demoReact + typespackages/cli/templateReact + typesapps/web^19.2.7Resolved install: single
react@19.2.7/react-dom@19.2.7across core, demo, and web. No React 18 direct dependency remains.Why the old state was a problem
The repo tested and shipped two React majors: website on 19, framework + generated workspaces on 18. That split meant the website did not validate the runtime users receive, generated projects started behind, and React 19 type/runtime contracts were delayed.
This is runtime consistency / active support, not a confirmed React 18 security advisory claim.
Why these versions were chosen
apps/web).use-sync-external-storeall already accept React 19 — no forced peer upgrades required in this PR.Breaking changes reviewed
RefObject<T>now effectively includes| nullcurrent; call sites updated.Official guide items reviewed with no first-party hits requiring API rewrites:
ReactDOM.render/findDOMNodecreateRootalready useduseSyncExternalStorelocale store unchangedSource changes required
packages/core/package.jsonapps/demo/package.jsonpackages/cli/template/package.jsoninspect-overlay.tsxRefObject<HTMLDivElement | null>slide.tsxRefObject<HTMLElement | null>for viewport navuse-click-page-navigation.tsRefObject<T | null>use-wheel-page-navigation.tsRefObject<T | null>apps/web/components/mdx.tsxImageZoomsrctostring | undefinedfor React 19 img typespnpm-lock.yaml.changeset/react-19-alignment.mdTests added or changed
None required. Existing suite: 305 passed.
Benchmark results
Not a performance PR. Bundle observation (demo production main chunk):
index-*.js)@open-slide/core@open-slide/cliNo percentage runtime improvement claimed.
Manual validation results
On Node 24.18.0 with pnpm 10.17.0 (current
maintoolchain):pnpm install✅pnpm format:check/pnpm lint/pnpm typecheck/pnpm test(305 passed) /pnpm build✅pnpm list react react-dom -r --depth 0→ only19.2.7✅Known limitations
use-sync-external-storeretained intentionally (Base UI / shim prebundle path); removal belongs only after Vite 8 + graph proof (chore(core): migrate Vite 5 to Vite 8 and remove deprecated esbuild compatibility paths #320/chore(deps): upgrade remaining runtime and application dependencies with evidence-based compatibility checks #323).Prohibited workarounds — confirmation
Not used:
--force,--legacy-peer-deps, overrides/resolutions/aliases,patch-package, blanketany/unknown, blanket lint/TS suppressions, prereleases, unrelated UI/features, silent snapshot updates.Summary by CodeRabbit
New Features
Bug Fixes
Chores