Skip to content

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

Open
ovflowd wants to merge 1 commit into
perf/stream-htmlfrom
refactor/html-all
Open

ovflowd wants to merge 1 commit into
perf/stream-htmlfrom
refactor/html-all

Conversation

@ovflowd

@ovflowd ovflowd commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

This PR moves all.html, every module page's content on one page, out of html and into a new generator of @node-core/doc-kit, html-all. It's the sixth part of a stack that splits #1205.

It's Node.js's, so doc-kit itself shouldn't need to know about it, but html built it in behind generateAllPage, and the streaming work spread its bookkeeping through generate.mjs.

  • html-all is 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 head 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. On Node.js's docs the worker rendering all.html went from 330-388MB to 176-189MB live.
  • generateAllPage is removed, which is a breaking change for @doc-kit/generator-react. Builds that want all.html add the html-all target, as CI's e2e build now does (-t web -t html-all). Node.js's config (doc: move to redesign node#66713) needs it in target too.

Validation

Added tests for html-all (all.html right after its last part in sidebar order, and after every page given at once as with one thread), and for html assembling a page from its parts' content, numbering their ids across parts, and importing no component into it whatever the components are named. With the html-all target added, 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.

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>
@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 3, 2026 7:36pm 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.22078% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.64%. Comparing base (65d6aeb) to head (a21e714).

Files with missing lines Patch % Lines
packages/node/src/html-all/generate.mjs 96.84% 3 Missing ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           perf/stream-html    #1242      +/-   ##
====================================================
+ Coverage             94.61%   94.64%   +0.03%     
====================================================
  Files                   295      297       +2     
  Lines                 31659    31876     +217     
  Branches               3227     3243      +16     
====================================================
+ Hits                  29953    30168     +215     
- Misses                 1684     1686       +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

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 ↗ a21e714 2026-11-03T19:35:18.880Z View logs ↗

@ovflowd
ovflowd marked this pull request as ready for review November 3, 2026 20:39
@ovflowd
ovflowd requested a review from a team as a code owner November 3, 2026 20:39

This branch was successfully deployed

1 active deployment
Preview – api-docs-tooling — a21e7141 Deployed Nov 3, 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.

1 participant