Verify Bun and Angular compatibility #289
Notifications
Due Date
No due date set.
Blocks
#290 Run development and quality checks with Bun
nessar/vac-optimizer
#291 Run all tests and benchmarks with Bun
nessar/vac-optimizer
#292 Serve the deployed application with Bun
nessar/vac-optimizer
Reference: nessar/vac-optimizer#289
Reference in new issue
Block a user
Migration scope
The agreed target is Bun as the runtime for project-owned JavaScript in development, CI, and production, plus its native test runner, linter, formatter, standalone type checker, and HTTP server. Bun adoption is required even without measured performance gains. Retain Angular and its standard compiler/build pipeline, using TypeScript 6 for Angular compilation alongside Bun’s TypeScript 7-based standalone checker. The planner remains in the browser and current client rendering stays unchanged. Preserve tests, coverage, lint rules, behavior, and benchmark budgets. No compatibility proof exists yet; Bun 1.4.3 is a candidate, not a verified selection. Native-tool limitations and CI-platform exceptions must be resolved explicitly rather than hidden by a Node fallback. The architecture record is still proposed.
What to build
Give the maintainer a verified Bun release and a reproducible
path to the agreed native toolchain before committing to the migration. Establish
that Angular can retain its standard build pipeline while Bun runs project-owned
JavaScript, and expose any concrete incompatibility early.
Acceptance criteria
after verifying the required runtime, test, lint, format, type-check, and
HTTP-server capabilities. Record the versions and reproduction steps.
production build under Bun, with Node unavailable to project commands.
Identify spawned executables and prove which runtime executes them.
with external resources, TestBed setup, date control, global mock cleanup,
file isolation, and the existing real-worker testing approach. Record the
minimum required Angular test-compilation integration.
deprecated API checks, unused-name exceptions, configured severities, and
Angular-template formatting. Demonstrate that representative violations
still fail the intended check.
TypeScript 6 compiler, including an application type error, a test type
error, and an Angular template error detected by the appropriate command.
text, HTML, and Cobertura outputs and frozen-baseline exclusions. Identify
unsupported metrics or formats explicitly; accepting reduced reporting is
not an agreed fallback.
server without changing the current client-rendered route configuration.
separately from project commands. Any exception or infrastructure change
beyond the agreed migration remains unresolved until explicitly decided.
Downstream adoption is blocked until a verified approach meets the agreed
capabilities; do not silently substitute Node or weaken checks.
feature/*integration branch from currentorigin/develop, targetingdevelop. Tickets 02–05 share that branch, and ticket 05 owns the finalintegration gate. Do not add dual toolchains solely to make batches green.
Blocked by
None — can start immediately.
Verification on stable Bun 1.4.3 (
1.4.3+c6da4a4d3, SHA-256 verified), from a clean checkout. "Node unavailable" means onlybunplus/usr/bin:/binonPATH. Full results and decisions are indocs/bun-adoption.md→ "Verification Results and Decisions (#289)" onfeature/bun-migration.Pass
bun install --frozen-lockfile: lockfile unchanged.bun --bun x ng servewith Node unavailable:/and/benchmarkload.--bunis required for every#!/usr/bin/env nodebinary; without it they run on Node whenever Node is onPATH.bun check(app and spec tsconfigs) matches tsc 6 and catches app and test type errors. Template errors are caught only by the Angular build.bun test: 715/716 functional tests pass with a preload and a Vitest-API shim, including real-worker specs with Node unavailable. The single failure is a malformedit.eachrow inplanning-objectives.spec.ts.--parallel=4takes about 64 s, the same as Vitest.--isolate/--parallelis required for per-file isolation.bun test. The numbers are new Bun measurements, not comparable with Node.Bun.servepasses route, asset, cache-header, 404 and traversal checks.Blockers and decisions (maintainer)
bun lintandbun fmtexist only in canary (1.4.4-canary.1). Decision: pin stable 1.4.3 and keep ESLint/Prettier until a stable release ships them.memory:URLs, which needs Nodemodule.registerhooks; Bun ignores them. Decision: build Angular client-only (every route is client-rendered today) and serve it with a smallBun.servestatic server with SPA fallback. This gives up@angular/ssr.--max-old-space-size. Decision: use a container memory limit on the CI benchmark job.Platform constraints and smaller fixes
actions/checkout@v4(node20) andactions/upload-artifact@v3(node16) are JS actions, so the job container still needsnodefor the runner. Project commands won't use it.scripts/ci-image.test.mjsgenerates its fakedockerwith anodeshebang; switching it tobunpasses.ci-policy.test.mjsalready passes under Bun.NG_ALLOWED_HOSTSis set, and the compose files set onlyPORT. The Bun static server removes this.oven/bun:1.4.3-alpineexists (amd64 and arm64), and the client-only build works on musl.Implementation continues on
feature/bun-migration(#290–#293).