Repository navigation
fix: rebuild pages whose navigation changed under incremental builds - #308
Merged
Merged
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-incremental-nav-cache-key.nimbus-docs.com (commit c29ffa5)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With Astro's
experimental.incrementalBuild, a docs page was keyed on its own file only. Renaming, adding or removing a sibling left every other page's sidebar, breadcrumbs and prev/next links stale, because Astro only tracks the content entries a page renders, not the ones it reads titles from.cacheKeynow covers the entry's digest and a digest of the collection's navigation tree. A sibling's rename rebuilds the pages that show it; a body edit still rebuilds only that page.Nothing changes on sites without the flag.
Before → after
No config, API, type or user-owned file changes. A route that draws from other inputs appends its own digest, as the helper's JSDoc now shows:
Checks
pnpm --filter @cloudflare/nimbus-docs typecheck: passpnpm lint: passtest/incremental-build.test.ts(four builds of one site: cold, a body edit, a sibling's rename, no change): pass. Onmainit fails at the rename step, where every page is restored from cache with the old title.pnpm --filter @cloudflare/nimbus-docs test: 3,215 pass, 1 fail. The failure iscontent-sources-snapshots.test.ts"a repository that needs credentials … never prompts", which times out identically onmainin this environment.Not in this PR
.mdpartial shown throughRenderhas no render hash in Astro, so its edits don't rebuild the pages that include it; MDX partials do.