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] Let environmentName vary over time by making it a function of string #29867

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Jun 12, 2024

This lets the environment name vary within a request by the context a component, log or error being executed in.

A potentially different API would be something like setEnvironmentName() but we'd have to extend the ReadableStream or something to do that like we do for .allReady. As a function though it has some expansion possibilities, e.g. we could potentially also pass some information to it for context about what is being asked for.

If it changes before completing a task, we also emit the change so that we have the debug info for what the environment was before entering a component and what it was after completing it.

@sebmarkbage sebmarkbage requested a review from gnoff June 12, 2024 01:56
Copy link

vercel bot commented Jun 12, 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 Jun 12, 2024 2:49pm

@react-sizebot
Copy link

react-sizebot commented Jun 12, 2024

Comparing: fb57fc5...a9a89d0

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.66 kB 6.66 kB = 1.82 kB 1.82 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 497.80 kB 497.80 kB = 89.24 kB 89.24 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.67 kB 6.67 kB = 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 502.62 kB 502.62 kB = 89.94 kB 89.94 kB
facebook-www/ReactDOM-prod.classic.js = 597.56 kB 597.56 kB = 105.38 kB 105.38 kB
facebook-www/ReactDOM-prod.modern.js = 571.49 kB 571.49 kB = 101.27 kB 101.27 kB
test_utils/ReactAllWarnings.js Deleted 63.88 kB 0.00 kB Deleted 15.96 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
oss-stable-rc/react-server/cjs/react-server-flight.development.js +0.82% 79.70 kB 80.36 kB +0.59% 14.84 kB 14.93 kB
oss-stable-semver/react-server/cjs/react-server-flight.development.js +0.82% 79.70 kB 80.36 kB +0.59% 14.84 kB 14.93 kB
oss-stable/react-server/cjs/react-server-flight.development.js +0.82% 79.70 kB 80.36 kB +0.59% 14.84 kB 14.93 kB
oss-experimental/react-server/cjs/react-server-flight.development.js +0.74% 91.68 kB 92.36 kB +0.66% 17.02 kB 17.13 kB
oss-stable-rc/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.55% 119.55 kB 120.20 kB +0.37% 22.33 kB 22.41 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.55% 119.55 kB 120.20 kB +0.37% 22.33 kB 22.41 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.55% 119.55 kB 120.20 kB +0.37% 22.33 kB 22.41 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.53% 123.26 kB 123.91 kB +0.37% 22.91 kB 22.99 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.53% 123.26 kB 123.91 kB +0.37% 22.91 kB 22.99 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.53% 123.26 kB 123.91 kB +0.37% 22.91 kB 22.99 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.53% 123.88 kB 124.54 kB +0.36% 23.09 kB 23.17 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.53% 123.88 kB 124.54 kB +0.36% 23.09 kB 23.17 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.53% 123.88 kB 124.54 kB +0.36% 23.09 kB 23.17 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.53% 124.09 kB 124.74 kB +0.36% 23.08 kB 23.16 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.53% 124.09 kB 124.74 kB +0.36% 23.08 kB 23.16 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.53% 124.09 kB 124.74 kB +0.36% 23.08 kB 23.16 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.53% 124.24 kB 124.89 kB +0.36% 23.14 kB 23.23 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.53% 124.24 kB 124.89 kB +0.36% 23.14 kB 23.23 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.53% 124.24 kB 124.89 kB +0.36% 23.14 kB 23.23 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.52% 125.73 kB 126.38 kB +0.37% 23.26 kB 23.34 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.52% 125.73 kB 126.38 kB +0.37% 23.26 kB 23.34 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.52% 125.73 kB 126.38 kB +0.37% 23.26 kB 23.34 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.52% 125.89 kB 126.55 kB +0.36% 23.32 kB 23.40 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.52% 125.89 kB 126.55 kB +0.36% 23.32 kB 23.40 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.52% 125.89 kB 126.55 kB +0.36% 23.32 kB 23.40 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.52% 126.84 kB 127.49 kB +0.37% 23.52 kB 23.61 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.52% 126.84 kB 127.49 kB +0.37% 23.52 kB 23.61 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.52% 126.84 kB 127.49 kB +0.37% 23.52 kB 23.61 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.52% 126.98 kB 127.64 kB +0.37% 23.58 kB 23.67 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.52% 126.98 kB 127.64 kB +0.37% 23.58 kB 23.67 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.52% 126.98 kB 127.64 kB +0.37% 23.58 kB 23.67 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-server.node.development.js +0.51% 131.68 kB 132.35 kB +0.41% 24.62 kB 24.72 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +0.50% 135.24 kB 135.91 kB +0.41% 25.18 kB 25.28 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +0.50% 135.86 kB 136.54 kB +0.40% 25.35 kB 25.45 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +0.50% 136.40 kB 137.08 kB +0.40% 25.39 kB 25.49 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +0.50% 136.55 kB 137.23 kB +0.40% 25.45 kB 25.55 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.unbundled.development.js +0.49% 137.86 kB 138.53 kB +0.36% 25.57 kB 25.66 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +0.49% 138.02 kB 138.70 kB +0.37% 25.63 kB 25.72 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +0.49% 138.97 kB 139.64 kB +0.35% 25.83 kB 25.92 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +0.49% 139.11 kB 139.79 kB +0.36% 25.88 kB 25.98 kB
test_utils/ReactAllWarnings.js Deleted 63.88 kB 0.00 kB Deleted 15.96 kB 0.00 kB

Generated by 🚫 dangerJS against a9a89d0

This lets the environment name vary within a request by the context it's
being executed in.

We could potentially also pass some information to it for context about
what is being asked for.
That way if the environment changes inside a component we track what it was
before entering and what it was after leaving.
@sebmarkbage sebmarkbage merged commit 55c9d45 into facebook:main Jun 12, 2024
44 checks passed
sebmarkbage added a commit that referenced this pull request Aug 30, 2024
We currently support the Environment Name change within a Component.
#29867

If this happens, we give it two HoCs. The problem with this is that we
only show one followed by `+1` in the list.

Before:
<img width="529" alt="Screenshot 2024-08-28 at 6 50 31 PM"
src="https://github.com/user-attachments/assets/c080be72-c254-4d4d-89b6-d1b7f9a9ada8">

After:
<img width="1101" alt="Screenshot 2024-08-28 at 7 16 21 PM"
src="https://github.com/user-attachments/assets/04718674-164b-4255-9cf6-dec9198f12b7">

I could potentially instead badge this case as `A/B` in a single badge.
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