fix(docs): use router Link for landing nav to avoid full-page reload#16
Merged
Conversation
Landing links to /docs were plain <a> tags, forcing a full document navigation on click. In production this also incurred a 307 redirect from Cloudflare Assets canonicalizing /docs to /docs/, making the flash visible. Switch internal links to TanStack Router <Link> so the transition stays client-side, and add the trailing slash so direct loads skip the 307 as well. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Preview releaseLatest commit: No packages have been released. |
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
/docswere plain<a>tags, causing a full document navigation on click — visible as a flash on production.307 /docs → /docs/(Cloudflare Assets canonicalizing the URL againstdist/client/docs/index.html), adding a round-trip on top of the full reload and triggering a cascade of304revalidations for assets the browser already had cached.<Link>so the transition is 100% client-side. WithdefaultPreload: "intent"already set inrouter.tsx, the splat loader is prefetched on hover./docs/with trailing slash so direct loads / crawlers / shared links also skip the 307.External links (Changelog → GitHub releases) stay as
<a target="_blank">.Test plan
pnpm --filter docsite tsc --noEmitpasses (also via lefthook pre-commit)pnpm --filter docsite buildcompletes — prerender unchangedpnpm --filter docsite preview→ click each landing link (Docs, API, Guides, hero "Read the docs", close "Read the docs") → no flash, URL bar shows trailing-slash variant, no 307 in Network tab🤖 Generated with Claude Code