Skip to content

ci(bundle): record what the HTML of five docs pages preloads - #1483

Merged
atinux merged 7 commits into
mainfrom
ci/bundle-prerendered-urls
Nov 13, 2026
Merged

atinux merged 7 commits into
mainfrom
ci/bundle-prerendered-urls

Conversation

@larbish

@larbish larbish commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Updated by an AI agent on behalf of @atinux for nuxt-bundle-analyzer 0.2.0, whose --urls flag (atinux/nuxt-bundle-analyzer#27) replaces --prerender and the layer.

Why

Every docs page shares one route, [[lang]]/[...slug].vue, so the bundle comment and bundle.nuxt.dev show the same initial load for all of them. That number follows static imports only and misses the lazy components a page renders, such as the prose components of its Markdown, which the HTML preloads. On /en, the HTML preloads 537.4 kB of Brotli JS and CSS against 293.7 kB for its route.

What changed

  • bundle-size.yml and bundle-size-history.yml: the analyzer runs with --urls "$NUXT_BUNDLE_ANALYZER_URLS", so each run renders only /en, /en/getting-started/installation, /en/essentials/components, /en/essentials/code-blocks and /en/essentials/images-embeds, and records what their HTML preloads. The last two load ProseImg (37.2 kB) and ProseCodeTree, ProseCodeGroup and ProseCodeCollapse (6.4 kB together), which the other pages don't. Both workflows list the same URLs in env. In bundle-size.yml, both jobs read the list from this pull request's workflow, so the base and the pull request render the same pages.
  • bundle-size.yml, bundle-size-history.yml and bundle-size-comment.yml run [email protected] with npx, the release with --urls, instead of 0.1.7.

Evidence

The analyze step of bundle-size.yml, run locally on this branch with npx --yes [email protected] docs --extends ../layer --urls "$NUXT_BUNDLE_ANALYZER_URLS" --no-serve (exit 0). Nitro starts from the 23 routes Docus and its modules add, and --urls leaves out all but five:

[nitro] ℹ Prerendering 23 routes
[nitro]   ├─ /en (2195ms)
[nitro]   ├─ /en/essentials/code-blocks (2578ms)
[nitro]   ├─ /en/getting-started/installation (2367ms)
[nitro]   ├─ /en/essentials/images-embeds (1631ms)
[nitro]   ├─ /en/essentials/components (1870ms)
[nitro] ℹ Prerendered 5 routes in 24.128 seconds
[nuxt-bundle-analyzer] ℹ Recorded 5 prerendered pages.

The analyze (base) and analyze (pr) jobs of this pull request logged the same Recorded 5 prerendered pages. with the pull request's build of #27.

URL Files its HTML preloads Brotli
/en 94 537.4 kB
/en/getting-started/installation 82 311.0 kB
/en/essentials/components 103 325.7 kB
/en/essentials/code-blocks 84 318.6 kB
/en/essentials/images-embeds 79 346.7 kB

With every /en page prerendered, these five pages preload all the files the others do except about 2.6 kB: ProseOl, ProseEm, ProseBlockquote, ProseKbd and the MCP install button.

Notes

ELI5

The size check used to guess what a docs page loads by following the code, and it missed the parts a page loads because of what's written in it. Now it builds five real pages, picked so that together they use the docs' heavier building blocks such as images and code trees, and reads which files their HTML asks for. The numbers match what a visitor's browser fetches.

🤖 Generated with Amp, reviewed by @larbish before opening.

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docus Ready Ready Preview Nov 13, 2026 9:55am UTC

@pkg-pr-new

pkg-pr-new Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/create-docus@1483
npm i https://pkg.pr.new/docus@1483

commit: 55f45ca

@docus-bundle-report

docus-bundle-report Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Bundle size

Explore the comparison →

Client 804.7 kB (no change) · Server 1.60 MB $\color{red}\textsf{(+70 B, +0.0}\%\textsf{)}$

No route loads 100 B more or less before it renders.

Brotli sizes. Changes under 100 B are left out of the tables. Measured by nuxt-bundle-analyzer for 55f45ca.

@larbish larbish changed the title ci(bundle): record what the HTML of three docs pages preloads ci(bundle): record what the HTML of five docs pages preloads Nov 12, 2026
…r layer

nuxt-bundle-analyzer#27 replaced --prerender and the layer with --urls,
which renders only the URLs it lists. Both runs of a pull request now
read the same list from the workflow, so the base no longer copies the
layer from the pull request.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d04f-d58d-71d8-a3ce-f9f02763ca25
0.2.0 released --urls from atinux/nuxt-bundle-analyzer#27, so the workflows
go back to npx instead of building the pull request's commit, and the
comment workflow uses the same version.
@atinux
atinux marked this pull request as ready for review November 13, 2026 10:06
@atinux
atinux merged commit c12e41a into main Nov 13, 2026
13 checks passed
@atinux
atinux deleted the ci/bundle-prerendered-urls branch November 13, 2026 10:12

This branch was successfully deployed

1 active deployment
Preview — 55f45ca8 Deployed Nov 13, 2026 by vercel[bot]
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.

2 participants