Skip to content
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

[Flight] Track Owner on AsyncLocalStorage When Available #28807

Merged
merged 3 commits into from
May 3, 2024

Conversation

sebmarkbage
Copy link
Collaborator

Stacked on #28798.

Add another AsyncLocalStorage to the FlightServerConfig. This context tracks data on a per component level. Currently the only thing we track is the owner in DEV.

AsyncLocalStorage around each component comes with a performance cost so we only do it DEV. It's not generally a particularly safe operation because you can't necessarily associate side-effects with a component based on execution scope. It can be a lazy initializer or cache():ed code etc. We also don't support string refs anymore for a reason.

However, it's good enough for optional dev only information like the owner.

@sebmarkbage sebmarkbage requested a review from gnoff April 10, 2024 02:54
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Apr 10, 2024
@react-sizebot
Copy link

react-sizebot commented Apr 10, 2024

Comparing: 7f5d25e...a0c5e47

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.min.js = 168.09 kB 168.09 kB = 52.71 kB 52.71 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 169.90 kB 169.90 kB = 53.25 kB 53.25 kB
facebook-www/ReactDOM-prod.classic.js = 589.45 kB 589.47 kB = 103.79 kB 103.80 kB
facebook-www/ReactDOM-prod.modern.js = 565.29 kB 565.31 kB +0.02% 99.92 kB 99.93 kB
facebook-react-native/react/cjs/JSXRuntime-prod.js +4.03% 2.73 kB 2.84 kB +3.40% 1.18 kB 1.22 kB
facebook-react-native/react/cjs/JSXRuntime-profiling.js +4.03% 2.73 kB 2.84 kB +3.40% 1.18 kB 1.22 kB
oss-experimental/react-suspense-test-utils/cjs/react-suspense-test-utils.js +3.63% 0.66 kB 0.69 kB +3.02% 0.46 kB 0.48 kB
oss-stable-semver/react-suspense-test-utils/cjs/react-suspense-test-utils.js +3.63% 0.66 kB 0.69 kB +3.02% 0.46 kB 0.48 kB
oss-stable/react-suspense-test-utils/cjs/react-suspense-test-utils.js +3.63% 0.66 kB 0.69 kB +3.02% 0.46 kB 0.48 kB
oss-experimental/react/cjs/react-jsx-runtime.production.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-stable-semver/react/cjs/react-jsx-runtime.production.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-stable/react/cjs/react-jsx-runtime.production.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-experimental/react/cjs/react-jsx-runtime.profiling.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-stable-semver/react/cjs/react-jsx-runtime.profiling.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-stable/react/cjs/react-jsx-runtime.profiling.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-experimental/react/cjs/react-jsx-runtime.production.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.42 kB
oss-stable-semver/react/cjs/react-jsx-runtime.production.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.42 kB
oss-stable/react/cjs/react-jsx-runtime.production.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.42 kB
oss-experimental/react/cjs/react-jsx-runtime.profiling.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.41 kB
oss-stable-semver/react/cjs/react-jsx-runtime.profiling.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.41 kB
oss-stable/react/cjs/react-jsx-runtime.profiling.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.41 kB
test_utils/ReactAllWarnings.js Deleted 64.02 kB 0.00 kB Deleted 15.94 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
facebook-react-native/react/cjs/JSXRuntime-prod.js +4.03% 2.73 kB 2.84 kB +3.40% 1.18 kB 1.22 kB
facebook-react-native/react/cjs/JSXRuntime-profiling.js +4.03% 2.73 kB 2.84 kB +3.40% 1.18 kB 1.22 kB
oss-experimental/react-suspense-test-utils/cjs/react-suspense-test-utils.js +3.63% 0.66 kB 0.69 kB +3.02% 0.46 kB 0.48 kB
oss-stable-semver/react-suspense-test-utils/cjs/react-suspense-test-utils.js +3.63% 0.66 kB 0.69 kB +3.02% 0.46 kB 0.48 kB
oss-stable/react-suspense-test-utils/cjs/react-suspense-test-utils.js +3.63% 0.66 kB 0.69 kB +3.02% 0.46 kB 0.48 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.55% 123.70 kB 124.39 kB +0.49% 28.60 kB 28.74 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.55% 123.70 kB 124.39 kB +0.49% 28.60 kB 28.74 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.55% 125.63 kB 126.32 kB +0.48% 29.10 kB 29.24 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.55% 125.63 kB 126.32 kB +0.48% 29.10 kB 29.24 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.49% 138.33 kB 139.01 kB +0.41% 31.58 kB 31.71 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.48% 140.26 kB 140.94 kB +0.40% 32.08 kB 32.21 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.46% 119.90 kB 120.45 kB +0.43% 27.73 kB 27.85 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.46% 119.90 kB 120.45 kB +0.43% 27.73 kB 27.85 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.44% 126.06 kB 126.62 kB +0.43% 28.77 kB 28.90 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.44% 126.06 kB 126.62 kB +0.43% 28.77 kB 28.90 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.43% 128.35 kB 128.91 kB +0.45% 29.35 kB 29.48 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.43% 128.35 kB 128.91 kB +0.45% 29.35 kB 29.48 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.43% 128.70 kB 129.26 kB +0.41% 29.59 kB 29.71 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.43% 128.70 kB 129.26 kB +0.41% 29.59 kB 29.71 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.42% 130.99 kB 131.54 kB +0.42% 30.20 kB 30.33 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.42% 130.99 kB 131.54 kB +0.42% 30.20 kB 30.33 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.41% 134.06 kB 134.60 kB +0.42% 30.58 kB 30.71 kB
oss-stable-semver/react-server/cjs/react-server-flight.development.js +0.39% 83.18 kB 83.51 kB +0.37% 19.41 kB 19.48 kB
oss-stable/react-server/cjs/react-server-flight.development.js +0.39% 83.18 kB 83.51 kB +0.37% 19.41 kB 19.48 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.39% 140.22 kB 140.76 kB +0.41% 31.60 kB 31.73 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.38% 142.51 kB 143.05 kB +0.40% 32.18 kB 32.31 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.38% 142.86 kB 143.40 kB +0.40% 32.39 kB 32.52 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.37% 145.14 kB 145.69 kB +0.39% 33.01 kB 33.14 kB
facebook-www/ReactFlightDOMServer-dev.modern.js +0.36% 104.75 kB 105.13 kB +0.37% 21.78 kB 21.86 kB
oss-experimental/react/cjs/react-jsx-runtime.react-server.production.js +0.34% 5.51 kB 5.53 kB +0.42% 2.39 kB 2.40 kB
oss-stable-semver/react/cjs/react-jsx-runtime.react-server.production.js +0.34% 5.51 kB 5.53 kB +0.42% 2.39 kB 2.40 kB
oss-stable/react/cjs/react-jsx-runtime.react-server.production.js +0.34% 5.51 kB 5.53 kB +0.42% 2.39 kB 2.40 kB
oss-experimental/react-server/cjs/react-server-flight.development.js +0.33% 96.46 kB 96.78 kB +0.34% 21.91 kB 21.99 kB
oss-experimental/react/cjs/react-jsx-dev-runtime.development.js +0.30% 41.41 kB 41.53 kB +0.34% 12.53 kB 12.57 kB
oss-stable-semver/react/cjs/react-jsx-dev-runtime.development.js +0.30% 41.41 kB 41.53 kB +0.34% 12.53 kB 12.57 kB
oss-stable/react/cjs/react-jsx-dev-runtime.development.js +0.30% 41.41 kB 41.53 kB +0.34% 12.53 kB 12.57 kB
oss-experimental/react/cjs/react-jsx-runtime.development.js +0.30% 42.64 kB 42.76 kB +0.33% 12.88 kB 12.92 kB
oss-stable-semver/react/cjs/react-jsx-runtime.development.js +0.30% 42.64 kB 42.76 kB +0.33% 12.88 kB 12.92 kB
oss-stable/react/cjs/react-jsx-runtime.development.js +0.30% 42.64 kB 42.76 kB +0.33% 12.88 kB 12.92 kB
oss-stable-semver/react-server-dom-turbopack/umd/react-server-dom-turbopack-server.browser.development.js +0.27% 129.54 kB 129.89 kB +0.29% 28.71 kB 28.80 kB
oss-stable/react-server-dom-turbopack/umd/react-server-dom-turbopack-server.browser.development.js +0.27% 129.54 kB 129.89 kB +0.29% 28.71 kB 28.80 kB
oss-stable-semver/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js +0.27% 132.11 kB 132.46 kB +0.30% 29.38 kB 29.47 kB
oss-stable/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js +0.27% 132.11 kB 132.46 kB +0.30% 29.38 kB 29.47 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.27% 122.81 kB 123.14 kB +0.26% 28.37 kB 28.44 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.27% 122.81 kB 123.14 kB +0.26% 28.37 kB 28.44 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.26% 125.26 kB 125.59 kB +0.23% 29.03 kB 29.10 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.26% 125.26 kB 125.59 kB +0.23% 29.03 kB 29.10 kB
oss-experimental/react/cjs/react-jsx-runtime.react-server.development.js +0.25% 43.06 kB 43.17 kB +0.33% 12.99 kB 13.04 kB
oss-stable-semver/react/cjs/react-jsx-runtime.react-server.development.js +0.25% 43.06 kB 43.17 kB +0.33% 12.99 kB 13.04 kB
oss-stable/react/cjs/react-jsx-runtime.react-server.development.js +0.25% 43.06 kB 43.17 kB +0.33% 12.99 kB 13.04 kB
oss-experimental/react-server-dom-turbopack/umd/react-server-dom-turbopack-server.browser.development.js +0.24% 144.18 kB 144.52 kB +0.27% 31.47 kB 31.56 kB
oss-experimental/react-server-dom-webpack/umd/react-server-dom-webpack-server.browser.development.js +0.23% 146.75 kB 147.09 kB +0.28% 32.15 kB 32.24 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.23% 136.77 kB 137.08 kB +0.28% 31.09 kB 31.18 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.23% 139.21 kB 139.53 kB +0.26% 31.76 kB 31.84 kB
facebook-www/React-profiling.classic.js = 23.15 kB 22.97 kB = 5.88 kB 5.88 kB
facebook-www/React-profiling.modern.js = 23.15 kB 22.97 kB = 5.88 kB 5.87 kB
facebook-www/React-prod.classic.js = 22.71 kB 22.54 kB = 5.81 kB 5.80 kB
facebook-www/React-prod.modern.js = 22.71 kB 22.54 kB = 5.80 kB 5.80 kB
facebook-www/ReactServer-prod.modern.js = 18.67 kB 18.50 kB = 4.83 kB 4.82 kB
oss-experimental/react/cjs/react-jsx-runtime.production.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-stable-semver/react/cjs/react-jsx-runtime.production.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-stable/react/cjs/react-jsx-runtime.production.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-experimental/react/cjs/react-jsx-runtime.profiling.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-stable-semver/react/cjs/react-jsx-runtime.profiling.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-stable/react/cjs/react-jsx-runtime.profiling.js = 5.14 kB 5.04 kB = 2.23 kB 2.15 kB
oss-experimental/react/cjs/react-jsx-runtime.production.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.42 kB
oss-stable-semver/react/cjs/react-jsx-runtime.production.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.42 kB
oss-stable/react/cjs/react-jsx-runtime.production.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.42 kB
oss-experimental/react/cjs/react-jsx-runtime.profiling.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.41 kB
oss-stable-semver/react/cjs/react-jsx-runtime.profiling.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.41 kB
oss-stable/react/cjs/react-jsx-runtime.profiling.min.js = 0.65 kB 0.63 kB = 0.42 kB 0.41 kB
test_utils/ReactAllWarnings.js Deleted 64.02 kB 0.00 kB Deleted 15.94 kB 0.00 kB

Generated by 🚫 dangerJS against a0c5e47

@sebmarkbage sebmarkbage merged commit d5c3034 into facebook:main May 3, 2024
24 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