Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## perf/stream-html #1242 +/- ##
====================================================
+ Coverage 94.52% 94.55% +0.03%
====================================================
Files 295 297 +2
Lines 31057 31220 +163
Branches 3173 3187 +14
====================================================
+ Hits 29357 29521 +164
+ Misses 1678 1677 -1
Partials 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
View all previews: View all previews ↗ |
ovflowd
marked this pull request as ready for review
November 3, 2026 20:39
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 4, 2026 18:24
a21e714 to
529d486
Compare
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 6, 2026 13:37
529d486 to
6f084a9
Compare
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 6, 2026 19:31
6f084a9 to
62872b1
Compare
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 6, 2026 19:43
62872b1 to
78ab04c
Compare
AugustinMauroy
approved these changes
Nov 8, 2026
avivkeller
force-pushed
the
refactor/html-all
branch
from
November 9, 2026 02:26
78ab04c to
0931ca2
Compare
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 9, 2026 10:37
0931ca2 to
822cbaf
Compare
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 9, 2026 11:03
822cbaf to
a8bfd7f
Compare
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 9, 2026 13:25
a8bfd7f to
54e59de
Compare
This was referenced Nov 9, 2026
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 10, 2026 20:53
54e59de to
71861b9
Compare
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>
ovflowd
force-pushed
the
refactor/html-all
branch
from
November 11, 2026 00:06
71861b9 to
78217c5
Compare
This branch was successfully deployed
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.
Description
This PR moves
all.html, every module page's content on one page, out ofhtmland 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-kititself shouldn't need to know about it, buthtmlbuilt it in behindgenerateAllPage, and the streaming work spread its bookkeeping throughgenerate.mjs.html-allis spliced betweenjsx-astandhtml, the waysection-pagesis betweenmetadataandjsx-ast. It passes the pages on, addsall.html's metadata to the manifest, and right after the last module page addsall.htmlas a composed page of them, in sidebar order. jsx-ast always sends the manifest, and every page it lists arrives, so there's no fallback for a run without one.htmlonly knows that a composed page, an item withparts, the pages before it whose content it shows, 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 renderingall.htmlwent from 330-388MB to 176-189MB live.generateAllPageis removed, which is a breaking change for@doc-kit/generator-react. Builds that wantall.htmladd thehtml-alltarget, as CI's e2e build now does (-t web -t html-all). Node.js's config (doc: move to redesign node#66713) needs it intargettoo.Why it's built this way
Why a generator instead of the
generateAllPageoption?all.htmlis Node.js's page, butgenerateAllPagedefaulted totrue, so every site built with@doc-kit/generator-reactgot one, doc-kit's own site included (www/doc-kit.config.mjstargetshtml). As a generator it sits in@node-core/doc-kitnext toman-pageandapi-links, andutils/all.mjsgoes. Counting code only, without tests and docs, it's +173/-109.Why not keep
generateAllPageas a deprecated alias?htmlcan't importhtml-all, because@node-core/doc-kitnow depends on@doc-kit/generator-react. The alias would have to live in core and turn the option into anhtml-alltarget. With the default attrue, everygenerator-reactsite would then need@node-core/doc-kitinstalled, and flipping the default breaks things anyway.@doc-kit/generator-reactis 0.5.3, so this is a minor bump.Why splice it in front of
htmlinstead of running it after?htmlis terminal. It writes to disk and returns nothing, so a generator after it has nothing to read. Buildingall.htmlinjsx-astwould build every module's JSX a second time. Spliced in withdependent,html-allkeeps only each module page'sdataandheadings, never its content, andhtmlcompilesall.htmlfrom the programs it already compiled. Onlyhtmlknows where it wrote each of those, which is why the page importing them is compiled there; its code no longer special-casesall.html.Why right after the last module page, and not at the end? On Node.js's docs,
section-pagespasses the entries of the 69 module pages through as they come, and the ~720 section pages after them (795 pages in all).html-allusesjsx-ast's manifest to know when the last module page is through, soall.htmlgets compiled and put at the front of the render queue (as onmain) while the section pages are still being built. For that the manifest has to come early: on #1241,jsx-astnow describes its pages ahead ofworker.stream, so the manifest goes out once the input ends rather than with the last 12-18 page chunks. With one threadhtml-allgets every page at once, soall.htmlsimply goes after them. On Aviv's 2d41aa7,htmlcollects and sorts every page before compiling any, so whereall.htmlarrives wouldn't matter there.Why does a
refactor:PR change howall.htmlrenders?<>{content0()}{content1()}…</>created every part's elements before rendering any of them. render-to-string keeps a fragment's children on their parent, but not a single element, so with each part rendered through a component that returns one element, its tree can be freed once it's rendered. The output stays identical, ids included, becauseuseIdcounts in the same order. It lives here and not in #1241 because it rewrites the samepartsbranch this PR makes generic. A composed page also stops scanning its program for component names, which would take the new wrappers for configured components with the same names.Why does Node.js have to add
html-all? Theweb.doc-kit.config.mjsin nodejs/node#66713 targetslegacy-json-all,section-pagesandllms-txtand dropslegacy-html-all, soall.htmlcan only come fromhtml. Withouthtml-allintarget, that PR'stest/doctool/test-docs.mjsfails withall.html was not generated, and its Makefile listsout/doc/api/all.htmlas an output. The fix is one line intarget.Benchmarks
Full Node.js docs on Node 26, medians of 5 interleaved runs, peak = RSS summed over the process tree. Site build =
-t orama-db -t json -t llms-txt -t section-pages, plus-t html-allhere. #1241 builds the sameall.htmlthroughgenerateAllPage.-pmainAgainst #1241 the peak is the same and time is flat at 4 threads. At 6 it's 0.27s slower in this round; two earlier sets of runs on the same change, before #1241's manifest fix, had it at +2% (about 0.1s) at 6 threads and +0-1% at 4.
-p 1under--max-old-space-size=512: the site build passed all 11 runs at ~1000MB peak (912 to 1063MB), whilemainhit V8's out-of-memory abort in 1 of 8 runs and the commit before perf: let worker.stream take chunks as they arrive #1237 in 3 of 5. Passing still depends on GC timing, as perf: keep memory use down at low thread counts #1179 found. The legacy build passed 3 of 3 on both, 877MB vs 885MB.Validation
Added tests for
html-all(all.htmlright after its last part in sidebar order, and after every page given at once as with one thread), and forhtmlassembling a composed page from its parts' content, numbering their ids across parts, and importing no component into it whatever the components are named. With thehtml-alltarget added, the output on 12 of Node.js's API docs is byte-identical tomain's,all.htmlincluded, at 1 and 4 threads.Related Issues
Refs: #1205
Check List
node --run testand all tests passed.node --run format:check&node --run lint.