First-visit JavaScript
What a first visit fetches on top of the initial bundle, from the QA build. Sizes are minified bytes before compression. Before means after PR 10847. MB means a million bytes. The walk is the static import graph of each entry. It does not count the layout chunks a page then fetches with import().
| Entry | Before | After |
|---|---|---|
The promotional routes file, which is main / | 2.79 MB | 1.76 MB |
| The marketing page component | 1.23 MB | 0.03 MB |
| The comparison page component | 1.23 MB | 0.03 MB |
| The pro page component | 2.05 MB | 0.86 MB |
| Creators-home | 1.30 MB | 0.11 MB |
| Sub-page view | 1.36 MB | 0.21 MB |
Marketing and comparison are the clean case. Those pages were almost all the 54-layout preview. Pro stays heavier because the pro page still statically owns pro-contact-form-layout. That id never had a preview class in the 54.
Home at 1.76 MB is not a failed split. promotional.routes.ts still statically imports landing, promotional, promotional-detail, and search-result. Those four sit in one graph. Some unused layout source files still appear in that graph because they share a chunk with header or chrome. The browser on / still did not fetch newsletter, most portfolio details, pro-hero, read-more, or feature-creator. Those staying off the wire is the proof the split works.
Commit 3645b6d5ee: load only the layouts a public page uses
What changed
marketing-page-layout-loaders.tsmaps 53 layout ids to literalimport()calls. A variable path would not split. Header is not in the map.pro-contact-form-layoutis not either.MarketingPageFullPreviewComponentno longer lists 54 layout classes inimports. After it resolves sections it loads the unique visible ids in parallel, caches the classes, and renders them withngComponentOutlet.- A
PendingTaskshandle stays open until those imports finish, thendone()runs infinally. A generation token drops a stale load when sections change or the component is destroyed. - Header stays a static template. It projects the welcome-video modal and binds
[post]="headerLayout.welcomeVideoPost".ngComponentOutletcannot do that without moving the modal into HeaderLayout. - The extra inputs each layout already had, like
disablePinnedScroll,isEditingMode, footer branding, andforceMobileView, move intogetMarketingPageLayoutInputs. add-marketing-page-sectionstill statically imports every layout. The picker needs the full catalog.
SEO tags come from setMarketingPageSeo on the page, from the published payload. They never depended on the layout imports. Title and description on /, /athletes, /music-artists, /topfan-vs-patreon, and /creators-home matched the 10847 SSR. So did every app-*-layout count. Skip PendingTasks and the first HTML loses those tags, the same way white-label / lost <app-profile> before 10847. @defer would do the same. It is client-only.
How I checked it
| Check | Result |
|---|---|
| QA build | Passes. Output in /tmp/tf-sm/layouts. |
| Route-weight against the 10847 QA build | The table above. Same script as the leftovers numbers, walking stats.json. |
| SSR HTML against the 10847 server | Title match, description match, layout tag counts match on home, athletes, music-artists, comparison, and creators-home. /apps/music-artists-fan-club 404s on both. That is old. |
| Browser on the new server | Home, athletes, and comparison render. Athletes "See Example" still goes to /. No hydration errors. CDN 404s are old image URLs. |
Network on / | Newsletter, most portfolio details, pro-hero, read-more, and feature-creator stay off the wire. |
What this does not do
- It does not lazy-load the four promotional route components. That leftover 1.76 MB on home is a different split.
- It does not skip
ProfileComponenton a published white-label cover. That import still starts in the landing constructor. - It does not split
comparison-layout.utilsoff the editor field constants. That 29 KB leak is still there. - It does not touch
bootstrapApplication.
Verification checklist
Keep the console and the network panel open. Do not buy, subscribe, or publish. Checks are saved in this browser.