openclaw/ui/scripts
Peter Steinberger 11828a081f
perf(ui): record only route-reachable modules in the boot manifest (#162382)
The boot manifest generator recorded every module inside each chunk the
browser fetched while capturing /new and /chat. Rolldown's base splitting
co-locates a few modules New Session needs inside a large chat-only common
chunk, so 325 chat-only modules (2.95 MB source, incl. the chat view,
composer, and transcript renderers) were classified as shared and /new
downloaded them on every cold load.

The generator now keeps only fetched modules reachable from the HTML entry
and the dynamic entries each route requested: static imports, plus dynamic
imports whose target has no facade chunk and whose holding chunk was
fetched. Such an import resolves into an already-loaded chunk without a
request, so the capture cannot observe it (app-sidebar -> session
narration on /chat); facade targets the route never requested stay out.

Remove the hand-tuned chat-transcript-layout stable group. It bundled
chat-transcript-scroll-events (needed by /new) with six chat-only layout
modules, which statically pulled the chat boot chunks into the /new
preload template once the chat code left the shared group.

Measured with ui:build + ui:check-performance against main 00f3a20630
(same numbers on a Linux Testbox):
- /new boot JS: 1,566,917 B -> 1,190,648 B gzip (-24.0%), 52 -> 45 requests
- /new boot CSS: 120,083 B -> 108,603 B gzip, 8 -> 7 requests
- /chat boot JS: 1,486,675 B -> 1,483,409 B gzip, 50 -> 51 requests
- largest JS chunk: 206.3 KiB -> 179.2 KiB gzip (budget 215 KiB unchanged)

A Playwright capture of both routes on both builds (route preloads active,
mock Gateway) found no late chunk fetches beyond the template, no page
errors, and identical computed styles for every body element.

The regenerated manifest also carries drift main already had: a plain
regeneration moves session-snapshot-database to shared, so its chunking
test now checks the stable group against whichever boot group claims it.
2026-09-30 22:00:49 -07:00
..
control-ui-boot-manifest.mts perf(ui): record only route-reachable modules in the boot manifest (#162382) 2026-09-30 22:00:49 -07:00