fix(docs): use label-based API version mapping in aztec-nr api page#22620
Closed
critesjosh wants to merge 1 commit into
Closed
fix(docs): use label-based API version mapping in aztec-nr api page#22620critesjosh wants to merge 1 commit into
critesjosh wants to merge 1 commit into
Conversation
The useApiVersion hook in the unversioned docs-developers source used the old name-based fallthrough logic, so a future mainnet version cut from this branch would produce links like /aztec-nr-api/v4.2.0/... that 404 (generated docs actually live at /aztec-nr-api/mainnet/...). Align the source with the label-based logic already in use on next, so any future version snapshot cut from this branch picks up the correct mapping (Alpha -> mainnet, Testnet -> testnet).
Contributor
Author
|
handled by #22622 |
auto-merge was automatically disabled
April 17, 2026 01:22
Pull request was closed
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
Mirrors the fix from #22617 (against
next) on thebackport-to-v4-next-stagingbranch, but applied to the unversioned source since this branch does not yet have av4.2.0versioned snapshot.Background
The Aztec.nr API reference page in v4.2.0 on
nextshipped with the pre-mainnetuseApiVersionlogic — links pointed to/aztec-nr-api/v4.2.0/...instead of/aztec-nr-api/mainnet/...and 404'd on the live site. The root cause onnextwas a stale versioned snapshot, already patched in #22617.On this branch,
docs-developers/docs/aztec-nr/api.mdxstill has the same stale name-baseduseApiVersion:If a mainnet version gets cut from this branch, the new snapshot would inherit the same bug. Pre-empting that here.
Fix
Replace
useApiVersionwith the label-based mapping that already lives onnext:The
Alpha (...)label comes fromdocusaurus.config.jsfor mainnet-mapped versions, souseApiVersion()resolves to"mainnet"for any future v4.2.0+ snapshot cut from this branch.Test plan
yarn startlocally on this branch and verify the Aztec.nr API Reference page renders without broken links on the current (dev) version.