opencode/packages
Claude d1a9ef8053
perf: add Rollup tree-shaking pre-pass for export * as barrels
Bun's bundler (and esbuild) cannot tree-shake `export * as X from "./mod"`
barrels — see evanw/esbuild#1420. Rollup can, using AST-level analysis to
drop unused exports and their transitive imports.

This adds a Rollup pre-pass to the build pipeline that runs before Bun's
compile step. Rollup resolves internal source, eliminates dead code across
the 57 `export * as` barrels, and writes tree-shaken ESM to a temp directory.
Bun then compiles the pre-processed output into the final binary.

- Add `script/treeshake-prepass.ts` with Bun.Transpiler-based Rollup plugin
- Integrate into `script/build.ts` (skippable via `--skip-treeshake`)
- Add `rollup` as devDependency
- Pre-pass completes in ~5s, negligible vs full multi-platform build

Current bundle savings are modest (~0.7%) because the single-entrypoint
architecture means most code paths are reachable. Savings scale with:
- Per-command entry points or lazy loading
- Remaining 50 `export namespace` → `export * as` migrations
- Future code splitting

https://claude.ai/code/session_01R7zMpXjsq1R6uR7xpyJ14i
2026-04-16 12:37:49 +00:00
..
app app: start migrating bootstrap data fetching to TanStack Query (#22756) 2026-04-16 06:10:23 +00:00
console Fix desktop download asset names for beta channel (#22766) 2026-04-16 06:10:03 +00:00
containers chore: bump Bun to 1.3.11 (#18144) 2026-03-23 10:19:21 +10:00
desktop feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741) 2026-04-15 23:27:32 -04:00
desktop-electron beta badge for desktop app (#14471) 2026-04-16 06:03:41 +00:00
docs
enterprise feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741) 2026-04-15 23:27:32 -04:00
extensions/zed release: v1.4.6 2026-04-15 07:26:23 +00:00
function feat: enable oxlint suspicious category, fix 24 violations (#22727) 2026-04-16 02:53:10 +00:00
identity
opencode perf: add Rollup tree-shaking pre-pass for export * as barrels 2026-04-16 12:37:49 +00:00
plugin fix: remove 10 unused type-only imports and declarations (#22696) 2026-04-16 02:17:59 +00:00
script refactor: replace bun semver with npm semver package 2026-03-09 15:29:55 -04:00
sdk chore: generate 2026-04-16 07:15:05 +00:00
shared CLI perf: reduce deps (#22652) 2026-04-16 02:03:03 -04:00
slack feat: enable type-aware no-floating-promises rule, fix all 177 violations (#22741) 2026-04-15 23:27:32 -04:00
storybook feat: enable type-aware no-base-to-string rule, fix 56 violations (#22750) 2026-04-16 03:50:47 +00:00
ui fix: clean up final 16 no-unused-vars warnings (#22751) 2026-04-16 03:54:21 +00:00
web feat: enable type-aware no-base-to-string rule, fix 56 violations (#22750) 2026-04-16 03:50:47 +00:00