chore: upgrade TypeScript 6, Vitest 4, tsdown 0.21, Turbo 2.10 (#322) - #372
chore: upgrade TypeScript 6, Vitest 4, tsdown 0.21, Turbo 2.10 (#322)#372thedavidweng wants to merge 9 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>
Upgrade vite to 8.1.4 and @vitejs/plugin-react to 6.x. Replace deprecated optimizeDeps.esbuildOptions with optimizeDeps.rolldownOptions for virtual module exclusion. Fix website MDX ImageZoom typing exposed by the lockfile update. Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
Unify all workspaces on TypeScript 6.0.3. Move Vitest to 4.1.10 (Vite 8 peer), tsdown to 0.21.10 (newest release compatible with Node 22.13+), and Turbo to 2.10.5. Keep .js/.d.ts output via fixedExtension: false and retarget package builds to node22. Co-authored-by: Davy <thedavidweng@users.noreply.github.com>
… regenerate lockfile
|
@thedavidweng is attempting to deploy a commit to the open-slide Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe PR aligns the monorepo with React 19, Vite 8, TypeScript 6, Vitest 4, and tsdown 0.21; migrates virtual-module optimization to Rolldown; updates Node 22 builds; and widens several React ref types to allow null. ChangesToolchain and runtime alignment
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ViteConfig
participant Rolldown
participant VirtualModuleResolver
ViteConfig->>Rolldown: configure optimizeDeps.rolldownOptions
Rolldown->>VirtualModuleResolver: resolveId virtual:open-slide/*
VirtualModuleResolver-->>Rolldown: mark matching module external
Possibly related issues
Possibly related PRs
Suggested reviewers: 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: 2
🤖 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 @.changeset/vite-8-migration.md:
- Line 6: Update the changeset description to a short, direct, present-tense
statement describing the user-facing Vite 8 and native Rolldown optimizer
migration.
In `@packages/cli/template/package.json`:
- Around line 14-20: Revert the dependency changes in the CLI template manifest
and leave packages/cli/template/package.json untouched. If the dependency update
is required, apply it at the appropriate source outside the excluded template
manifest, preserving the path restriction for template package.json and
open-slide.config.ts files.
🪄 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: 117649f2-9285-4508-8bec-17ea7f269add
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (19)
.changeset/react-19-alignment.md.changeset/typescript-vitest-tsdown-turbo.md.changeset/vite-8-migration.mdapps/demo/package.jsonapps/web/components/mdx.tsxapps/web/package.jsonpackage.jsonpackages/cli/package.jsonpackages/cli/template/package.jsonpackages/cli/tsdown.config.tspackages/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.tsxpackages/core/src/vite/config.test.tspackages/core/src/vite/config.tspackages/core/tsconfig.jsonpackages/core/tsdown.config.ts
💤 Files with no reviewable changes (1)
- packages/core/tsconfig.json
|
Addressed CodeRabbit review: Fixed: Tightened the Template |
Issue
Implements #322 (parent #318).
Stacking note — please read
This PR depends on #370 (Vite 8 migration) and #369 (React 19 alignment). Vitest 4 peers
vite: ^6 || ^7 || ^8, so it requires the Vite 8 base. This branch is based onmainand includes the React 19 + Vite 8 commits from #369 and #370. The TypeScript/Vitest/tsdown/Turbo–specific changes are the last 2 commits.For review, please focus on these files (this PR only):
package.json(roottypescript,vitest,turbolines)packages/core/package.json(tsdown,typescript,@types/nodelines)packages/cli/package.json(tsdown,typescript,@types/nodelines)apps/web/package.json(@types/nodeline)packages/core/tsdown.config.tspackages/cli/tsdown.config.tspackages/core/tsconfig.json(removed deprecatedbaseUrlfor TS 6).changeset/typescript-vitest-tsdown-turbo.mdOnce #369 and #370 merge, I will rebase this branch onto
mainand the diff will shrink to only the TS/Vitest/tsdown/Turbo changes.Exact scope
Upgrade repository build/test/typecheck tooling only:
@types/nodeNo React/Vite/Biome/Oxlint/runtime library upgrades in this PR.
Versions before → after
typescript(core/cli)^5.9.3^6.0.3typescript(web)^6.0.3^6.0.3(aligned)typescript(root)6.0.3@types/node(core/cli)^22.19.17^22.19.21@types/node(web)^25.6.0^22.19.21(aligned to Node 22 contract)vitest^2.1.9^4.1.10tsdown^0.9.9^0.21.10turbo^2.9.18^2.10.5Why the old state was a problem
Why these versions were chosen
TypeScript 6.0.3 (not 7)
TypeScript 7.0.2 is the latest stable, but it is not adopted here:
tsdown@0.22.8(peers includetypescript@^7)engines.nodeis^22.18.0 || >=24.11.0, incompatible with the repo's Node>=22.13.0contract from #317tsdown@0.21.10(Node>=20.19.0, OK for 22.13+)typescript: ^5 || ^6only — no TypeScript 7Selected: TypeScript 6.0.3 (newest common stable supported by tsdown 0.21.10 + the Node 22.13+ contract).
Follow-up trigger: adopt TypeScript 7 when either (a) tsdown ≥0.22 lowers Node engines to include 22.13+, or (b) the repo intentionally raises engines to match tsdown 0.22+.
Other selections
vite: ^6 \|\| ^7 \|\| ^8— resolves the Vitest→Vite 5 leftover@types/node22.19.21: matches publishedengines.node >=22.13.0Breaking changes reviewed
.mjs/.d.mts; setfixedExtension: falseto preserve.js/.d.tsexport pathsexternal→deps.neverBundletargetnode18→node22(matches package engines)baseUrlfrompackages/core/tsconfig.json(TS 6 deprecates it;moduleResolution: bundlerresolvespathswithout it)Source changes required (this PR only)
packages/core/tsdown.config.ts/packages/cli/tsdown.config.tspackages/core/tsconfig.json(remove deprecatedbaseUrl)package.jsonversion bumps + lockfileTests added or changed
None required; existing suite green on Vitest 4 (306 tests).
Benchmark results
Same machine, Node 24.18.0, pnpm 10.17.0. Warm-up + 5 measured runs; medians.
pnpm typecheckwarmpnpm testturbo --force)Manual validation
On Node 24.18.0 with pnpm 10.17.0 (current
maintoolchain, plus the React 19 + Vite 8 base):Known limitations
mainafter those mergeProhibited workarounds
Confirmed not used:
--force,--legacy-peer-deps, overrides/resolutions, patch-package, prereleases, blanket suppressions, silent snapshot churn, unrelated features.Summary by CodeRabbit
Breaking Changes
Improvements