Skip to content

refactor: move all.html into a Node.js generator - #1242

Merged
avivkeller merged 8 commits into
mainfrom
refactor/html-all
Nov 28, 2026
Merged

avivkeller merged 8 commits into
mainfrom
refactor/html-all

Conversation

@ovflowd

@ovflowd ovflowd commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

This PR moves all.html out of html and into html-all, a new generator in @node-core/doc-kit: it's Node.js's page, so doc-kit itself shouldn't need to know about it. It's part of the stack that splits #1205.

  • html-all is spliced between jsx-ast and html. It adds all.html's metadata to the manifest and, right after the last module page, all.html itself as a composed page of them, in the manifest's order.
  • html renders a composed page (an item with parts) from its parts' compiled content, one part at a time. The worker rendering all.html went from 330-388MB to 176-189MB.
  • generateAllPage is removed, which is a breaking change for @doc-kit/generator-react. Builds that want all.html add -t html-all, as CI's e2e build, the preview builds and the benchmark now do. Node.js's config needs it too (doc: move to redesign node#66713).
  • @node-core/doc-kit takes @doc-kit/generator-react as an optional peer, as core does, so users of only man-page or api-links don't install it.

Validation

Added tests for html-all (all.html right after its last part, and after every page given at once, as with one thread), and for html assembling a composed page from its parts. With -t html-all, the output on 12 of Node.js's API docs is byte-identical to main's, all.html included, at 1 and 4 threads.

Related Issues

Refs: #1205

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format:check & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-docs-tooling Ready Ready Preview Nov 28, 2026 9:50pm UTC

Request Review

@ovflowd
ovflowd added this pull request to stack #1244 November 3, 2026 19:34
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.69512% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.99%. Comparing base (caba57a) to head (9192e1b).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
scripts/benchmark.mjs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1242      +/-   ##
==========================================
+ Coverage   93.96%   93.99%   +0.02%     
==========================================
  Files         298      301       +3     
  Lines       31346    31519     +173     
  Branches     3198     3216      +18     
==========================================
+ Hits        29455    29626     +171     
- Misses       1869     1871       +2     
  Partials       22       22              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 9192e1b 2026-11-28T21:50:49.940Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 25c110d 2026-11-28T21:29:34.345Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 4560091 2026-11-28T03:28:44.261Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ dffb2f0 2026-11-27T20:16:34.390Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 1748d69 2026-11-27T19:50:01.347Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 4607cb3 2026-11-23T18:18:43.792Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 6161190 2026-11-20T21:46:41.225Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 89a3322 2026-11-18T03:38:50.058Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ f64aca9 2026-11-17T14:45:11.643Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 16acb7e 2026-11-13T16:49:45.010Z View logs ↗

View all previews: View all previews ↗

Comment thread packages/node/src/html-all/generate.mjs Resolved
Comment thread .changeset/html-all.md Resolved
Comment thread packages/react/src/html/generate.mjs Resolved
Base automatically changed from perf/stream-html to main November 28, 2026 03:27
all.html, every module page's content on one page, is Node.js's, but
html built it in, behind generateAllPage, and the streaming work spread
its bookkeeping through generate.mjs.

It's now a generator of @node-core/doc-kit, html-all, spliced between
jsx-ast and html the way section-pages is between metadata and jsx-ast.
It passes the pages on, adds all.html's metadata to the manifest, and
right after the last module page adds all.html as a page made of
theirs, in sidebar order. html only knows that an item with parts, the
pages before it that it's made of, is compiled from their content and
rendered first, one part at a time instead of building every part's
elements before rendering any; generateAllPage goes away. Built with
the Node.js preset and the html-all target, the Node.js API docs come
out byte-identical, all.html included, at 1 and 4 threads.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Sonnet 5.5 <noreply@anthropic.com>
…t lives

The code and types already called it a composed page, while the docs,
comments and tests said a page made of other pages. They all say
composed page now.

html-all no longer adds all.html at the end when no manifest came, as
jsx-ast always sends one, and each page it lists arrives. html's test
of the bundles' timing no longer gives it all.html, whose place
html-all's tests check, the composed page's program test only checks
what it imports, as html's tests render one, and html's tests build
all.html's metadata with createSyntheticHead.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
As jsx-ast and html, html-all always gets an async iterable now, so it
drops toBatches and takes only that type. Its test gives the one-thread
input with once, and reads the output with Array.fromAsync.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Since the layer below, jsx-ast's manifest lists the pages in the order
the site does, so html-all takes all.html's parts in that order instead
of sorting them with headingSortFn, which the react package no longer
exports.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
As in html's tests since the layer below: html-all reads its input with
for await, which takes an array as well, so its test doesn't need a
copy of once.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
…-react optional for html-all

The beta deployment and the Vercel build name their targets, so they
stopped building all.html once html no longer did it by default: they
now add html-all, as CI's e2e build does, and so does the benchmark's
section-pages target, so its numbers stay comparable.

html-all only names generator-react's jsx-ast and html, which core
resolves, and imports its types, so @node-core/doc-kit takes it as an
optional peer, as core does, instead of installing it for every user of
man-page or api-links. The README and the package description list the
fourth generator.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

api-links Generator

Performance estimate (single CI run)

  • Generation time: 56.6% faster (1.29 s → 560.00 ms)
  • Peak memory: 2.2% higher (274.62 MB → 280.57 MB)

json Generator

Performance estimate (single CI run)

  • Generation time: 6.5% slower (6.62 s → 7.05 s)
  • Peak memory: 0.5% lower (921.63 MB → 917.30 MB)

legacy-html Generator

Performance estimate (single CI run)

  • Generation time: 18.9% faster (12.47 s → 10.11 s)
  • Peak memory: 4.4% lower (1.40 GB → 1.34 GB)

legacy-json Generator

Performance estimate (single CI run)

  • Generation time: 22.0% faster (7.73 s → 6.03 s)
  • Peak memory: 2.5% lower (939.25 MB → 916.05 MB)

llms-txt Generator

Performance estimate (single CI run)

  • Generation time: 16.7% faster (8.75 s → 7.29 s)
  • Peak memory: 1.4% lower (913.96 MB → 900.71 MB)

orama-db Generator

Performance estimate (single CI run)

  • Generation time: 41.6% slower (4.57 s → 6.47 s)
  • Peak memory: 12.8% lower (1.12 GB → 998.91 MB)

web Generator

Output size: 1 file changed · net -35.00 MB

File size details
File Main PR Change
all.html 35.00 MB — -35.00 MB (-100.0%)

Performance estimate (single CI run)

  • Generation time: 18.4% faster (14.97 s → 12.21 s)
  • Peak memory: 0.7% lower (1.77 GB → 1.75 GB)

…f html

From the review, which asked whether rendering a composed page first was
about html-all. It was: it assumed the composed page is all.html, the
slowest page. html-all already sends it right after its last part,
ahead of the section pages, and the site build takes the same time
either way (7.52s against 7.54s at 4 threads, 6.42s against 6.41s at
6), so it now waits its turn like any page, and the channel loses
prepend, which nothing else used.

html's README and tests no longer describe all.html as html's own: the
canonical URL and root rules are about synthetic pages, and the tests
use a composed page of their own. The changeset bumps core as a patch,
as it only adds the html-all shorthand.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
From the review, as the other Node.js generators keep theirs in a
constants.mjs.

Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
@avivkeller
avivkeller merged commit b382b73 into main Nov 28, 2026
26 checks passed
@avivkeller
avivkeller deleted the refactor/html-all branch November 28, 2026 21:52
@github-actions github-actions Bot mentioned this pull request Nov 28, 2026

This branch was successfully deployed

1 active deployment
Preview – api-docs-tooling — 9192e1b8 Deployed Nov 28, 2026 by vercel[bot]
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.

3 participants