Skip to content

perf(web): the place catalog and the diff library leave startup - #1035

Merged
badcuban merged 1 commit into
mainfrom
perf/trim-startup-bundle
Nov 21, 2026
Merged

badcuban merged 1 commit into
mainfrom
perf/trim-startup-bundle

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

The web app's startup code sat about 1 KB under its 915 KB gzip budget in CI, so the next feature would fail the bundle check.

Two things loaded at startup that the first screen doesn't need:

  • The place catalog (about 13.5 KB). The project menu's brief link (projectBrief.ts) took its arrival hash from appPlaceLinks.ts, which reads the whole catalog, so the catalog was back at startup after being moved out on Nov 16. The hash helpers now live in apps/web/src/placeArrival.ts (one shared click counter, as before), and the chat's place-link check lives in @threadlines/shared/placeHref. Neither reads the catalog.
  • The diff library (about 4.3 KB). diffStats.ts imported it for countTextReplacementStats, which only the server uses, and the library's module state kept it in the web bundle. That function moved to @threadlines/shared/textReplacementStats.

Startup closure: 912,236 B to 894,411 B gzip, measured locally. No behavior change.

Checked: fmt, lint, typecheck; unit tests for diffStats, appPlaces, appPlaceLinks, chat markdown, settings, the server's AcpAdapter and the guide; full web browser suite (one layout timing test in an untouched file failed under load and passed alone). GPT-6.2 Astra reviewed the diff and found no problems.

The startup bundle sat about 1 KB under its 915 KB gzip budget in CI.

The project menu's brief link (projectBrief.ts) took its arrival hash from
appPlaceLinks.ts, which reads the whole place catalog, so the catalog was
back at startup (about 13.5 KB). The hash helpers now live in
placeArrival.ts, and the chat's place-link check in
@threadlines/shared/placeHref, neither of which reads the catalog.

diffStats.ts imported the `diff` library for countTextReplacementStats,
which only the server uses; the library's module state kept it in the
web bundle (about 4.3 KB). That function moved to textReplacementStats.ts.

Startup closure: 912,236 B -> 894,411 B gzip locally.
@vercel

vercel Bot commented Nov 21, 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 21, 2026 3:28am UTC

Request Review

@badcuban
badcuban enabled auto-merge November 21, 2026 03:28
@badcuban
badcuban added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 23c29e0 Nov 21, 2026
23 checks passed
@badcuban
badcuban deleted the perf/trim-startup-bundle branch November 21, 2026 03:39

This branch was previously deployed

1 inactive deployment
Preview — 9548bf30 Deployed Nov 21, 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