Skip to content

Speed up the frontend build with Bun, parallel prerender and incremental builds - #1929

Merged
David Pine (IEvangelist) merged 10 commits into
mainfrom
ievangelist-incremental-parallel-bun-build
Oct 26, 2026
Merged

David Pine (IEvangelist) merged 10 commits into
mainfrom
ievangelist-incremental-parallel-bun-build

Conversation

@IEvangelist

@IEvangelist David Pine (IEvangelist) commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Explores incremental builds, parallel prerender and Bun together, based on main. Only the build changes are here; the hybrid API work stays in #1874, which targets release/17.0. An earlier version of this branch targeted release/17.0 and also shared contributor fetches across prerender workers. main now pre-generates contributor data (#1803), so that change is dropped.

  • Parallel prerender and incremental builds: Sébastien Ros's Speed up site build with Astro 7.4 parallel prerender and incremental builds #1927 (Astro 7.4 experimental.parallelPrerender and incrementalBuild, plus cacheKey refactors for the glossary, API and OG routes) is the first commit, applied unchanged with his authorship kept. Whichever of Speed up site build with Astro 7.4 parallel prerender and incremental builds #1927 and this PR merges second rebases and drops it. This PR also fixes a quadratic comparison in ts-api-route-catalog.vitest.test.ts (about 34 s down to about 1.6 s in a local run). Astro is then bumped to 7.4.2 (the structured-clone patch is renamed and applies unchanged), and the TypeScript item Markdown routes now take an item index instead of the whole item: parallel prerender workers get a structured clone, so a slug lookup by identity fell back to the unsuffixed slug for a duplicate handle such as thing-thing-2.
  • Bun replaces pnpm (1.4.3) for installs and scripts. bun.lock is migrated from pnpm-lock.yaml, and the pnpm workspace settings move to package.json (overrides, patchedDependencies, trustedDependencies) and bunfig.toml (one-day release age gate). The devalue override from Update devalue dependency #1940 moves with them (devalue@<5.9.3 resolves to 5.9.4). patches/README.md keeps the patch rationale that lived in pnpm-workspace.yaml comments.
  • The production Astro build runs on the Bun runtime (bunx --bun astro build). Dev, preview, Vitest, ESLint and Playwright stay on Node. Two Bun differences are handled in config:
    • ec.config.mjs imports the starlight-plugin-icons TypeScript source natively, because Bun has no Node module hooks, which tsx needs.
    • astro.config.mjs defaults process.env.BASE_URL to /. Bun resolves import.meta.env to process.env, and starlight-links-validator reads import.meta.env.BASE_URL, so without it astro:build:done crashed with undefined is not an object (evaluating 'path.replace').
  • CI: frontend-build, indexnow and update-integration-data use the SHA-pinned oven-sh/setup-bun action (bun-version-file points at src/frontend/package.json), then bun install --frozen-lockfile. The CodeQL ADO pipeline, dev container and Dependabot (bun ecosystem) are converted too.
  • Astro build cache in frontend-build: node_modules/.astro is restored on every run (keyed on bun.lock, astro.config.mjs and the patches) so incremental builds can skip unchanged pages. It is saved only by push builds and by a PR build that found nothing to restore, so each PR commit doesn't write another entry against the 10 GB repo cache limit. The job summary reports the restored key, exact hit and size.
  • Frontend Build runs on the 8-core runner. The build job in frontend-build.yml uses 8-core-ubuntu-latest (runner group aspire-runners, granted to this repository in microsoft/github-operations#1993) when the repository owner is microsoft, and ubuntu-latest otherwise, because forks can't use the label. The other jobs stay on ubuntu-latest. With the same four prerender workers, the cold build step went from 731 s to 296 s and the job from 968 s to 417 s (see the timings below).
  • One flaky E2E test is fixed. The a missing live API stays disabled across navigation and visibility changes until reload test in live-status.spec.ts failed on CI runners where the real WCP script shows its consent banner: the test helper rejects it, WCP reloads the page, and /api/live/ is requested a second time. The test now aborts the WCP script, as other specs already do.
  • Docs, agents and skills now say Bun. In the contributor guide, the prerequisites list Bun, the pnpm | npm install tabs became one bun install step with a note (other package managers ignore bun.lock and the patches), and the pnpm commands became bun run .... CONTRIBUTING.md, CODESPACES.md, the agent instructions and the skills match, and the pnpm card is gone from the thanks page. The contributor data hint in ContributorList.astro (and its unit test) now says bun run update:contributors.

Timings (four prerender workers throughout; ubuntu-latest is 4 vCPU and 16 GB, 8-core-ubuntu-latest is 8 vCPU and 32 GB). The main rows are push builds of main, which has sequential prerender, Node and no cache:

Run Runner Prerender Astro build step Frontend Build job
main push a62b64bec (this PR's earlier base) ubuntu-latest 18 m 22 s 1,252 s 1,471 s
main push 6be625cd0 (a fast runner) ubuntu-latest 12 m 13 s 826 s 976 s
main push 3120da6c3 (a fast runner) ubuntu-latest 11 m 36 s 786 s 934 s
This PR, cold (no cache) ubuntu-latest 9 m 36 s 732 s 963 s
This PR, cold (no cache), after the rebase ubuntu-latest 9 m 33 s 731 s 968 s
This PR, warm cache, same commit (re-run) ubuntu-latest 3 m 27 s 438 s 650 s
This PR, cold (no cache) 8-core-ubuntu-latest 3 m 53 s 296 s 417 s
This PR, cold (no cache), after the Astro 7.4.2 bump 8-core-ubuntu-latest 3 m 49 s 386 s 534 s
This PR, warm cache, same commit (re-run) 8-core-ubuntu-latest 3 m 15 s 297 s 485 s

On the 8-core runner the cold build step took 296 s against 731 s on ubuntu-latest for the same content and the same four workers, and the job 417 s against 968 s. That is more than the doubled vCPU count alone explains, and I didn't isolate why (the runner also has twice the memory). The cold artifact upload went from 171 s to 87 s and the cache save from 29 s to 6 s. The warm re-run on the 8-core runner took the same 297 s: prerender was 38 s faster, but Vite (38 s to 64 s) and Pagefind (43 s to 66 s) were each about 25 s slower, which looks like run-to-run noise in a single sample, and its artifact upload took 146 s. So on the larger runner the incremental cache gains little, while on ubuntu-latest, which forks fall back to, it saved about 5 min. A second cold run on the 8-core runner, after the Astro 7.4.2 bump, took 386 s for the build step and 534 s for the job: prerender took the same time (3 m 49 s), but Vite (54 s), Pagefind (52 s) and the artifact upload (109 s) were each slower, so read the 8-core figures as a range (417 to 534 s for the job).

Runner speed varies a lot, so a single run says little. Frontend Build on main took 15.6 to 27.0 min over its last 20 pushes (median 23.5 min), and the cold run on ubuntu-latest (16 m 03 s) sits inside that spread, level with main's two fastest pushes. The cold 8-core jobs (6 m 57 s and 8 m 54 s) are far below that spread. Prerender is the cleaner comparison on ubuntu-latest: 9 m 36 s here against 11 m 36 s to 18 m 22 s on main. The warm re-run on ubuntu-latest took 10 m 50 s.

Prerender is the phase that moved; on ubuntu-latest Vite (about 70 s) and Pagefind (about 2 min over roughly 32k HTML files) don't change with parallelism or caching. On the 8-core runner the cold Astro build took 4 m 55 s (Vite 38 s, prerender 2 m 57 s, Pagefind 43 s). In the warm re-run on ubuntu-latest the Astro build took 7 m 17 s (Vite 1 m 10 s, prerender 3 m 27 s, Pagefind 2 m). It restored 48,685 of 57,144 routes from the cache (24,057 API reference pages, 24,094 reference .md endpoints and 534 OG images) and re-rendered 8,459, 7,546 of them locale pages. Those routes have no cacheKey and are the floor for a warm build. The cache entry is about 164 MB. main has no Astro cache entry yet, so the first push build after merge is cold and saves the entry that later PR builds restore. An earlier version of this branch, based on release/17.0, measured 447 s and 465 s for warm builds of new commits, so read the warm numbers as a range.

The whole workflow gained less than the build job, because E2E dominates it now. Each of the six Playwright shards downloads the roughly 2.1 GB frontend-dist artifact (about 30 s to 13 min, depending on the run) and then runs Playwright for about 7 to 15 min, which this PR doesn't change. On main pushes ci-gate took 33.5 to 65.2 min over the last 20 (median 43.6 min). With the 8-core build the last shard finished about 37 min after the run started in attempt 1 (one shard spent 10 min installing Playwright Chromium) and about 28 min after in attempt 2, against about 33 and 38 min with the ubuntu-latest build on the previous head. All of these are inside main's existing range, because the faster build only moves the point where the shards start. Speeding up E2E (more workers per shard, a compressed E2E artifact, the 8-core runner for the shards) is left out of this PR because it can affect test reliability or, for the 8-core runner, multiply the larger-runner minutes.

Risks to watch in CI

  • The Bun-runtime build has passed CI on the current head (run 40014533725, cold) and on the previous one (run 39981757109, cold and warm), including the E2E shards on the Bun-built output. If it misbehaves later, fall back to Node for Astro only: change bunx --bun astro build to astro build in the three build* scripts and scripts/build-static-host.mjs.
  • About 8.5k routes (mostly locale pages) have no cacheKey, so they always re-render. That is the floor for a warm build.
  • Frontend Build now depends on the shared aspire-runners group (granted in microsoft/github-operations#1993, and also used by microsoft/aspire). A job whose runner label can't be served waits in the queue, and timeout-minutes only counts once it runs. Over a 12 h sample of microsoft/aspire (74 8-core-ubuntu-latest jobs) the queue time had a median of 5 s, a 95th percentile of 9 s and a maximum of 116 s, so contention looks low, but the sample was small and mostly off-peak. To fall back, change the runs-on line to ubuntu-latest. Larger runners are billed per minute, including in public repositories.
  • PUBLIC_GIT_COMMIT_ID (the merge base with origin/main) is rendered into every page: the footer, the commit link and <meta name="git-commit-id">, and client-side navigation between pages with different IDs falls back to a full page load (deployment-guard.ts). From reading Astro 7.4's incremental build code, I expected the dependency hash to ignore .env-derived values, so a page restored from the cache could keep an older commit ID after main advances. I tested that on a throwaway build: it restored a cache saved for a different commit and built with a new PUBLIC_GIT_COMMIT_ID, and all 32,200 built HTML pages carried the new ID (none kept the old one). Nothing is affected today either way: the CI frontend-dist only feeds E2E and the internal build has no Astro cache. Repeat that check before using the cache in a build that gets deployed, or key the cache on the commit ID.
  • Built HTML is no longer byte-for-byte reproducible between runs: Starlight tab ids (tab-panel-N) depend on which worker renders a page. They stay unique within each page, so nothing breaks, but diffing two builds shows tab-id noise.
  • The internal Azure DevOps build runs frontend.esproj (bun run build), so it needs Bun on its agents. A companion internal PR (Azure DevOps 67205, into deploy) installs the package manager that package.json names (pnpm while main still pins it, Bun once this lands), so it can merge first. A throwaway run of the same install and publish steps on the same internal agent type passed (Bun install, parallel prerender, no drift in the committed .generated output), but the companion PR itself hasn't run in the real pipeline yet.
  • pnpm-only settings were dropped: allowedDeprecatedVersions, peerDependencyRules and the version-pinned release-age excludes. Bun's minimumReleaseAgeExcludes matches names only, and a locked install isn't age-gated.

Third-party links and affiliations

No material affiliation with these projects or organizations to disclose.

Validation

CI on the current head f1a7ba038 (run 40014533725, with Frontend Build on 8-core-ubuntu-latest): every job passed on the first attempt with a cold Astro cache, including Frontend validation (lint, then 81 test files with 1,103 tests passed and 1 skipped), AppHost Build, release-sync-tests, all six Playwright E2E shards (no test failed or needed a retry), the report merge and ci-gate.

On the previous head 5988e6ecd (before the Astro 7.4.2 bump and the item route fix), run 39981757109 also passed, with Frontend Build on 8-core-ubuntu-latest:

  • Attempt 1 (cold cache): every job passed, including Frontend validation (lint, then 80 test files with 1,094 tests passed and 1 skipped), AppHost Build, release-sync-tests, all six Playwright E2E shards, the report merge and ci-gate. One E2E test passed only on its retry: mermaid-navigation.spec.ts Mermaid stays centered and responsive after client navigation in dark mode timed out after 15 s on the tablet project while waiting for the Mermaid SVG to center. It polls client-side rendering, so it looks timing-sensitive on a loaded runner. It didn't retry in any of the last 14 main push runs (84 shard logs), where other tests did in 4 of the 14 (twoslash-navigation and homepage).
  • Attempt 2 (full re-run, exact cache hit): every job passed, including all six E2E shards and ci-gate. No test failed or needed a retry.

On an earlier head 369123798 (before the rebase onto main at 1e4b28d3b and the runner change), run 39804194596 on ubuntu-latest also passed. In attempt 1 (cold cache) only shard mobile-chromium 1/2 failed, with Artifact download failed after 5 retries before it ran any test, and attempt 2 (full re-run) passed every job. No test failed or needed a retry in either attempt.

The E2E test fixed here (live-status.spec.ts, a missing live API stays disabled across navigation and visibility changes until reload) had failed on tablet shard 2/2 of run 39620067289 (the original attempt and both retries) and on an unrelated docs PR's run (39344794778). The failing trace shows the WCP consent banner appearing, the test helper clicking Reject, and the page reloading, which requested /api/live/ a second time. The test now blocks the WCP script. It passed on its first attempt on the desktop, tablet and mobile projects in both attempts on each head above, and in run 39655383949 on the earlier version of this branch. The banner depends on the runner's region, so a few green runs don't prove the fix; the check is that this test stays green across further runs. homepage.spec.ts keeps every dashboard screenshot loaded and fully contained in both themes is a separate known flake that passes on retry (it failed once and passed on retry in runs 39655383949, 39641836015 and 39513380035); it didn't appear in these runs.

Local checks ran on the earlier, release/17.0-based version of this branch with Bun 1.4.3 and Node 24. After the rebases onto main, bunfig.toml, ec.config.mjs, the build* scripts and live-status.spec.ts are identical, the Astro patch only moved to [email protected] with the same content, bun.lock differs by the devalue override ported from #1940 and the Astro 7.4.2 bump, package.json differs by those and by the update:contributors script that main added in #1803, and frontend-build.yml differs only by the runs-on line, so those results still apply (CI repeats the install, lint and unit tests on the current head):

  • bun install --frozen-lockfile: passed, lockfile unchanged.
  • bun run lint: passed (exit 0).
  • bun run test:unit: passed, including the workflow guard tests in build-performance.vitest.test.ts for the cache restore and save steps. CI's Frontend validation passed the same tests on the rebased head.
  • bunx --bun astro sync: passed.
  • bunx --bun astro dev probe: a docs page, a twoslash page and an OG PNG all returned 200.
  • A Bun probe of starlight-links-validator reproduced the path.replace crash without the BASE_URL default and returned the expected slug with it.
  • A throwaway Playwright probe against astro dev (Node): with a stand-in WCP that requires consent, the unchanged test body failed at live-status.spec.ts:83 (Expected: 1, Received: 2, the CI failure), and with the abort line it passed. The changed spec then passed 15 of 15 (five repeats on each of the desktop, tablet and mobile projects).
  • YAML parse of the changed workflows: passed.

On the rebased head I also ran the contributor-list and ts-api-route-catalog unit tests with Node 24 (18 tests passed). The first rebase conflicted only in .agents/skills/update-integrations/SKILL.md and .github/instructions/astro.instructions.md. The second one, onto main at 1e4b28d3b (#1940, a devalue bump), conflicted in pnpm-lock.yaml in the first commit (I kept its [email protected] entries, which [email protected] pins) and in the Bun migration commit, which deletes pnpm-lock.yaml and pnpm-workspace.yaml. There I ported the override to package.json and bun.lock, and bun install --lockfile-only reported no changes.

Output check: on the previous head, I compared the frontend-dist artifact from this PR's cold build (run 39804194596, attempt 1) with the one from the main push build of the PR's earlier base (a62b64bec, sequential, Node). The later commits only change the devalue override and the runs-on line, and I didn't repeat the comparison:

  • Both contain 32,386 HTML pages, and no /_astro/ reference in the HTML dangles.
  • Pagefind reports the same counts.
  • Non-HTML files are byte-identical except six: the Markdown of the two edited community pages, llms-full.txt and llms-small.txt (this PR's docs edits), and rss.xml and the Pagefind entry (hash and commit noise that also differs between two builds of main).
  • Two random samples of 201 and 251 pages have identical visible text. I didn't diff every page.
  • 150 PNG and 1 WEBP originals in _astro/ that no page referenced are no longer emitted.

Not run locally: bun run build (a full site build is too heavy to run locally; CI covers it), the full Playwright E2E suite (CI ran it; locally only the deflaked test ran, against astro dev) and the internal Azure DevOps pipelines.

@aspire-repo-bot

Copy link
Copy Markdown
Contributor

Frontend HTML artifact ready

The latest frontend build uploaded the frontend-dist artifact for PR #1929. Use the VS Code button below to open this PR with GitHub Artifacts Explorer and browse the built HTML locally.

VS Code: Open PR #1929 artifacts

This comment updates automatically when a new frontend build artifact is uploaded.

@IEvangelist
David Pine (IEvangelist) changed the base branch from release/17.0 to main October 22, 2026 15:21
@IEvangelist
David Pine (IEvangelist) force-pushed the ievangelist-incremental-parallel-bun-build branch from a18c440 to 3691237 Compare October 22, 2026 15:22
…ntal builds

Upgrade to Astro 7.4.1 and enable experimental.parallelPrerender (4 workers,
override with ASPIRE_PRERENDER_WORKERS) and incrementalBuild.

- API reference and glossary routes pass package names and indexes in props
  instead of whole documents, so worker-thread prop cloning stays cheap.
- API reference and OG card routes return a cacheKey so unchanged pages are
  reused between builds.
- Patch Astro 7.4.1 so imported SVG components don't break structured clone
  in the prerender worker.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 7fae752f-9a4b-40b9-afa8-fe291e54acb6
The legacy parity check compared every accumulated legacy item and member
with JSON.stringify for each handle, so the test took about 34 s and hit
Vitest's 30 s timeout. Run both comparisons once per module instead. The
checked data is unchanged and the test now takes about 1.6 s.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
Bun 1.4.3 replaces pnpm as the package manager and script runner. The
production Astro build runs on the Bun runtime through bunx --bun astro
build; the dev server, preview, Vitest, ESLint and Playwright stay on Node.

- bun.lock is migrated from pnpm-lock.yaml (all four patches apply).
- Overrides and patchedDependencies move into package.json, allowBuilds
  becomes trustedDependencies and the one-day release age gate moves to
  bunfig.toml. patches/README.md keeps the patch rationale that lived in
  pnpm-workspace.yaml comments.
- Bun has no Node module hooks, so ec.config.mjs imports the
  starlight-plugin-icons TypeScript source natively instead of through tsx.
- Update the scripts, Playwright configs, unit tests, the AppHost
  JavaScript resource and the StaticHost build hint.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
- frontend-build, indexnow and update-integration-data install Bun with
  oven-sh/setup-bun (version read from package.json) and use
  bun install --frozen-lockfile and bun run.
- The build job restores and saves node_modules/.astro with actions/cache
  so experimental.incrementalBuild can skip unchanged pages. The key hashes
  bun.lock, astro.config.mjs and the patches, adds the commit SHA so every
  run saves fresh state, and falls back to the newest matching entry.
  A summary step reports the restored key, exact hit and cache size.
- Profiling builds still run Astro on Node because CPU profiles come from
  Node's inspector.
- The CodeQL pipeline installs the pinned Bun version through npm, the
  dev container uses the Bun feature, and Dependabot tracks the bun
  ecosystem. bun.lock is excluded from the forbidden-words scan.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
- Contributor guide: Bun replaces pnpm as the prerequisite, with a single
  bun install step and a note that other package managers don't use the
  repository's bun.lock or dependency patches.
- Thanks page: drop the pnpm card and note on the existing Bun card that
  it also installs dependencies and builds this site.
- Update CONTRIBUTING, CODESPACES, the Astro instructions, the repository
  agents and the skills to use bun run, bun install and bunx.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
- Bun resolves import.meta.env to process.env, so starlight-links-validator
  read an undefined BASE_URL and crashed in astro:build:done. Set it in the
  Astro config; Node is unaffected because Vite already supplies it.
- Restore the incremental build state on every run but save it only on pushes
  and when a PR build found nothing to restore, so each PR commit no longer
  writes another multi-hundred-megabyte cache entry.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
The geo-dependent WCP consent banner can show on a CI runner. The test helper rejects it, WCP fires onConsentChanged, and Head.astro reloads the page. The reload seeds /api/live/ a second time, so the request-count assertions saw 2 instead of 1 (3 of 3 attempts on one tablet shard, and on unrelated docs branches). Abort the WCP script in this test, as other specs already do, so consent can't reload the page.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
@IEvangelist
David Pine (IEvangelist) force-pushed the ievangelist-incremental-parallel-bun-build branch from 3691237 to f7ab722 Compare October 23, 2026 15:33
The Frontend Build job is the heaviest step of the CI critical path. Run it on the larger runner now that microsoft/aspire.dev has access to the aspire-runners group (microsoft/github-operations#1993). The guard falls back to ubuntu-latest for forks, where the label does not exist. The other jobs stay on ubuntu-latest.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
@IEvangelist
David Pine (IEvangelist) marked this pull request as ready for review October 23, 2026 17:58
Copilot AI balanced review requested due to automatic review settings October 23, 2026 17:58
@IEvangelist
David Pine (IEvangelist) enabled auto-merge (squash) October 23, 2026 17:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The production runtime migration and experimental caching require human sign-off, particularly while internal deployment validation remains pending.

1 open issue
What changed in this PR

This PR accelerates aspire.dev’s static frontend build while keeping the separate hybrid API work out of scope.

Changes:

  • Migrates frontend tooling to Bun while retaining Node for development and tests.
  • Enables parallel prerendering and incremental caching, with smaller route props and an eight-core CI build runner.
  • Updates contributor guidance and automation, speeds up route tests, and isolates a consent-related E2E flake.
File Description
src/​statichost/​StaticHost/​wwwroot/​index.html Updates the placeholder’s build command.
src/​frontend/​tests/​unit/​update-integrations.vitest.test.ts Updates automation assertions for Bun.
src/​frontend/​tests/​unit/​twoslash-types-generator.vitest.test.ts Generalizes a package-manager comment.
src/​frontend/​tests/​unit/​twoslash-blocks-audit.ts Updates the missing-declarations guidance.
src/​frontend/​tests/​unit/​twoslash-audit-dedup.vitest.test.ts Matches the updated audit error.
src/​frontend/​tests/​unit/​ts-api-route-catalog.vitest.test.ts Adapts props checks and removes repeated comparisons.
src/​frontend/​tests/​unit/​contributor-list.vitest.test.ts Matches the Bun regeneration hint.
src/​frontend/​tests/​unit/​build-performance.vitest.test.ts Adds cache workflow guards and Bun assertions.
src/​frontend/​tests/​unit/​api-markdown.vitest.test.ts Resolves indexed member props in tests.
src/​frontend/​tests/​e2e/​live-status.spec.ts Blocks consent-script reloads during request-count testing.
src/​frontend/​src/​utils/​ts-modules.ts Adds module lookup by package name.
src/​frontend/​src/​utils/​ts-api-routes.ts Adds indexed handle-method lookup.
src/​frontend/​src/​utils/​packages.ts Adds package document lookup by name.
src/​frontend/​src/​utils/​og-cache-key.ts Hashes social-card inputs and disk assets.
src/​frontend/​src/​utils/​api-cache-key.ts Adds memoized API document cache keys.
src/​frontend/​src/​pages/​reference/​api/​typescript/​[module]/​index.astro Caches module HTML by document hash.
src/​frontend/​src/​pages/​reference/​api/​typescript/​[module]/​[item]/​index.astro Reduces item props and adds caching.
src/​frontend/​src/​pages/​reference/​api/​typescript/​[module]/​[item]/​[member]/​index.astro Uses indexed member props and caching.
src/​frontend/​src/​pages/​reference/​api/​typescript/​[module]/​[item]/​[member].md.ts Resolves indexed members for cached Markdown.
src/​frontend/​src/​pages/​reference/​api/​typescript/​[module]/​[item].md.ts Loads module data separately and adds caching.
src/​frontend/​src/​pages/​reference/​api/​typescript/​[module].md.ts Caches module Markdown by document hash.
src/​frontend/​src/​pages/​reference/​api/​csharp/​[package]/​index.astro Adds package HTML cache keys.
src/​frontend/​src/​pages/​reference/​api/​csharp/​[package]/​[type]/​index.astro Reduces type props and adds caching.
src/​frontend/​src/​pages/​reference/​api/​csharp/​[package]/​[type]/​[memberKind].md.ts Loads package data for cached member Markdown.
src/​frontend/​src/​pages/​reference/​api/​csharp/​[package]/​[type]/​[memberKind].astro Reduces member-page props and adds caching.
src/​frontend/​src/​pages/​reference/​api/​csharp/​[package]/​[type].md.ts Reduces type Markdown props and adds caching.
src/​frontend/​src/​pages/​reference/​api/​csharp/​[package].md.ts Adds package Markdown cache keys.
src/​frontend/​src/​pages/​og/​[...slug].ts Attaches social-card cache keys.
src/​frontend/​src/​pages/​hub/​glossary/​[term].astro Resolves glossary entries from lightweight identifiers.
src/​frontend/​src/​data/​thanks-license-titles.ts Removes the unused pnpm license entry.
src/​frontend/​src/​content/​docs/​community/​thanks.mdx Credits Bun’s build role and removes pnpm.
src/​frontend/​src/​content/​docs/​community/​contributor-guide.mdx Documents Bun installation and commands.
src/​frontend/​src/​components/​ContributorList.astro Updates the contributor-data regeneration hint.
src/​frontend/​src/​assets/​icons/​pnpm.svg Removes the unused pnpm icon.
src/​frontend/​src/​assets/​icons/​pnpm-light.svg Removes the unused light-theme pnpm icon.
src/​frontend/​scripts/​update-schemas.ts Updates command examples in comments.
src/​frontend/​scripts/​update-samples.ts Updates the branch-override command comment.
src/​frontend/​scripts/​update-release-contributors.ts Updates the usage comment.
src/​frontend/​scripts/​update-integration-data.ps1 Runs data automation through Bun.
src/​frontend/​scripts/​measure-build-output.mjs Fingerprints the Bun lockfile.
src/​frontend/​scripts/​indexnow.ts Updates the usage comment.
src/​frontend/​scripts/​check-data-files.mjs Uses Bun to generate missing data.
src/​frontend/​scripts/​build-static-host.mjs Builds StaticHost assets with Bun.
src/​frontend/​pnpm-workspace.yaml Removes pnpm-specific configuration.
src/​frontend/​playwright.config.mjs Uses Bun for local server preparation.
src/​frontend/​playwright.api-markdown.config.mjs Uses Bun for Markdown test-server preparation.
src/​frontend/​patches/​README.md Records dependency patch purposes and maintenance.
src/​frontend/​patches/​[email protected] Makes SVG metadata transferable between prerender workers.
src/​frontend/​package.json Migrates scripts, dependency policies, and patches to Bun.
src/​frontend/​frontend.esproj Uses Bun for frontend publishing.
src/​frontend/​ec.config.mjs Supports native TypeScript imports under Bun.
src/​frontend/​bunfig.toml Adds a one-day dependency release-age gate.
src/​frontend/​astro.config.mjs Enables build experiments and supplies Bun’s base URL fallback.
src/​apphost/​Aspire.Dev.AppHost/​AppHost.cs Configures the Vite resource to use Bun.
package.json Delegates root commands through Bun.
eng/​pipelines/​azure-pipelines-codeql.yml Installs pinned Bun and frontend dependencies.
CONTRIBUTING.md Updates the local-development command reference.
CODESPACES.md Updates setup and startup guidance.
.gitignore Updates the package-manager comment.
.github/​workflows/​update-integration-data.yml Sets up Bun for data updates.
.github/​workflows/​indexnow.yml Migrates IndexNow setup and execution to Bun.
.github/​workflows/​frontend-build.yml Adds Bun, incremental cache handling, and larger-runner selection.
.github/​instructions/​astro.instructions.md Aligns development guidance with the runtime split.
.github/​github-app.yml Updates the local-build restriction’s command.
.github/​forbidden-words.json Excludes Bun lockfiles from prose checks.
.github/​dependabot.yml Switches dependency updates to the Bun ecosystem.
.github/​agents/​release-verifier.agent.md Updates release-verification commands.
.github/​agents/​community-toolkit-integration-doc-writer.agent.md Updates integration validation commands.
.gitattributes Applies LF handling to Bun lockfiles.
.editorconfig Applies lockfile formatting settings to Bun.
.devcontainer/​devcontainer.json Installs Bun and frontend dependencies.
.agents/​skills/​whatsnew/​SKILL.md Updates build restrictions and ingestion references.
.agents/​skills/​whatsnew/​references/​05-polish.md Updates the ingestion command reference.
.agents/​skills/​whatsnew/​references/​04-validate.md Updates local-build restriction references.
.agents/​skills/​update-samples/​SKILL.md Updates installation and sample-refresh commands.
.agents/​skills/​update-integrations/​SKILL.md Updates data-generation and validation commands.
.agents/​skills/​twoslash-validator/​SKILL.md Updates two-slash validation commands.
.agents/​skills/​doc-writer/​SKILL.md Updates development and integration-check commands.
.agents/​skills/​doc-writer/​references/​testing-your-documentation.md Updates targeted testing examples.
.agents/​skills/​doc-pr-reviewer/​SKILL.md Updates server startup and cleanup references.
.agents/​skills/​code-review/​SKILL.md Updates frontend review commands.

Review effort: Balanced

Update astro, rename its structured-clone patch to match the new version, and refresh bun.lock (astro, @astrojs/telemetry, @astrojs/markdown-satteri, @astrojs/prism). The patch applies unchanged because dist/core/build/prerender-worker.js is identical between 7.4.1 and 7.4.2.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
Item routes passed the whole item through props, so parallel prerender workers rendered from a structured clone. Slug lookup is identity based, so a duplicate handle such as thing-thing-2 fell back to the unsuffixed slug and linked its methods under thing-thing. Pass the item index and read the item from the loaded document instead, as the member routes already do.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
@IEvangelist
David Pine (IEvangelist) merged commit 883a692 into main Oct 26, 2026
19 checks passed
@IEvangelist
David Pine (IEvangelist) deleted the ievangelist-incremental-parallel-bun-build branch October 26, 2026 17:25
David Pine (IEvangelist) added a commit that referenced this pull request Oct 27, 2026
## Summary

Pins `astro` back to 7.4.1 and its matching dependency set
(`@astrojs/telemetry` 3.4.0, `@astrojs/markdown-satteri` 0.4.4,
`@astrojs/prism` 4.1.0). This reverses only the "Bump astro to 7.4.2"
step of #1929; everything else in that PR stays.

The 7.4.2 set was published days ago and isn't yet available from every
package mirror used to build the site, so a frozen install can fail to
resolve it. The 7.4.1 set has been out long enough to resolve
everywhere.

- `src/frontend/package.json`: `astro` range and `patchedDependencies`
key go back to 7.4.1.
- `src/frontend/bun.lock`: the four packages above go back to their
previous resolutions; nothing else in the lock changes.
- `src/frontend/patches/[email protected]`: renamed from
`[email protected]`, content unchanged.
- `src/frontend/patches/README.md`: patch name updated.

Dependabot can propose 7.4.2 again once it has aged.

## Third-party links and affiliations

None.

## Validation

- The diff is the exact reverse of the 7.4.2 bump, and it applied
cleanly on top of current `main`.
- The 987 registry packages in the resulting lock differ from `main`
only in the four packages above. All 987 resolve from the package mirror
used for downstream builds.
- `bun install --frozen-lockfile` with Bun 1.4.3 passes, installs
`[email protected]` and applies the patch.
- The full site build runs in this PR's CI; I did not run a local site
build.

Co-authored-by: David Pine <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 5b3c83c2-1729-4e35-863d-c38bc4e0b41f
David Pine (IEvangelist) pushed a commit that referenced this pull request Nov 5, 2026
## Summary

Follow-up to #1929, carrying over the two items from the review of #1927
(now closed) that still apply to `main`.

- **`@astrojs/markdown-remark` peer range:** Astro 7.4.1 declares
`^7.3.0`, but the site's Markdown processor in `astro.config.mjs` was
pinned to 7.2.1. This bumps it to 7.3.4, which also moves the direct
dependency onto the same `@astrojs/internal-helpers` version as Astro
(0.13.0).
- **Second-build coverage:** nothing tested incremental reuse across
builds. `tests/unit/incremental-build.vitest.test.ts` builds a small
throwaway site several times with the real experimental flags,
`api-cache-key.ts`, `og-cache-key.ts`, patched Astro and the Bun
runtime. It checks:
  - unchanged inputs produce byte-identical output
- a changed API document re-renders only its own HTML and Markdown
routes
  - a changed OG renderer asset re-renders only social cards
  - a new deployment commit re-renders API pages but not social cards
  - a removed document is pruned from `dist` and the page cache
- an imported SVG's image metadata crosses the worker boundary and still
resolves on restored pages

The test takes about 12s and needs `bun` on `PATH`, which the validation
job already provides.

`@astrojs/[email protected]` still depends on its own exact copy of
`@astrojs/markdown-remark` 7.2.1, so two versions stay installed until
`mdx` is updated. The lockfile change also moves the hoisted `acorn`,
`source-map`, `remark-smartypants` and `@astrojs/prism` versions that
the new `markdown-remark` needs; other consumers keep their previous
versions nested.

## Third-party links and affiliations

None.

## Validation

- `bun run build:production`: passed, 32,203 pages built.
- `bun run test:unit`: passed (1163 passed, 1 skipped).
- `bun run lint`: passed.
- `bun install --frozen-lockfile`: passed.
- Confirmed the new test fails when it should, by temporarily removing
the Astro worker patch (`DataCloneError`), dropping `og-image.png` from
the OG key, and removing deployment metadata from the API key.
- Not run: E2E tests, and the test on Linux or Windows. It has only run
on macOS so far.

Co-authored-by: Sébastien Ros <[email protected]>
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.

4 participants