ReviewOS

home-lang/home

Port Bun async-iterable Response streaming matrix

#164
Closed chris opened this 10 days ago ·
10 days ago

Port the exact upstream test/js/bun/http/async-iterator-stream.test.ts corpus into Home without whole-file TODO rewriting.

Scope:

  • Response and Request bodies backed by async generator functions and [Symbol.asyncIterator]
  • string/Buffer yields, iterator return values, controller identity, and controller.end()
  • arrayBuffer(), bytes(), text(), json(), and blob() consumers
  • Bun.serve streaming, abort behavior, and thrown-generator header/error behavior

Acceptance:

  • corpus remains byte-identical to ~/Code/bun
  • every active upstream case passes with 0 fail and 0 unsupported
  • upstream TODO/skip state remains explicit
  • durable exact-file regression added
  • full home_test gate passes

Tracked from #66.

10 days ago

Completed and pushed directly to main in eccab717b.

Implemented:

  • async generator functions and custom [Symbol.asyncIterator] bodies for Response/Request
  • string/Buffer yields, iterator return values, stable controller identity, and controller.end()
  • arrayBuffer(), bytes(), text(), json(), and blob() consumption across all body forms
  • Bun.serve async-iterable response streaming and abort safety
  • subprocess IPC fixture for thrown-generator headers, stderr, kill, and exit behavior
  • shared Request fix so streaming bodies are consumed through their normalized body record instead of parsing an async function's source text
  • durable exact-file Zig regression

Verification:

  • corpus remains byte-identical to ~/Code/bun/test/js/bun/http/async-iterator-stream.test.ts
  • exact corpus: 86 passed, 0 failed, 0 unsupported, 0 TODO
  • ./pantry/.bin/zig build debug --summary failures: pass
  • ./pantry/.bin/zig build test -Dfilter=home_test --summary failures: pass
  • Zig formatting and diff checks: pass

Sign in to comment on this issue.