⬆️ Upgrade @deno/doc to 0.199.0 (native v2 migration)#1204
Merged
Conversation
commit: |
This was referenced Jul 5, 2026
Bumps `@deno/doc` 0.188.0 -> 0.199.0 and `@deno/graph` 0.89.0 -> 0.100.1, and aligns the www CI job to Deno v2.9.1 (matches #1202). `@deno/doc` >= 0.195.0 replaced the flat v1 `DocNode[]` model with the v2 `Document`/`Symbol`/`Declaration` model. The docs-rendering pipeline is migrated to consume it natively: - `doc()` returns `Record<url, Document>`; `Document.symbols` group declarations by name. `DocPageSection` holds a raw `Declaration`; render helpers receive the owning symbol via `type SymbolInfo = Omit<Symbol, "declarations">` (`extract(declaration, symbol)`, `Type({ declaration, symbol })`, `exportHash(declaration, symbol, i)`). - `.def` replaces the per-kind def fields; `ClassMethodDef.def`; every `TsType*Def` payload is `.value`; namespace members recurse over `NamespaceDef.elements` (member Symbols). - `kind === "import"` checks dropped; `Uint8Array` cast in blog-image-route.ts. Note: `@deno/doc` 0.200.0-0.202.0 ship broken wasm bindings that fail to instantiate under Deno (`__wbindgen_placeholder__`), so 0.199.0 is the newest usable v2 release.
3cecf91 to
f0719fa
Compare
cowboyd
approved these changes
Jul 5, 2026
cowboyd
left a comment
Member
There was a problem hiding this comment.
I opened it up and browse the API docs. All the links I checked seem to work. It wasn’t exhaustive but hopefully representative.
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.
Motivation
The docs site generates its API Reference with
@deno/doc, pinned at 0.188.0.@deno/doc≥ 0.195.0 replaced the flat v1DocNode[]model with a v2Document/Symbol/Declarationmodel, so staying current means migrating the rendering pipeline. This PR does that migration natively — no compatibility shim — so the codebase speaks v2 directly.It also fixes a latent bug the version bump surfaces: v2 changed
Location.linefrom 1-indexed to 0-indexed (deno_doc #150/#777), but the "View code" links feed it straight into GitHub's 1-indexed#L<n>anchor, so every source link pointed one line above the symbol's declaration.Base of a 2-PR stack; #1205 (experimental APIs) stacks on this.
Approach
Two commits.
⬆️ Upgrade + native v2 migration —
@deno/doc0.188.0 → 0.199.0,@deno/graph0.89.0 → 0.100.1, and thewwwCI job to Deno v2.9.1 (matches #1202). The pipeline consumes v2 directly:doc()returnsRecord<url, Document>;Document.symbolsgroup declarations by name.DocPageSectionholds a rawDeclaration; render helpers take the owning symbol viatype SymbolInfo = Omit<Symbol, "declarations">—extract(declaration, symbol),Type({ declaration, symbol }),exportHash(declaration, symbol, i)..defreplaces the per-kind def fields;ClassMethodDef.def; everyTsType*Defpayload is.value; namespace members recurse overNamespaceDef.elements(memberSymbols).kind === "import"checks;Uint8Arraycast inblog-image-route.ts.🐛 Fix off-by-one in "View code" source links — add
+ 1where the GitHub#Lanchor is built, inpackage.tsandpackage/node.ts. Verified:runis declared on source line 32 and the link points to#L32(was#L31, landing on the*/above it).Validation
Ran the site locally: API pages (
/api/v4/run,/api/v4/call,/api/v3/spawn) render identically to before;/x/websocketand/x/stream-helpersexercise thepackage/node.tspath; therunsource link verified at the correct line.deno fmt --check,deno lint, anddeno check main.tsxpass.