Skip to content

feat!: align core, demo, and CLI template on React 19 (#319)#369

Open
thedavidweng wants to merge 4 commits into
1weiho:mainfrom
thedavidweng:react-19-alignment-21be
Open

feat!: align core, demo, and CLI template on React 19 (#319)#369
thedavidweng wants to merge 4 commits into
1weiho:mainfrom
thedavidweng:react-19-alignment-21be

Conversation

@thedavidweng

@thedavidweng thedavidweng commented Jul 26, 2026

Copy link
Copy Markdown

Issue reference

Implements #319 (roadmap #318).

This PR is independent of #317 — it branches directly from main and 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.7 in packages/core, apps/demo, packages/cli/template
  • @types/react / @types/react-dom → React 19 types (aligned with apps/web)
  • lockfile (regenerated against current main)
  • TypeScript fixes required by React 19 RefObject nullability
  • changesets

Out of scope: Vite, Oxlint, TypeScript major, Turbo/Vitest/tsdown, unrelated deps, React Compiler.

Versions before and after

Package / workspace Before After
packages/core react / react-dom ^18.3.1 ^19.2.7
packages/core @types/react ^18.3.12 ^19.2.14
packages/core @types/react-dom ^18.3.1 ^19.2.3
apps/demo React + types React 18.3.x React 19.2.x (same as core)
packages/cli/template React + types React 18.3.x React 19.2.x (same as core)
apps/web already ^19.2.7 unchanged

Resolved install: single react@19.2.7 / react-dom@19.2.7 across 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

  • Latest stable React 19 minor at implementation time: 19.2.7 (matches apps/web).
  • Types aligned with the website's proven React 19 type packages.
  • Direct dependency peer audit: Base UI, dnd-kit, next-themes, sonner, emoji-picker-react, react-image-crop, react-router-dom, lucide-react, and use-sync-external-store all already accept React 19 — no forced peer upgrades required in this PR.

Breaking changes reviewed

  • Published runtime now depends on React 19. Consumers still on React 18 must upgrade (major changeset).
  • CLI template scaffolds React 19 workspaces.
  • TypeScript: RefObject<T> now effectively includes | null current; call sites updated.

Official guide items reviewed with no first-party hits requiring API rewrites:

  • no string refs / legacy context / ReactDOM.render / findDOMNode
  • no ref callbacks that implicitly return values
  • createRoot already used
  • portals via Base UI; useSyncExternalStore locale store unchanged

Source changes required

File Change
packages/core/package.json React 19 + types
apps/demo/package.json React 19 + types
packages/cli/template/package.json React 19 + types
inspect-overlay.tsx RefObject<HTMLDivElement | null>
slide.tsx RefObject<HTMLElement | null> for viewport nav
use-click-page-navigation.ts accept RefObject<T | null>
use-wheel-page-navigation.ts accept RefObject<T | null>
apps/web/components/mdx.tsx narrow ImageZoom src to string | undefined for React 19 img types
pnpm-lock.yaml React 19 resolution (regenerated against current main)
.changeset/react-19-alignment.md major for core + cli

Tests added or changed

None required. Existing suite: 305 passed.

Benchmark results

Not a performance PR. Bundle observation (demo production main chunk):

Metric Before (React 18) After (React 19) Change
demo main JS (index-*.js) 1,160.81 kB / gzip 342.90 kB 1,212.23 kB / gzip 357.93 kB +51.4 kB (+15 kB gzip)
packed @open-slide/core 272.9 kB 272.9 kB none
packed @open-slide/cli 53.1 kB 53.1 kB none

No percentage runtime improvement claimed.

Manual validation results

On Node 24.18.0 with pnpm 10.17.0 (current main toolchain):

  • pnpm install
  • pnpm format:check / pnpm lint / pnpm typecheck / pnpm test (305 passed) / pnpm build
  • pnpm list react react-dom -r --depth 0 → only 19.2.7

Known limitations

  1. Interactive browser smoke of present mode / crop / emoji / DnD was not run locally; automated build+test cover compile and unit behavior.
  2. use-sync-external-store retained 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, blanket any/unknown, blanket lint/TS suppressions, prereleases, unrelated UI/features, silent snapshot updates.

Summary by CodeRabbit

  • New Features

    • Updated the runtime and generated workspaces to support React 19.
  • Bug Fixes

    • Improved handling of nullable refs in navigation and overlay interactions.
    • Normalized image sources in MDX content to improve image zoom behavior.
  • Chores

    • Updated React and TypeScript React type definitions across the demo, core package, and workspace template.

cursoragent and others added 3 commits July 25, 2026 23:07
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>
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@thedavidweng is attempting to deploy a commit to the open-slide Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

React 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 src before rendering.

Changes

React 19 alignment

Layer / File(s) Summary
Runtime and release alignment
.changeset/..., apps/demo/package.json, packages/core/package.json, packages/cli/template/package.json
React runtime and type dependencies are updated to React 19, and the changeset marks major releases while requiring React 19.
Nullable ref contracts
packages/core/src/app/components/inspector/inspect-overlay.tsx, packages/core/src/app/lib/*, packages/core/src/app/routes/slide.tsx
Component and navigation ref types accept nullable targets.
MDX image normalization
apps/web/components/mdx.tsx
The MDX img mapping conditionally forwards a string src to ImageZoom.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

Poem

A bunny bumps React to nineteen,
With nullable refs tucked in between.
Images hop through with sources made right,
Workspaces bloom in a newer light.
“Compile clean!” sings the rabbit tonight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: aligning core, demo, and CLI template with React 19.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c408ba0 and 61227b6.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (9)
  • .changeset/react-19-alignment.md
  • apps/demo/package.json
  • apps/web/components/mdx.tsx
  • packages/cli/template/package.json
  • packages/core/package.json
  • packages/core/src/app/components/inspector/inspect-overlay.tsx
  • packages/core/src/app/lib/use-click-page-navigation.ts
  • packages/core/src/app/lib/use-wheel-page-navigation.ts
  • packages/core/src/app/routes/slide.tsx

Comment on lines +14 to +19
"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",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 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

@thedavidweng

Copy link
Copy Markdown
Author

Addressed CodeRabbit review:

Template package.json dependency changes (intentional, not reverted): The CLI template must ship React 19 types and react/react-dom 19 to match the runtime. @open-slide/core lists react as a regular dependency (not a peer), so if the template stayed on React 18, newly generated projects would resolve two React copies at runtime. This alignment is the core ask of #319. The template package.json path restriction in the repo rules applies to slide-authoring agents editing generated projects — it does not prohibit framework-level upgrades to the template manifest itself.

The @open-slide/core: ^0.0.6 range in the template is pre-existing on main and out of scope for this PR (separate versioning concern).

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.

2 participants