Skip to content

Add Fantom WPT conformance harness (#58267) - #58267

Open
robert68-code wants to merge 1 commit into
react:mainfrom
robert68-code:export-D116965389
Open

Add Fantom WPT conformance harness (#58267)#58267
robert68-code wants to merge 1 commit into
react:mainfrom
robert68-code:export-D116965389

Conversation

@robert68-code

@robert68-code robert68-code commented Aug 31, 2026

Copy link
Copy Markdown

Summary:

This diff lays down the measurement foundation (a Web Platform Tests harness) for adding streaming fetch support to React Native—without changing any actual product code or streaming functionality yet.

Core Strategy: Measurement Before Code
Before making deep C++ and JavaScript networking changes across React Native, the engineering team needs an objective, automated scoreboard. Building the test harness first ensures every future change can mechanically prove conformance improvements and catch regressions in continuous integration (CI).

The 4-Phase Roadmap

Phase 1: The Foundation (ReadableStream)
The Goal: Add the standard ReadableStream class to React Native's core.
Details: Establish the required JavaScript object and set up the testing framework (WPT) to measure progress. No active streaming is enabled yet.

Phase 2: Wire Bridge to ReadableStream (Feature Flagged)
The Goal: Reuse and extend the existing network code to support incremental chunk delivery.

Details:

Native Adjustments: Modify the existing RCTNetworking module to deliver binary data in incremental chunks rather than waiting for the complete payload.

JS Fetch Module: Build a new JS module that triggers RCTNetworking.sendRequest and listens to didReceiveNetworkData events.

Data Pipeline: Decode the incoming base64 binary chunks and enqueue them directly into the ReadableStream.
Lifecycle & Teardown: Implement the 4 critical teardown paths to ensure native network connections safely close (preventing memory leaks) upon user cancellation or app crash.

Rollout Strategy: Place the new streaming capability behind a feature flag to allow safe toggling between the legacy and updated network flows.

Phase 3: Web Standards Polish
The Goal: Reasonable compliance match with web standards.
Details: Finalize edge cases, ensuring developers can successfully clone streams (clone()) and the system accurately tracks when a stream has been consumed (bodyUsed).

Differential Revision: D116965389

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 31, 2026
@meta-codesync

meta-codesync Bot commented Aug 31, 2026

Copy link
Copy Markdown

@robert68-code has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116965389.

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

Summary:

This diff lays down the measurement foundation (a Web Platform Tests harness) for adding streaming fetch support to React Native—without changing any actual product code or streaming functionality yet.

Core Strategy: Measurement Before Code
Before making deep C++ and JavaScript networking changes across React Native, the engineering team needs an objective, automated scoreboard. Building the test harness first ensures every future change can mechanically prove conformance improvements and catch regressions in continuous integration (CI).

The 4-Phase Roadmap

Phase 1: The Foundation (ReadableStream)
The Goal: Add the standard ReadableStream class to React Native's core.
Details: Establish the required JavaScript object and set up the testing framework (WPT) to measure progress. No active streaming is enabled yet.

Phase 2: Wire Bridge to ReadableStream (Feature Flagged)
The Goal: Reuse and extend the existing network code to support incremental chunk delivery.

Details:

Native Adjustments: Modify the existing RCTNetworking module to deliver binary data in incremental chunks rather than waiting for the complete payload.

JS Fetch Module: Build a new JS module that triggers RCTNetworking.sendRequest and listens to didReceiveNetworkData events.

Data Pipeline: Decode the incoming base64 binary chunks and enqueue them directly into the ReadableStream.
Lifecycle & Teardown: Implement the 4 critical teardown paths to ensure native network connections safely close (preventing memory leaks) upon user cancellation or app crash.

Rollout Strategy: Place the new streaming capability behind a feature flag to allow safe toggling between the legacy and updated network flows.

Phase 3: Web Standards Polish
The Goal: Reasonable compliance match with web standards.
Details: Finalize edge cases, ensuring developers can successfully clone streams (clone()) and the system accurately tracks when a stream has been consumed (bodyUsed).

Differential Revision: D116965389
@meta-codesync meta-codesync Bot changed the title Add Fantom WPT conformance harness Add Fantom WPT conformance harness (#58267) Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants