Skip to content

fix(cli): load web assets on demand - #49253

Merged
thdxr merged 1 commit into
v2from
lazy-web-assets
Sep 16, 2026
Merged

thdxr merged 1 commit into
v2from
lazy-web-assets

Conversation

@thdxr

@thdxr thdxr commented Sep 16, 2026

Copy link
Copy Markdown
Member

Issue for this PR

N/A

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The server currently expands all 915 embedded web assets into memory on the first web request. This changes the build to Brotli-compress each asset independently and lazily decompress only the requested response without retaining it server-side.

In a compiled-server comparison after loading the 49 initial web assets, RSS dropped from 393 MiB to 200 MiB and load time dropped from 197 ms to 29 ms. The compiled binary also dropped from 222 MiB to 204 MiB.

How did you verify your code works?

  • Compared compiled production artifacts under the same isolated server workload
  • Fetched and byte-compared all 915 embedded assets (34.3 MB total)
  • Verified Bun and Node packaging builds
  • Ran the focused web UI test and CLI typecheck
  • Ran bun run check

Screenshots / recordings

N/A — server packaging and memory behavior only.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

from OpenCode

@thdxr
thdxr merged commit 12201ee into v2 Sep 16, 2026
8 checks passed
@thdxr
thdxr deleted the lazy-web-assets branch September 16, 2026 01:15
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