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] Inject Client Into DevTools #30910

Merged
merged 3 commits into from
Sep 9, 2024

Conversation

sebmarkbage
Copy link
Collaborator

Stacked on #30906.

Injects the Flight Client into the DevTools hook if it supportsFlight. This only injects in DEV. We could inject it in prod too but so far the only feature this exposes is only available in DEV anyway. I also only call injectIntoDevTools in the browser builds since we don't really support DevTools on the server anyway.

The main purpose of this for now is so that DevTools can track the Server Component owner of replayed logs. This lets us add owner stacks where console.createTask is not natively supported (like Firefox). It also lets us associate the log with the Server Component in the Component tree #30905.

This represents a virtual renderer that connects to the Flight Client.

This will initially only be used to track console logs but could be expanded to more.
We could inject it in prod too but so far the only feature this exposes is
only available in DEV anyway.

I also only call injectIntoDevTools in the browser builds since we don't
really support DevTools on the server.
Copy link

vercel bot commented Sep 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2024 8:26pm

@react-sizebot
Copy link

Comparing: 99cba2b...4a6970a

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.05% 1.82 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 505.22 kB 505.22 kB = 90.29 kB 90.29 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 512.41 kB 512.41 kB = 91.50 kB 91.50 kB
facebook-www/ReactDOM-prod.classic.js = 600.74 kB 600.74 kB = 106.27 kB 106.27 kB
facebook-www/ReactDOM-prod.modern.js = 577.03 kB 577.03 kB = 102.41 kB 102.41 kB
oss-experimental/react-client/cjs/react-client-flight.production.js +2.25% 53.45 kB 54.65 kB +4.57% 9.84 kB 10.28 kB
oss-stable/react-client/cjs/react-client-flight.production.js +2.25% 53.04 kB 54.23 kB +4.42% 9.79 kB 10.22 kB
oss-stable-rc/react-client/cjs/react-client-flight.production.js +2.21% 53.04 kB 54.21 kB +4.21% 9.79 kB 10.20 kB
oss-stable-semver/react-client/cjs/react-client-flight.production.js +2.21% 53.04 kB 54.21 kB +4.21% 9.79 kB 10.20 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-experimental/react-client/cjs/react-client-flight.production.js +2.25% 53.45 kB 54.65 kB +4.57% 9.84 kB 10.28 kB
oss-stable/react-client/cjs/react-client-flight.production.js +2.25% 53.04 kB 54.23 kB +4.42% 9.79 kB 10.22 kB
oss-stable-rc/react-client/cjs/react-client-flight.production.js +2.21% 53.04 kB 54.21 kB +4.21% 9.79 kB 10.20 kB
oss-stable-semver/react-client/cjs/react-client-flight.production.js +2.21% 53.04 kB 54.21 kB +4.21% 9.79 kB 10.20 kB
oss-stable/react-client/cjs/react-client-flight.development.js +1.57% 81.73 kB 83.01 kB +2.60% 14.83 kB 15.22 kB
oss-stable-rc/react-client/cjs/react-client-flight.development.js +1.54% 81.73 kB 82.99 kB +2.45% 14.83 kB 15.20 kB
oss-stable-semver/react-client/cjs/react-client-flight.development.js +1.54% 81.73 kB 82.99 kB +2.45% 14.83 kB 15.20 kB
oss-stable/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +1.48% 114.50 kB 116.19 kB +2.45% 26.71 kB 27.37 kB
oss-stable-rc/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +1.46% 114.50 kB 116.17 kB +2.34% 26.71 kB 27.34 kB
oss-stable-semver/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +1.46% 114.50 kB 116.17 kB +2.34% 26.71 kB 27.34 kB
oss-experimental/react-client/cjs/react-client-flight.development.js +1.33% 89.68 kB 90.88 kB +2.05% 16.44 kB 16.78 kB
oss-experimental/react-server-dom-esm/esm/react-server-dom-esm-client.browser.development.js +1.32% 124.21 kB 125.86 kB +2.10% 29.03 kB 29.64 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +1.22% 80.01 kB 80.99 kB +2.03% 15.02 kB 15.33 kB
oss-stable-rc/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +1.16% 80.01 kB 80.94 kB +1.89% 15.02 kB 15.31 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +1.16% 80.01 kB 80.94 kB +1.89% 15.02 kB 15.31 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +1.01% 82.02 kB 82.85 kB +2.02% 15.41 kB 15.72 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +1.00% 82.47 kB 83.30 kB +1.96% 15.53 kB 15.83 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.96% 82.02 kB 82.81 kB +1.88% 15.41 kB 15.70 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.96% 82.02 kB 82.81 kB +1.88% 15.41 kB 15.70 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.95% 82.47 kB 83.26 kB +1.83% 15.53 kB 15.81 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.95% 82.47 kB 83.26 kB +1.83% 15.53 kB 15.81 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.86% 88.08 kB 88.83 kB +1.73% 16.61 kB 16.90 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.85% 89.93 kB 90.69 kB +1.70% 17.00 kB 17.29 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.84% 90.39 kB 91.14 kB +1.67% 17.12 kB 17.40 kB

Generated by 🚫 dangerJS against 92f46d9

@sebmarkbage sebmarkbage merged commit 2283d72 into facebook:main Sep 9, 2024
184 checks passed
gnoff pushed a commit to vercel/next.js that referenced this pull request Sep 12, 2024
**breaking change for canary users: Bumps peer dependency of React from
`19.0.0-rc-7771d3a7-20240827` to `19.0.0-rc-94e652d5-20240912`**

[diff
facebook/react@7771d3a7...94e652d5](facebook/react@7771d3a...94e652d)

<details>
<summary>React upstream changes</summary>

- facebook/react#30952
- facebook/react#30950
- facebook/react#30946
- facebook/react#30934
- facebook/react#30947
- facebook/react#30945
- facebook/react#30938
- facebook/react#30936
- facebook/react#30879
- facebook/react#30888
- facebook/react#30931
- facebook/react#30930
- facebook/react#30832
- facebook/react#30929
- facebook/react#30926
- facebook/react#30925
- facebook/react#30905
- facebook/react#30900
- facebook/react#30910
- facebook/react#30906
- facebook/react#30899
- facebook/react#30919
- facebook/react#30708
- facebook/react#30907
- facebook/react#30897
- facebook/react#30896
- facebook/react#30895
- facebook/react#30887
- facebook/react#30889
- facebook/react#30893
- facebook/react#30892
- facebook/react#30891
- facebook/react#30882
- facebook/react#30881
- facebook/react#30870
- facebook/react#30849
- facebook/react#30878
- facebook/react#30865
- facebook/react#30869
- facebook/react#30875
- facebook/react#30800
- facebook/react#30762
- facebook/react#30831
- facebook/react#30866
- facebook/react#30853
- facebook/react#30850
- facebook/react#30847
- facebook/react#30842
- facebook/react#30837
- facebook/react#30848
- facebook/react#30844
- facebook/react#30839
- facebook/react#30802
- facebook/react#30841
- facebook/react#30827
- facebook/react#30826
- facebook/react#30825
- facebook/react#30824
- facebook/react#30840
- facebook/react#30838
- facebook/react#30836
- facebook/react#30819
- facebook/react#30816
- facebook/react#30814
- facebook/react#30813
- facebook/react#30812
- facebook/react#30811

</details>

---------

Co-authored-by: vercel-release-bot <[email protected]>
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