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.77% 94.16% +0.39%
==========================================
Files 289 296 +7
Lines 28813 30196 +1383
Branches 2913 3055 +142
==========================================
+ Hits 27018 28433 +1415
+ Misses 1773 1740 -33
- Partials 22 23 +1 ☔ 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!
| for await (const chunk of worker.stream(modules, dependencies)) { | ||
| const { fresh, stale } = incremental.partition(modules, { | ||
| /** | ||
| * |
| * @param {(item: T) => string | Array<string>} [options.files] | ||
| * @returns {{ fresh: Array<T>, stale: Array<T> }} | ||
| */ | ||
| partition(items, { key, files } = {}) { |
There was a problem hiding this comment.
part of me feels this needs polishing/using fs mid this unsure how I feel about it. Should have also failsafe mechanisms.
| @@ -0,0 +1,308 @@ | |||
| 'use strict'; | |||
There was a problem hiding this comment.
Parts of this file could benefit from some refactoring/cleanup.
| // declared one | ||
| partition<T>( | ||
| items: Array<T>, | ||
| options?: { |
There was a problem hiding this comment.
dedicated type for options pretty please
| */ | ||
| const holds = async (file, data) => { | ||
| try { | ||
| return (await fs.readFile(file)).equals(Buffer.from(data)); |
This adds
--experimental-incrementaltodoc-kit generate. With it on, a build looks at what the previous build produced and only redoes what changed:htmlrenders only the pages whose inputs changed,jsonbuilds only the modules whose entries changed, unchanged files keep their modification times, and files whose inputs are gone get deleted.