Skip to content

[Flight] Use cacheController instead of abortListeners for Streams #33633

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 25, 2025

Conversation

sebmarkbage
Copy link
Collaborator

Now that we have cacheSignal() we can just use that instead of the abortListeners concept which was really just the same thing for cancelling the streams (ReadableStream, Blob, AsyncIterable).

@sebmarkbage sebmarkbage requested a review from unstubbable June 24, 2025 22:47
@github-actions github-actions bot added the React Core Team Opened by a member of the React Core Team label Jun 24, 2025
@react-sizebot
Copy link

react-sizebot commented Jun 24, 2025

Comparing: 7a3ffef...8470230

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 6.68 kB 6.68 kB +0.11% 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 530.57 kB 530.57 kB = 93.67 kB 93.67 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.16% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 651.66 kB 651.66 kB = 114.78 kB 114.78 kB
facebook-www/ReactDOM-prod.classic.js = 674.81 kB 674.81 kB = 118.78 kB 118.78 kB
facebook-www/ReactDOM-prod.modern.js = 665.30 kB 665.30 kB = 117.19 kB 117.19 kB
react-native/shims/ReactNativeTypes.js +2.71% 7.04 kB 7.23 kB +0.56% 1.96 kB 1.97 kB
react-native/implementations/ReactFabric-prod.js +2.25% 357.79 kB 365.86 kB +2.16% 61.77 kB 63.11 kB
react-native/implementations/ReactFabric-prod.fb.js +2.12% 378.96 kB 386.99 kB +2.02% 65.53 kB 66.86 kB
react-native/implementations/ReactFabric-profiling.js +2.10% 385.80 kB 393.91 kB +2.07% 65.75 kB 67.11 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
react-native/shims/ReactNativeTypes.js +2.71% 7.04 kB 7.23 kB +0.56% 1.96 kB 1.97 kB
react-native/implementations/ReactFabric-prod.js +2.25% 357.79 kB 365.86 kB +2.16% 61.77 kB 63.11 kB
react-native/implementations/ReactFabric-prod.fb.js +2.12% 378.96 kB 386.99 kB +2.02% 65.53 kB 66.86 kB
react-native/implementations/ReactFabric-profiling.js +2.10% 385.80 kB 393.91 kB +2.07% 65.75 kB 67.11 kB
react-native/implementations/ReactFabric-profiling.fb.js +1.80% 446.57 kB 454.59 kB +1.78% 74.48 kB 75.80 kB
react-native/implementations/ReactFabric-dev.js +1.41% 645.49 kB 654.60 kB +1.35% 104.72 kB 106.13 kB
react-native/implementations/ReactFabric-dev.fb.js +1.26% 725.57 kB 734.69 kB +1.30% 115.19 kB 116.69 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js = 100.43 kB 100.21 kB = 20.52 kB 20.49 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js = 100.37 kB 100.14 kB = 20.51 kB 20.47 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js = 99.48 kB 99.26 kB = 20.30 kB 20.28 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js = 99.06 kB 98.84 kB = 20.21 kB 20.13 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-server.edge.production.js = 93.35 kB 93.13 kB = 19.28 kB 19.24 kB
oss-experimental/react-server-dom-parcel/cjs/react-server-dom-parcel-server.browser.production.js = 92.07 kB 91.84 kB = 19.01 kB 18.97 kB
oss-experimental/react-server/cjs/react-server-flight.production.js = 64.34 kB 64.16 kB = 12.83 kB 12.80 kB

Generated by 🚫 dangerJS against 8470230

@@ -5257,7 +5254,7 @@ function enqueueFlush(request: Request): void {
}

function callOnAllReadyIfReady(request: Request): void {
if (request.abortableTasks.size === 0 && request.abortListeners.size === 0) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We used to need to check the listener count because it's what kept the stream alive while we were waiting on entries from the stream. Now I just let the task stay open and let the task be abortable which just logs an error for the stream.

@sebmarkbage sebmarkbage merged commit b42341d into facebook:main Jun 25, 2025
240 of 241 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed React Core Team Opened by a member of the React Core Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants