Add Fantom WPT conformance harness (#58267) - #58267
Open
robert68-code wants to merge 1 commit into
Open
Conversation
|
@robert68-code has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116965389. |
cortinico
requested changes
Sep 1, 2026
cortinico
left a comment
Contributor
There was a problem hiding this comment.
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
robert68-code
force-pushed
the
export-D116965389
branch
from
September 3, 2026 20:31
24ccf53 to
a505f8b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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