Skip to content

chore(root): migrate typecheck to @typescript/native-preview (tsgo)#1400

Merged
mihar-22 merged 8 commits intomainfrom
t3code/e58fa31b
Apr 23, 2026
Merged

chore(root): migrate typecheck to @typescript/native-preview (tsgo)#1400
mihar-22 merged 8 commits intomainfrom
t3code/e58fa31b

Conversation

@mihar-22
Copy link
Copy Markdown
Member

@mihar-22 mihar-22 commented Apr 22, 2026

Summary

Migrates the entire monorepo from typescript / tsc to @typescript/native-preview (tsgo) — the new native Go-based TypeScript compiler.

Changes

  • Root typecheck script: replaced tsc --build with tsgo --build
  • Root dep: swapped typescript: ^6.0.2@typescript/native-preview: beta
  • disableSourceOfProjectReferenceRedirect removed from tsconfig.base.json — this was a tsc-specific optimization; it actually makes tsgo slower
  • allowSyntheticDefaultImports / esModuleInterop removed — redundant with verbatimModuleSyntax
  • tsdown bumped to ^0.21.9 across all packages (adds tsgo support in rolldown-plugin-dts)
  • Per-package typescript devDep removed@typescript/native-preview is hoisted from root
  • dts: { tsgo: true } enabled in all package tsdown.config.ts files — declaration files now generated by tsgo
  • tsconfig.dts.json added to packages that needed one (utils, store, element, spf, html, react, skins, core) — tsgo requires a tsconfig without composite: true or declarationDir so --outDir is respected
  • site/ keeps typescript via alias npm:@typescript/typescript6@^6.0.0 — build scripts use the TS compiler API which isn't available in @typescript/native-preview

Benchmark (cold, no tsbuildinfo)

tsc tsgo speedup
pnpm typecheck (cold) 4.35s 0.66s 6.6x
pnpm typecheck (warm) 0.91s 0.16s 5.6x
build:packages (8 pkgs, seq.) 9.86s 8.38s 1.2x

Test plan

  • All packages build successfully (pnpm build)
  • Typecheck passes (pnpm typecheck)

🤖 Generated with Claude Code


Note

Medium Risk
Medium risk because it swaps the monorepo typechecking and .d.ts generation pipeline from tsc to tsgo, which can change diagnostics/output and affect build tooling across all packages.

Overview
Switches the root typecheck script from tsc --build to tsgo --build and replaces the workspace typescript devDependency with @typescript/native-preview.

Updates package build tooling to generate declarations via tsgo by bumping tsdown and changing each package’s tsdown.config.ts dts settings, adding new per-package tsconfig.dts.json files where needed.

Cleans up TypeScript config/deps (removes per-package typescript devDeps and drops esModuleInterop/allowSyntheticDefaultImports from tsconfig.base.json), while keeping site on typescript via an npm alias for TS compiler API usage.

Reviewed by Cursor Bugbot for commit 7d3b24d. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v10-sandbox Ready Ready Preview, Comment Apr 23, 2026 1:09am

Request Review

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 22, 2026

Deploy Preview for vjs10-site ready!

Name Link
🔨 Latest commit 7d3b24d
🔍 Latest deploy log https://app.netlify.com/projects/vjs10-site/deploys/69e971160724c50008699e3f
😎 Deploy Preview https://deploy-preview-1400--vjs10-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

📦 Bundle Size Report

🎨 @videojs/html — no changes
Presets (7)
Entry Size
/video (default) 28.72 kB
/video (default + hls) 161.12 kB
/video (minimal) 26.25 kB
/video (minimal + hls) 158.87 kB
/audio (default) 26.64 kB
/audio (minimal) 24.21 kB
/background 4.16 kB
Media (8)
Entry Size
/media/background-video 1.04 kB
/media/container 1.72 kB
/media/dash-video 236.54 kB
/media/hls-video 134.01 kB
/media/mux-audio 160.06 kB
/media/mux-video 160.07 kB
/media/native-hls-video 3.77 kB
/media/simple-hls-video 15.80 kB
Players (3)
Entry Size
/video/player 7.04 kB
/audio/player 5.12 kB
/background/player 3.86 kB
Skins (29)
Entry Type Size
/video/minimal-skin.css css 3.50 kB
/video/skin.css css 3.53 kB
/video/minimal-skin js 26.26 kB
/video/minimal-skin.tailwind js 26.48 kB
/video/skin js 28.76 kB
/video/skin.tailwind js 28.88 kB
/audio/minimal-skin.css css 2.54 kB
/audio/skin.css css 2.50 kB
/audio/minimal-skin js 24.20 kB
/audio/minimal-skin.tailwind js 24.40 kB
/audio/skin js 26.64 kB
/audio/skin.tailwind js 26.78 kB
/background/skin.css css 117 B
/background/skin js 1.14 kB
/live-video/minimal-skin.css css 3.50 kB
/live-video/skin.css css 3.53 kB
/live-video/minimal-skin js 26.04 kB
/live-video/minimal-skin.tailwind js 26.07 kB
/live-video/skin js 28.45 kB
/live-video/skin.tailwind js 28.52 kB
/live-audio/minimal-skin.css css 2.54 kB
/live-audio/skin.css css 2.50 kB
/live-audio/minimal-skin js 23.99 kB
/live-audio/minimal-skin.tailwind js 23.99 kB
/live-audio/skin js 26.35 kB
/live-audio/skin.tailwind js 26.42 kB
/base.css css 157 B
/shared.css css 88 B
/skin-element js 1.36 kB
UI Components (25)
Entry Size
/ui/alert-dialog 1.00 kB
/ui/alert-dialog-close 467 B
/ui/alert-dialog-description 423 B
/ui/alert-dialog-title 420 B
/ui/buffering-indicator 2.50 kB
/ui/captions-button 2.67 kB
/ui/cast-button 2.66 kB
/ui/compounds 4.20 kB
/ui/controls 2.33 kB
/ui/error-dialog 3.07 kB
/ui/fullscreen-button 2.70 kB
/ui/hotkey 1.94 kB
/ui/mute-button 2.67 kB
/ui/pip-button 2.71 kB
/ui/play-button 2.68 kB
/ui/playback-rate-button 2.66 kB
/ui/popover 1.83 kB
/ui/poster 2.28 kB
/ui/seek-button 2.69 kB
/ui/slider 1.50 kB
/ui/thumbnail 2.92 kB
/ui/time 2.54 kB
/ui/time-slider 3.94 kB
/ui/tooltip 2.02 kB
/ui/volume-slider 2.66 kB

Sizes are marginal over the root entry point.

⚛️ @videojs/react — no changes
Presets (7)
Entry Size
/video (default) 23.48 kB
/video (default + hls) 154.91 kB
/video (minimal) 21.11 kB
/video (minimal + hls) 152.51 kB
/audio (default) 19.06 kB
/audio (minimal) 17.61 kB
/background 755 B
Media (7)
Entry Size
/media/background-video 575 B
/media/dash-video 235.04 kB
/media/hls-video 132.49 kB
/media/mux-audio 158.70 kB
/media/mux-video 158.57 kB
/media/native-hls-video 2.26 kB
/media/simple-hls-video 14.36 kB
Skins (26)
Entry Type Size
/video/minimal-skin.css css 3.44 kB
/video/skin.css css 3.46 kB
/video/minimal-skin js 21.04 kB
/video/minimal-skin.tailwind js 24.53 kB
/video/skin js 23.40 kB
/video/skin.tailwind js 24.66 kB
/audio/minimal-skin.css css 2.44 kB
/audio/skin.css css 2.39 kB
/audio/minimal-skin js 17.52 kB
/audio/minimal-skin.tailwind js 20.04 kB
/audio/skin js 18.98 kB
/audio/skin.tailwind js 19.97 kB
/background/skin.css css 90 B
/background/skin js 272 B
/live-video/minimal-skin.css css 3.44 kB
/live-video/skin.css css 3.46 kB
/live-video/minimal-skin js 17.74 kB
/live-video/minimal-skin.tailwind js 21.15 kB
/live-video/skin js 20.14 kB
/live-video/skin.tailwind js 21.32 kB
/live-audio/minimal-skin.css css 2.44 kB
/live-audio/skin.css css 2.39 kB
/live-audio/minimal-skin js 15.72 kB
/live-audio/minimal-skin.tailwind js 18.03 kB
/live-audio/skin js 17.21 kB
/live-audio/skin.tailwind js 18.12 kB
UI Components (20)
Entry Size
/ui/alert-dialog 1.09 kB
/ui/buffering-indicator 1.79 kB
/ui/captions-button 2.02 kB
/ui/cast-button 2.04 kB
/ui/controls 1.76 kB
/ui/error-dialog 2.25 kB
/ui/fullscreen-button 2.06 kB
/ui/mute-button 2.03 kB
/ui/pip-button 2.00 kB
/ui/play-button 1.99 kB
/ui/playback-rate-button 1.89 kB
/ui/popover 1.86 kB
/ui/poster 1.67 kB
/ui/seek-button 2.10 kB
/ui/slider 2.66 kB
/ui/thumbnail 2.07 kB
/ui/time 2.06 kB
/ui/time-slider 2.36 kB
/ui/tooltip 2.17 kB
/ui/volume-slider 3.18 kB

Sizes are marginal over the root entry point.

🧩 @videojs/core — no changes
Entries (9)
Entry Size
. 4.96 kB
/dom 11.87 kB
/dom/media/custom-media-element 1.90 kB
/dom/media/dash 234.13 kB
/dom/media/google-cast 4.07 kB
/dom/media/hls 131.85 kB
/dom/media/mux 158.10 kB
/dom/media/native-hls 1.61 kB
/dom/media/simple-hls 13.73 kB
🏷️ @videojs/element — no changes
Entries (2)
Entry Size
. 996 B
/context 943 B
📦 @videojs/store — no changes
Entries (3)
Entry Size
. 1.39 kB
/html 695 B
/react 360 B
🔧 @videojs/utils — no changes
Entries (10)
Entry Size
/array 104 B
/dom 1.92 kB
/events 319 B
/function 327 B
/object 275 B
/predicate 265 B
/string 148 B
/style 190 B
/time 478 B
/number 158 B
📦 @videojs/spf — no changes
Entries (3)
Entry Size
. 40 B
/dom 13.33 kB
/playback-engine 13.24 kB

ℹ️ How to interpret

All sizes are standalone totals (minified + brotli).

Icon Meaning
No change
🔺 Increased ≤ 10%
🔴 Increased > 10%
🔽 Decreased
🆕 New (no baseline)

Run pnpm size locally to check current sizes.

sampotts
sampotts previously approved these changes Apr 22, 2026
luwes
luwes previously approved these changes Apr 22, 2026
Copy link
Copy Markdown
Collaborator

@luwes luwes left a comment

Choose a reason for hiding this comment

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

gogogo!

mihar-22 and others added 8 commits April 22, 2026 18:07
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Upgrades tsdown across all packages to 0.21.9, removes redundant per-package
typescript devDependencies (now resolved via root), and migrates dts generation
to use tsgo with dedicated per-package tsconfig.dts.json files.
…ipts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Prepares for TypeScript 7.0 landing under the `typescript` package.
The compiler API needed by build scripts is pinned to 6.x via the
official compatibility alias.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Not needed with tsgo — it actually slows typecheck down (~1.3s vs ~0.8s).
The flag was a tsc-specific optimization for reading .d.ts over source.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…lotted

src/types was deleted in #282 but tsdown.config.ts still listed it as
an entry point, and slotted.ts still imported Falsy from it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mihar-22 mihar-22 merged commit 84c9e54 into main Apr 23, 2026
26 checks passed
@mihar-22 mihar-22 deleted the t3code/e58fa31b branch April 23, 2026 01:11
cjpillsbury added a commit that referenced this pull request Apr 23, 2026
PR #1400 dropped typescript from every package in favor of
@typescript/native-preview (tsgo) at the workspace root. vitest's
typecheck project still defaulted to the tsc binary, which is no
longer installed, so `pnpm -F @videojs/spf test` fails with
`Error: spawn tsc ENOENT`. This is the only failing job in CI on
this branch and is unrelated to the docs work.

vitest's typecheck.checker accepts any binary that understands
--noEmit --pretty false --incremental --tsBuildInfoFile; tsgo does,
and pnpm puts node_modules/.bin/tsgo on PATH for lifecycle scripts,
so 'tsgo' resolves without any new devDependency. Verified against
the existing create-composition-types.test-d.ts: clean runs report
"Type Errors: no errors" and exit 0, and intentionally broken type
tests surface as TypeCheckError with file/line/column parsed from
tsgo's tsc-compatible diagnostic output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

3 participants