Repository navigation
feat: incremental building - #1211
avivkeller wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1211 +/- ##
==========================================
+ Coverage 93.99% 94.00% +0.01%
==========================================
Files 301 310 +9
Lines 31520 33552 +2032
Branches 3216 3403 +187
==========================================
+ Hits 29627 31542 +1915
- Misses 1871 1986 +115
- Partials 22 24 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
ovflowd
left a comment
There was a problem hiding this comment.
Left a round of review comments. But cool stuff so far ;)
Also please add benchmarks and e2e tests!
|
@avivkeller how does this relate to #1010 |
48fb2ea to
352352d
Compare
|
@bmuenzenmeyer I believe #1010 was the old version of this PR |
352352d to
defddab
Compare
This adds
--experimental-incrementaltodoc-kit generate. With it on, a build reuses what the previous build produced and only redoes what changed. Unchanged output files aren't rewritten, and files whose sources are gone are removed.ast,metadata,jsx-astandjsonkeep each file's result under<output>/.doc-kit/, keyed by a hash of the item and the generator's configuration, and only process the files whose key changed. A result built from a reused one is keyed by that result's key rather than its content, and the output is identical to a full build.htmlre-renders a page when itsjsx-astoutput changes, or when something every page shares does (the component library, client assets, template orhtmlconfiguration).all.htmlre-renders whenever a page in it does.Generators opt in through a new third argument to
generate(incremental.reuseandincremental.partition), documented indocs/creating-generators.md. With the option off, every item is treated as stale, so generators don't need a separate code path. Custom bundlers can returnemittedfrombuildClientso that client files a later build stops writing get removed.Benchmarks
The Node.js API docs (70 files) on an M5 with 4 threads, median of 3 runs:
-t html-t jsonAn unchanged
htmlbuild still bundles the library and client and compiles every page. After an edit, most of the time goes to re-renderingall.html.