Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## perf/stream-cache #1239 +/- ##
=====================================================
+ Coverage 94.34% 94.36% +0.02%
=====================================================
Files 293 293
Lines 30157 30292 +135
Branches 3068 3087 +19
=====================================================
+ Hits 28451 28586 +135
Misses 1684 1684
Partials 22 22 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
runGenerators collected every requested generator's output into the
arrays it returns, though neither generate nor preview reads them. With
{ results: false } it drains them instead: each generator still runs to
its end, and once nothing else reads its output, its chunks go as they
are recorded. Both commands now use it.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: Claude Sonnet 5.5 <noreply@anthropic.com>
bad221d to
1abb9ef
Compare
kgeminicdev
left a comment
There was a problem hiding this comment.
Checked that drain can't stall with no reader attached: createReplay pulls the generator in record() on its own, so ended settles whether or not anyone reads. With forget() called and no readers, trim() lets each chunk go right after it's pushed. When a target is also a dependency that hasn't started streaming, release doesn't reach zero, so its chunks are kept until that reader starts, as they should be. The CLI's generate and preview are the only runGenerators callers and neither uses the return value, and the default stays results: true for API users. LGTM.
Description
This PR lets
runGeneratorskeep none of the requested generators' output. It's the third part of a stack that splits #1205.generateandpreviewcollected every target's output into the arraysrunGeneratorsreturns, though neither reads them. With{ results: false }it drains them instead: each generator still runs to its end, and once nothing else reads its output, its chunks go as they're recorded. Both commands now use it.Validation
Added tests for draining a result alongside its other readers, a non-streaming result and a generator that fails, for the chunks of a drained result being let go as they are recorded, and for
runGeneratorsrunning every generator but keeping no results. Built on 12 of Node.js's API docs at 1 and 4 threads, the output is byte-identical tomain's.Related Issues
Refs: #1205
Check List
node --run testand all tests passed.node --run format:check&node --run lint.