core: incremental generation against an existing output (`--incremental`)
メンテナーはふだん 3 日以内に返信
@avivkeller がすでに取り組んでいます。
2026年10月26日 から。
評価
この issue はまだ評価されていません。
説明
Hey folks 👋
Summary
doc-kit generate --incremental would make a build against an existing output only redo what changed in --input since that output was produced. The output itself would record what it was built from, so the next build can tell which pages are stale and leave the rest alone, a bit like ISR does for static pages.
doc-kit generate -i 'doc/api/*.md' -t web -o out/ --incremental
Why
Every build regenerates everything today, even for a one-line change: on the Node.js docs, every target, all 782 pages, the search index and the sitemap. That costs build time on every commit, and it means every file gets rewritten and redeployed, so caches and CDNs can't tell what actually changed.
Proposal
A manifest that travels with the output
Write a small manifest next to the output (e.g. out/.doc-kit/manifest.json) recording:
- a salt: the doc-kit version and a hash of the resolved configuration, including the changelog,
index.mdand the type map - a content hash for every input file
- for every output file: which inputs produced it, and its own hash
With --incremental, doc-kit reads that manifest from --output and compares it with the current inputs:
| Situation | What happens |
|---|---|
| No manifest, or it can't be read | Full build (never a wrong output) |
| Salt differs (config, version, type map, ...) | Full build |
| Some inputs changed or were added | Their pages are rebuilt, plus the outputs that combine every page |
| An input was deleted | Its outputs are removed |
| Nothing changed | Nothing is rewritten |
Some outputs fold in every page and have to be rebuilt whenever anything changes: all.html, all.json, sitemap.xml, llms.txt, llms-full.txt and orama-db.json. Headings matter too: if a changed file's headings changed, every page's sidebar changed with them.
Unchanged files should not be rewritten at all, so their modification times stay stable for whatever deploys or caches them.
What reruns no matter what
Aviv's #1010 already found the honest floors here: parsing and metadata extraction are about as fast as reading a cache, so they rerun every time; all.html is rebuilt whenever anything changed; and the client bundle always rebuilds, because building it from a partial set of pages changes its chunk hashes. What incremental builds can save is mostly per-page work: on the Node.js docs, jsx-ast (~3.5s with 4 threads) and rendering (~1.5-2s), out of a ~7-9s web build.
Relation to #1010
#1010 does incremental builds with a separate content-addressed cache (node_modules/.cache/doc-kit), which is great when that folder survives between runs. Anchoring the manifest on the output instead means it also works when all you have is the previous build's output, e.g. a deployed site or a CI artifact, with no extra cache to restore. Both could share the same machinery. #1010 has been idle since August and predates the package reorganisation, so this issue could track picking it back up in either form.
Prerequisites
- Byte-identical output between builds. Comparing hashes only works if an unchanged input gives the same output every time. Today the output order depends on which worker finishes first (#1183), and
orama-db.jsonchanges on every build (#1184). - An output abstraction, if the output isn't a folder (see #1188): the manifest has to be read from and written to wherever
--outputpoints.
Acceptance criteria
- A second
--incrementalbuild with no changes rewrites nothing and leaves the output byte-identical. - Changing one Markdown file rewrites only its pages and the combined outputs.
- Deleting an input removes its outputs.
- A config or doc-kit version change, or a missing manifest, triggers a full build.
- An incremental build's output is byte-identical to a full build's.
References
- #1010: incremental builds with a separate cache, plus its documented limits
- #1183, #1184: deterministic output
- Eleventy's
--incremental: rebuilds a changed template and whatever depends on it, and does a full build when the config changes - Jekyll's incremental regeneration: a
.jekyll-metadatafile of dependencies; it misses pages that list other pages, which is our sidebar problem - Sphinx: only re-reads new or changed sources, keeping its parsed environment next to the build output
- Next.js Incremental Static Regeneration: regenerates single static pages instead of rebuilding the site
- 主要言語
- JavaScript
- スター
- 70
- フォーク
- 79
- 平均マージ
- 2日 12時間
- マージ済み PR(30日)
- 53
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/doc-kit のほかの issue
-
addon-verify: re-indents the test.js it generates対応中かも @Mittalnew が今日担当しました。 オープンgood first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nodejs/doc-kit#1199 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 68/100
nodejs/doc-kit#1085 · コメント 6 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
nodejs/doc-kit#1054 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
good first issue help wanted Web Generator
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
メンテナーはふだん 3 日以内に返信
-
sitemap: lists the index page twice when index.md is an input対応中かも @helmipradita が今日担当しました。 オープンgood first issue help wanted Web Generator
難易度 2/5 1〜3時間 初心者へのやさしさ 1/100
メンテナーはふだん 3 日以内に返信
似ている issue
-
44-x-y bug :beetle:
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
electron/electron#55528 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
react/react-native#59699 ·
メンテナーはふだん 2 日以内に返信
-
status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
mastra-ai/mastra#29053 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
fjaeckel/seriesoftubes#230 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信