Skip to content

reference: flip API docs to grouped multi-symbol pages#3321

Merged
bartlomieju merged 2 commits into
mainfrom
reference-redirect-plumbing
Jun 18, 2026
Merged

reference: flip API docs to grouped multi-symbol pages#3321
bartlomieju merged 2 commits into
mainfrom
reference-redirect-plumbing

Conversation

@bartlomieju

@bartlomieju bartlomieju commented Jun 18, 2026

Copy link
Copy Markdown
Member

This is the heart of the reference rearchitecture, building on the
grouping engine landed in #3320. It regroups @deno/doc's ~11,000
per-symbol pages into ~100 grouped pages.

What changes

  • reference.page.ts now generates one page per Deno/Web category and per
    Node module, with every symbol documented inline under a stable anchor.
  • /api/<kind>/ becomes a dense, find-in-page-friendly index of every
    symbol with a one-line description.
  • /api/ becomes a tile hub across Deno, Web, and Node.
  • the hand-written landing guides move to /api/<kind>/about/.
  • every old per-symbol URL is emitted into _site/api/_redirects.json;
    the redirects middleware (wired up in the first commit of this PR)
    serves those 301s. The hardcoded /api/ -> /api/deno/ redirect is
    removed so the new hub shows.
  • the Orama search index points at the new anchored URLs.

This PR folds in the redirect-middleware plumbing that was briefly its own
change, since a no-op plumbing PR on its own wasn't worth the review
overhead - it only has meaning alongside this flip. The genuinely
separable piece, the grouping engine, already landed and was reviewed on
its own in #3320.

Verification

  • reference build is green (105 pages).
  • the redirect map has 11,222 entries and every target resolves to a
    real page and a real anchor
    (0 broken), checked exhaustively.
  • /api/ serves the hub, /api/deno/ serves the dense index, and old
    per-symbol URLs 301 to their exact anchor (verified end to end through
    the middleware).
  • the about pages build alongside the dense indexes.
  • the grouping engine's unit tests (from reference: add the API doc grouping engine with tests (dormant) #3320) and the full suite pass.

Known follow-ups (separate polish PRs)

  • Temporal symbols carry no category tag in the doc data, so their sidebar
    entry links to a page that isn't generated; needs a categorization
    fallback or upstream tags.
  • some overloaded-method summary anchors use @deno/doc's per-method index
    rather than its global one, so they don't scroll (same-page, pre-existing
    upstream, no 404).

Screenshots

API hub:

hub

Dense Deno index:

deno index

A Node module page:

node http

Second slice of the reference rearchitecture. The redirects middleware
now also loads _site/api/_redirects.json - the old-per-symbol-URL to
new-anchor map produced by the grouping work - and merges it ahead of the
existing redirects.

The file is not generated yet (a later slice produces it), so this is a
no-op today: the middleware logs that it is absent and carries on. Once
the page-generation flip lands and the map exists, the 11k old reference
URLs start 301ing to their new anchors with no further middleware change.

Verified in isolation: with a sample map present the handler returns 301
to the mapped anchor (including the trailing-slash variant) and passes
non-redirect requests through untouched.
Wires the grouping engine (landed in #3320) into page generation, so the
reference ships ~100 grouped pages instead of ~11,000 per-symbol ones.

- reference.page.ts now builds one page per Deno/Web category and per Node
  module, a dense find-in-page index per API kind at /api/<kind>/, and the
  /api/ tile hub, all from buildReference's output.
- the old hand-written landing guides move to /api/<kind>/about/.
- every old per-symbol URL is emitted into _site/api/_redirects.json; the
  middleware (wired up in the previous commit) now serves those 301s, and
  the hardcoded /api/ -> /api/deno/ redirect is removed so the new hub
  shows.
- the Orama search index points at the new anchored URLs.

Verified: reference build is green (105 pages), the redirect map is
complete and every one of its 11,222 targets resolves to a real page and
anchor, /api/ serves the hub while old symbol URLs 301 to their anchors,
and the about pages build alongside the dense indexes.

Known follow-ups (separate PRs, pre-existing or cosmetic): Temporal
symbols lack category tags so their sidebar entry is orphaned; some
overloaded-method summary anchors use @deno/doc's per-method index rather
than its global one.
@bartlomieju bartlomieju changed the title reference: load the API redirect map in the redirects middleware (no-op) reference: flip API docs to grouped multi-symbol pages Jun 18, 2026
@bartlomieju bartlomieju merged commit 80ecbac into main Jun 18, 2026
3 checks passed
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.

1 participant