Skip to content

Internal: Add Bun type checks and parallelize CI builds - #12181

Merged
JonnyBurger merged 6 commits into
mainfrom
codex/bun-check-ci-performance
Oct 11, 2026
Merged

JonnyBurger merged 6 commits into
mainfrom
codex/bun-check-ci-performance

Conversation

@JonnyBurger

@JonnyBurger JonnyBurger commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

Use Bun 1.4.3 for faster internal type checks while retaining tsgo for package builds, declaration generation, and existing native watch commands. Run CI builds with concurrency 2, followed by serial tests, preserving affected-package selection and Turbo caching.

  • Replace type-only checks in convert, remotion-media, jonnys-videos, skills-evals, the canvas capture extension, and Vercel scripts with bun check; add a root developer typecheck command.

  • Use tsgo --noEmit for integration tests, where measurements show it is faster than Bun.

  • Update compiler configuration for Bun's TypeScript 7 checker and resolve duplicate Vitest matcher types in media/web-renderer.

  • Update repository Bun 1.3.3 runtime pins and references to 1.4.3, and Bun type packages to the latest published 1.4.2. Keep TypeScript tooling for docs, compiler APIs, and public template commands.

  • Disable Bun module preloading in shared library builds so Studio ESM can be rebundled over HTTP without Rspack crashing on the generated import.meta.url. Preserve code splitting and track shared build scripts in Turbo cache inputs, including the Google Fonts task override.

  • Pin Vercel dependency installation and all nested build tasks to Bun 1.4.3 using a dedicated runtime directory. Keep the dashboard install/build settings aligned with vercel.ts; the bootstrap avoids Vercel's preinstalled Bun and reuses the downloaded binary for subsequent install phases.

  • Adapt existing HTTP tests to Bun 1.4.3: consume response bodies and close test connections, parse complete HTTP responses for unfinished oversized uploads, and accept DNS lookup failures in the renderer download test. Production code and assertion coverage remain unchanged.

Performance

Local medians from three runs per variant, using Bun 1.4.3 throughout. Build comparisons include all 81 tasks, disable Turbo cache reads, clear compiler build-info files, and retain warm filesystem caches.

Check Before After
All package builds, same concurrency 12.02s 11.90s
Build phase, concurrency 1 → 2 20.29s 13.67s
Convert typecheck 1.99s 0.34s
Integration-test typecheck 1.49s 0.31s

All six Bun replacements also improve warm-run timings. Splitting the CI phases adds approximately 0.36s of local planning overhead; a subsequent build hits cache for all 81 tasks. Hosted CI timings remain to be measured.

Disabling library preloads keeps the Studio bundle build effectively unchanged: five alternating warm samples gave 30.04 ms enabled versus 30.76 ms disabled, with overlapping sample ranges. Output shrinks by 5,182 bytes while retaining all 25 files and 22 dynamic imports.

Validation

  • Hosted CI for a967e38df63772b9fdea37a1bde4c70f6d2878ca: all required checks passed on Linux, Windows, and macOS, including browser suites and Vercel deployments. Successful workflow run.

  • bun run build: 81 tasks passed.

  • bun run stylecheck: 266 tasks passed, plus skill validation.

  • bun run typecheck: 8,194 files across 101 referenced projects passed; this does not cover every repository project.

  • bun publish.ts --check: 71 compiled packages validated.

  • 809 tests passed across core, convert, remotion-media, and CI planning.

  • Full monorepo package tests: all 141 Turbo tasks passed, including all 511 Studio server tests and all 377 renderer tests.

  • HTTP test fixes: red/green verified. The CORS test passed 30 consecutive runs; the protocol helper still rejects truncated Content-Length and chunked responses.

  • Browser Studio: all 15 Playwright tests pass; both HTTP fallback cases were reproduced failing before the fix and pass afterward.

  • Turbo dry-run confirms all 18 shared-builder consumers hash the builder and export validator while retaining default source inputs.

  • Vercel command validation: fresh and cached installs plus a nested Turbo task use Bun 1.4.3 with failing fake system Bun executables first in PATH; download failures stop without falling back. Commands also satisfy Vercel's 256-character limit.

  • Frozen dependency install, changed-file formatting, CI task coverage comparison, and Bun version audit passed.

  • Hosted Vercel validation: Bun 1.4.3 installation, the previously failing @remotion/vercel typecheck, all 1,689 documentation code blocks, and all 85 build tasks passed. Successful immutable preview.

Preview

@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
bugs Ready Ready Preview Oct 11, 2026 10:07am UTC
remotion Ready Ready Preview Oct 11, 2026 10:07am UTC

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes

  • Bun 1.4.3 rollout — every bun-version pin (changelog, copilot-setup, pullfrog, push), the root packageManager, engines.bun, the contributing docs, and the @types/bun catalog now target 1.4.3 (types 1.4.2); no stale 1.3.3 references remain.
  • Bun type checks — convert, remotion-media, jonnys-videos, skills-evals, canvas-capture-extension, and the Vercel scripts switch from tsc/tsgo to bun check; @typescript/native-preview is moved to it-tests; a root typecheck script is added. I confirmed each of these bun check invocations passes under Bun 1.4.3 (bun check -p tsconfig.scripts.json included).
  • TypeScript 7 compatibility — tsconfigs drop baseUrl, move moduleResolution: node → bundler, target: es5 → es2015, and add explicit types; packages/tsconfig.settings.json adds dom.iterable and types: ["bun", "deno"].
  • CI build/test split — the build job now runs turbo run make --concurrency=2 then turbo run test --concurrency=1; the root ci script mirrors this. The test task's dependsOn: ["^make", "make"] keeps the second invocation a cache hit, so the split preserves task coverage.
  • Lockfile — bun/bun-types bumps plus pruning of stale webdriverio transitive deps and an @swc/helpers dedup to 0.5.23.

ℹ️ The new root typecheck only passes after a build

bun run typecheck fails on a clean checkout before any build: packages/vercel/src/create-sandbox.ts imports ./generated/*-script (emitted by bundle.ts during make; src/generated is gitignored), and packages/canvas-capture-extension/tsconfig.json extends a gitignored .wxt/tsconfig.json (emitted by wxt prepare). Locally this surfaces as TS2307/TS5083 errors that stop checking 11 files. Running after bun run build is clean — worth a one-line note in the contributing docs if "build, then typecheck" is the intended workflow.

Technical details
# Root `bun check` requires generated artifacts

## Affected sites
- `package.json:8` — the new `"typecheck": "bun check"` follows the root references into `packages/vercel` and `packages/canvas-capture-extension`.
- `packages/vercel/src/create-sandbox.ts:2-4`, `packages/vercel/src/internals/install-browser.ts:2` — import `./generated/*-script`, which is gitignored and emitted by `packages/vercel/bundle.ts`.
- `packages/canvas-capture-extension/tsconfig.json:2` — `extends` the gitignored `.wxt/tsconfig.json`.

## Required outcome
- Decide whether `bun run typecheck` should work on a fresh checkout (document that `bun run build` must run first) or be scoped to avoid unbuilt generated projects.

## Open questions for the human
- Is "build, then typecheck" the intended developer workflow? If so, a short note in `packages/docs/docs/contributing/index.mdx` would avoid the confusing first-run errors.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash | 𝕏

@vercel

vercel Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project remotion with the following error:

vercel.ts Dynamic values found in static properties: installCommand, buildCommand

@JonnyBurger
JonnyBurger merged commit ee3016b into main Oct 11, 2026
20 checks passed
@JonnyBurger
JonnyBurger deleted the codex/bun-check-ci-performance branch October 11, 2026 10:35

This branch was successfully deployed

2 active deployments
Preview – remotion — a967e38d Deployed Oct 11, 2026 by vercel[bot]
Preview – bugs — a967e38d Deployed Oct 11, 2026 by vercel[bot]
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