Repository navigation
Conversation
Embed the existing CLI bundle and assets, dispatch background helpers through the binary, and resolve bundled WASM by relative path. Refs vltpkg#1878
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe build tooling adds an experimental Bun workflow that compiles the CLI and helper scripts into a standalone executable. The bundle reports code-split script paths and resolves the Resvg WASM asset. Mermaid rendering accepts an environment-provided WASM path. ChangesStandalone Bun executable
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant CompileScript as compile.ts
participant BundleFunction as bundle()
participant BunCompiler as bun build --compile
CompileScript->>BundleFunction: Bundle vlt and helper scripts
BundleFunction-->>CompileScript: Return outdir and scripts
CompileScript->>BunCompiler: Pass staged payload and forwarded arguments
BunCompiler-->>CompileScript: Produce executable
Merge Risk: ⚪ Minimal · up to The experimental executable is mergeable after normal checks; runtime behavior on cross-compiled targets remains untested. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ESLint
ESLint install failed: dependency version conflict. Check your lock file or package.json. 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 |
|
| Project | vltpkg |
| Branch | feat/bun-standalone |
| Testbed | ubuntu-latest |
🚨 1 Alert
| Benchmark | Measure Units | View | Benchmark Result (Result Δ%) | Upper Boundary (Limit %) |
|---|---|---|---|---|
| vlt install: vue & lockfile | Latency seconds (s) | 📈 plot 🚷 threshold 🚨 alert (🔔) | 6.58 s(+26.92%)Baseline: 5.19 s | 6.48 s (101.54%) |
Click to view all benchmark results
| Benchmark | Latency | Benchmark Result milliseconds (ms) (Result Δ%) | Upper Boundary milliseconds (ms) (Limit %) |
|---|---|---|---|
| vlt install: vue & cache-lockfile | 📈 view plot 🚷 view threshold | 783.24 ms(+5.93%)Baseline: 739.38 ms | 924.23 ms (84.75%) |
| vlt install: vue & cache-lockfile-node-modules | 📈 view plot 🚷 view threshold | 396.63 ms(+12.59%)Baseline: 352.29 ms | 440.36 ms (90.07%) |
| vlt install: vue & clean | 📈 view plot 🚷 view threshold | 15,108.61 ms(-1.76%)Baseline: 15,379.89 ms | 19,224.86 ms (78.59%) |
| vlt install: vue & lockfile | 📈 view plot 🚷 view threshold 🚨 view alert (🔔) | 6,583.24 ms(+26.92%)Baseline: 5,186.86 ms | 6,483.57 ms (101.54%) |
|
sweet! thanks for the contribution @drawliin! we'll run some tests on our end, this is def exciting! @lukekarrys mentioned and I believe it's a good idea, to potentially publish this first as a |
|
Thanks @ruyadorno !! i have few ideas for further improvements: package this as @vltpkg/bun-bin, add smoke tests for the compiled CLI and background processes, verify it works on Linux/Windows, and explore platform detection and installation/fallback behavior under #1522 Let me know if you want me to tackle any of those while you’re testing internally.. i can split them into separate PRs |
Perf review: Bun single-file executable vs the Node-driven JS bundleA/B of this PR's Four arms, so the runtime switch can be separated from the packaging switch:
Both Node arms get a warm Verdict: the executable is functional on linux-x64 and faster than the Node bundle in
Start-up and small commands (warm, 40 runs each; median (mean ± σ) ms)
Cold module compile cache — a fresh CI container, or the first run after an upgrade. Node version is not the story: node 24.21 99.9 ms, node 26.11 97.2 ms, Where that start-up win actually comes from — an empty program on each runtime:
Subtracting the floor from The detached helpers re-exec the whole 88.6 MB executable rather than running a 260 KB Installs — 96 cells, 4 fixtures × 6 variations × 2 rounds, 0 failuresΔ is the SEA against
Absolute medians for the two ends of that range:
The shape is informative: the gain is biggest where the install is dominated by our own The one real regression: cold page cache
The SEA is ~2× slower on its first run after an install, a reboot, or in a container Not much of that size is ours: an empty
So a user who already has Node downloads 2.9 MB today and would download 39 MB per MemoryPeak RSS is consistently lower, which is the nicer half of the runtime swap: Distribution claim checks outWith Three runtime-behaviour differences found while validating linux-x64The PR notes Linux x64 "runtime testing remains", so I ran the functional pass first: Three differences are worth fixing before this becomes a shipped artifact. 1. export const flushStream = stream =>
new Promise(res => {
if (!stream.writableLength) return res() // <- always true under Bun
stream.write('', () => res())
})Under Bun Minimal repro — write 200 000 bytes to a pipe, then exit, and count what arrives So 2. ANSI escapes leak onto a non-TTY 3. Anything that keys on the title breaks — including - while pgrep -u "$(id -u)" -f '^vlt-(cache|security)-|^[^ ]*node [^ ]*/(cache-unzip-src-unzip|registry-client-src-revalidate)\.js( |$)'
+ while pgrep -u "$(id -u)" -f '^vlt-(cache|security)-|/(cache-unzip-src-unzip|registry-client-src-revalidate|rollback-remove-src-remove|security-archive-src-update-expired)\.js( |$)'Where the win comes from, and what the build leaves on the table
It does, however, leave the one big Bun startup lever unused. A CJS launcher would compile, but would not help on its own: bytecode only covers the Two smaller build notes:
Method, and what I would not read too much into
|

Fix #1878
Part of #1522
Adds an experimental Bun 1.4+ build that embeds the CLI bundle, assets, and background helpers in one executable.. also fixes bundled WASM copying and resolution for PNG rendering.
Build from
infra/build:Validation
PATH.Platform-specific packaging and installation/fallback behavior are follow-up work under #1522.
Summary by CodeRabbit