Skip to content

perf: keep none of the CLI's target output - #1239

Open
ovflowd wants to merge 1 commit into
perf/stream-cachefrom
perf/drain-results
Open

ovflowd wants to merge 1 commit into
perf/stream-cachefrom
perf/drain-results

Conversation

@ovflowd

@ovflowd ovflowd commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

This PR lets runGenerators keep none of the requested generators' output. It's the third part of a stack that splits #1205.

generate and preview collected every target's output into the arrays runGenerators returns, 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 runGenerators running 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 to main's.

Related Issues

Refs: #1205

Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.
  • I have run node --run test and all tests passed.
  • I have check code formatting with node --run format:check & node --run lint.
  • I've covered new added functionality with unit tests if necessary.

@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
api-docs-tooling Ready Ready Preview Nov 4, 2026 6:25pm UTC

Request Review

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.62069% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.36%. Comparing base (557f319) to head (1abb9ef).

Files with missing lines Patch % Lines
packages/cli/bin/commands/generate.mjs 0.00% 1 Missing ⚠️
packages/cli/bin/commands/preview.mjs 0.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ 1abb9ef 2026-11-04T18:25:28.082Z View logs ↗
  • Build: Success ✅

View logs ↗
No Preview URL. Enable ↗ bad221d 2026-11-03T19:35:02.780Z View logs ↗

@ovflowd
ovflowd marked this pull request as ready for review November 3, 2026 20:39
@ovflowd
ovflowd requested a review from a team as a code owner November 3, 2026 20:39
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>

This branch was successfully deployed

1 active deployment
Preview – api-docs-tooling — 1abb9ef2 Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant