Commit Graph
38 Commits
Author SHA1 Message Date
Chris Tate 59eced7a6c Lower ReadableStream tee, pipeTo and pipeThrough in TypeScript (#2513) 2026-10-29 15:09:05 -05:00
Chris Tate d67f378a50 Release the web view of an abandoned fetch body while its transfer runs
A Response body's stream gets a web ReadableStream view when a member the
fetch stream lacks is read (for example `body.tee`). The view's source holds
the stream, and the stream released the view only when that source was its
last holder. While the transfer runs it holds the stream too, so a dropped
body with a view kept a reference count of 2: the unobserved-response
discard never ran, the paused socket was never resumed, and a compressed
response dropped before HTTP EOF kept the process alive.

The stream now releases the view when only the view's source and the live
transfer hold it, and then takes the unobserved-response discard, as a
body without a view does.

The static-abandon-view fixture reads `body.tee` and `body.locked` of a
4 MiB incompressible gzip response from the new /gzip-incompressible route
and drops it. It hung until the test's timeout before this change and now
exits as Node does.
2026-10-29 13:44:32 -05:00
Chris Tate 22357e8bed Lower ReadableStream tee, pipeTo and pipeThrough in TypeScript
In TypeScript, tee(), pipeTo() and pipeThrough() on a ReadableStream were
refused with SC2020, and the WritableStream constructor and a
TransformStream with a transformer had no lowering, while JavaScript
programs reach all of them through the web stream classes
(scr_webstreams.c).

A TypeScript program that uses one of them now builds its ReadableStream,
WritableStream and TransformStream values with those classes, as
JavaScript does, and %main installs them, so a native stream such as a
Response body answers the three methods through its web view. A program
that uses only getReader(), cancel(), locked and the identity transform
keeps the native streams and builds to the same binary.

The fallback declarations gain UnderlyingSink and Transformer, the
WritableStream constructor takes a sink and the TransformStream
constructor a transformer and queuing strategies, and their controllers
map to checked-dynamic handles. The fetch profile lists the three methods
as static with the new static-web-streams fetch fixture as their
differential evidence, and keeps them in the set that links the classes.
The surface manifest is regenerated, and the surface-manifest probe that
kept tee() and pipeTo() fenced now fences values() and the async
iterator.

Adds the static-web-streams fixture and the corpus program
web-streams-typed-pipes.ts, with its corpus cost and order baseline.
2026-10-28 22:18:11 -05:00
Chris Tate 1cf59d42e4 Lower Response.clone and Request.clone on typed values
Response.clone() and Request.clone() on a value typed Response or Request
were refused: in TypeScript the fallback declarations had no clone, and
the fetch profile listed both as unsupported, so the call compiled to an
SC2020 refusal, also in JavaScript where the checker types the value. The
checked-dynamic handles already implement them (the body tees, and the
clone gets a copy of the headers with the same guard), so typed calls now
dispatch to those implementations, as text() and json() do.

The declarations gain clone(), and the fetch profile lists both as static
methods with the new static-clone fetch fixture as their differential
evidence. The surface manifest is regenerated, and the surface-manifest
probes that kept clone fenced now fence blob() and formData().

Adds the static-clone fixture and corpus programs fetch-clone.ts and
fetch-clone-untyped.mjs, with their corpus costs and preflight/order
baselines.
2026-10-28 09:33:31 -05:00
Malte UblandClaude Opus 5.5 6c1af69d03 Add static Response.json
`Response.json(data, init)` was refused (SC2020). It now builds a native
Response the way undici does: ResponseInit converts, the data serializes
through the checked-dynamic JSON serializer (toJSON hooks included;
TypeError "Value is not JSON serializable" when JSON.stringify answers
undefined), then the response initializes like the constructor with
"application/json" as the default content type, so status, statusText,
header, and null-body-status errors keep their order.

The fetch compatibility profile moves Response.json from unsupported to a
static operation with the static-response-json differential fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 15:16:17 -07:00
Chris Tate 6d79399862 Tunnel fetch through env proxies with CONNECT
Fixes #1185
Co-authored-by: Andrey Kiselev <35863331+TheAsda@users.noreply.github.com>
2026-10-17 19:38:19 -05:00
Chris Tate 3f8e0bcb13 Use plain wording in docs, comments and test names 2026-10-14 11:43:44 -05:00
Chris Tate a4af77ee8d Add EventTarget, Event and CustomEvent 2026-10-14 02:58:57 -05:00
Chris Tate 7e6294ca0f Make scriptc compilation native-only 2026-10-12 12:25:30 -05:00
Chris Tate c08ab955ae Enforce linting and consistent source formatting
- Enforce oxlint and oxfmt for owned JavaScript and TypeScript with independent CI checks.
- Preserve compiler import boundaries and protected fixtures while cleaning up lint findings.
- Standardize source formatting and validate import, fixture, and embedded-source protections.
2026-10-05 17:51:24 -05:00
Chris Tate e2d58f60d2 Expand static support for common Effect 4 patterns (#600)
* Expand static compilation for common Effect 4 patterns

* Run every Effect 4 fixture slice in CI

* Preserve existing corpus behavior across Effect 4 lowering

* Preserve Effect platform callbacks and native stream state

* Record new corpus baselines and retain child stdin refusals

* Retire the obsolete stateful regex diagnostic

* Preserve promise reference count layout for cycle collection
2026-10-01 17:36:29 -05:00
Chris Tate 3f66c8e20b Make LLVM the sole production backend
- Remove C emission, debugging options, and automatic backend fallback.
- Complete LLVM lowering and native bootstrap coverage across supported targets.
- Link executables and libraries with precompiled C runtime packs, including iOS and Android.
2026-09-29 20:54:09 -05:00
Chris Tate 39db8c0a99 feat(compiler): make lowering contexts natively compilable
- Run production scope and closure capture logic with native TypeScript 7 symbols.
- Give lowering caches explicit pass ownership and stable symbol identities.
- Support reference collection arrays and optional Set seeds on both native backends.
2026-09-28 19:48:46 -05:00
Chris Tateandsensei-woo 89c361a967 Lower AbortController for fetch cancellation (#100)
* Lower AbortController for fetch cancellation

- Add static and dynamic lowering for construction, signal access, and abort calls
- Back controllers with native signal state shared by fetch
- Cover cancellation semantics across C, LLVM, diagnostics, and surface tests

Co-authored-by: sensei-woo <sensei-woo@users.noreply.github.com>

* Fix AbortController abort edge cases

* Fence AbortController method extraction

---------

Co-authored-by: sensei-woo <sensei-woo@users.noreply.github.com>
2026-08-08 20:24:27 -05:00
Chris Tate efb7e77281 fix: address fetch compatibility review findings 2026-08-02 15:31:00 -05:00
Chris Tate 8c20c9ac73 fix: validate computed fetch dispatch 2026-08-02 11:29:23 -05:00
Chris Tate af685d05f9 fix: close fetch inventory review gaps 2026-08-02 10:41:37 -05:00
Chris Tate b90c0466b2 fix: enforce fetch surface compatibility 2026-08-02 01:09:40 -05:00
Chris Tate 5985d54a27 fix: preserve fetch coercion semantics 2026-08-01 08:28:01 -05:00
Chris Tate 78144ec8be fix(fetch): bind Web Stream source callbacks 2026-07-31 12:00:29 -05:00
Chris Tate f19df5a1ee fix(fetch): align listener and stream behavior 2026-07-31 11:35:28 -05:00
Chris Tate 52c66e2286 fix(fetch): accept string request stream chunks 2026-07-31 09:03:40 -05:00
Chris Tate ffaefc6ced fix: snapshot fetch environment at startup 2026-07-31 00:05:24 -05:00
Chris Tate 334febe43d fix(fetch): address remaining review findings 2026-07-30 22:48:36 -05:00
Chris Tate eec2cb2a3a fix(fetch): address static fetch review findings 2026-07-30 22:02:47 -05:00
Chris Tate baf050843d fix fetch proxy and event dispatch behavior 2026-07-30 21:19:57 -05:00
Chris Tate 6451bc80f6 fix(fetch): preserve proxy and network error semantics 2026-07-30 17:30:51 -05:00
Chris Tate b14b594775 fix(fetch): preserve proxy and listener semantics 2026-07-30 16:26:34 -05:00
Chris Tate fb0b08a56f fix(fetch): settle abandoned responses and decode redirects 2026-07-30 13:51:18 -05:00
Chris Tate 6955a5d267 fix fetch proxy and redirect edge cases 2026-07-30 13:15:10 -05:00
Chris Tate 8a204cc7e7 fix(fetch): address remaining review regressions 2026-07-30 12:33:26 -05:00
Chris Tate b3b58ca878 fix(fetch): address static parity regressions 2026-07-30 11:55:17 -05:00
Chris Tate d239f8ef58 fix(fetch): align header and abort event semantics 2026-07-30 11:35:00 -05:00
Chris Tate 8790cefbab fix(fetch): address review feedback 2026-07-30 11:35:00 -05:00
Chris Tate 42fe89f499 fix static fetch semantics and CI reliability 2026-07-30 11:35:00 -05:00
Chris Tate ea6adda816 fix(fetch): fix static fetch regressions 2026-07-30 11:35:00 -05:00
Chris Tate f11e51256c feat: make fetch static-compatible
- Add native RequestInit, AbortSignal, and streaming request and response body support.
- Lower the static fetch surface through both C and LLVM without the embedded engine.
- Add differential, Node-typing, sanitizer, and regression coverage.
2026-07-30 11:34:59 -05:00
Chris Tate 23d5918a53 init 2026-07-22 18:08:04 -05:00