Skip to content

perf(web): the browser panel's host loads in the desktop app only - #916

Merged
badcuban merged 1 commit into
mainfrom
perf/browser-panel-out-of-web-startup
Nov 14, 2026
Merged

badcuban merged 1 commit into
mainfrom
perf/browser-panel-out-of-web-startup

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

The problem

The layer that holds every thread's browser pages, and this window's browser connection for agents, was imported by the app's root and rendered only in the desktop app. So a browser tab and a phone downloaded and parsed about 70 KB of code they can never use: the web build has no <webview>. It also left the startup code within about 1.5 KB of its size budget in CI.

The fix

BrowserHostLayer is now a chunk of its own (lazyWithPreload), fetched by the desktop app as it starts and never by the web app. It sits under a plain Suspense, not OptionalChunk: the browser panel needs it, so a failure still shows.

Measured locally (gzip):

before after
startup closure 913,440 B 890,863 B
entry chunk 249,661 B 227,551 B

The budget stays where it is, as headroom; its comment records the new measurement.

Checked

  • A new desktop-window browser test (isElectron mocked) checks the window still loads and mounts the layer.
  • vp fmt, vp lint, vp run typecheck.
  • Full browser suite: 108 of 109 files pass. ThemeShareDialog.browser.tsx "sends the same share again after GitHub didn't answer" timed out clicking Share in the full local run, as it did in a full local run on an unrelated branch, and passes alone.

Not checked

The real desktop app was not opened to try the browser panel.

The layer that holds every thread's browser pages, and this window's browser
connection for agents, was imported by the app's root, so a browser tab and a
phone downloaded and parsed about 70 KB of code they can never use: the web
build has no <webview>. It is now a chunk the desktop app fetches as it
starts. Startup code drops from 913,440 B to 890,863 B gzip (the entry chunk
from 249,661 B to 227,551 B), which also gives the startup budget back its
headroom.

A desktop-window browser test checks the window still mounts the layer.
@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 14, 2026 5:17pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit 31a1156 Nov 14, 2026
33 of 35 checks passed
@badcuban
badcuban deleted the perf/browser-panel-out-of-web-startup branch November 14, 2026 19:08

This branch was previously deployed

1 inactive deployment
Preview — 7a62ec04 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant