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

Switch to binding the console with badging instead of calling it directly #30461

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

sebmarkbage
Copy link
Collaborator

@sebmarkbage sebmarkbage commented Jul 25, 2024

This is a major nit but this avoids an extra stack frame when we're replaying logs.

Normally the printToConsole frame doesn't show up because it'd be ignore listed.

When you expand to show ignore listed frames a ton of other frames show up.

The annoying thing about this frame is that it's at the top of the stack where as typically framework stuff ends up at the bottom and something you can ignore. The user space stack comes first.

With this fix there's no longer any printToConsole frame.

Am I wiling to eat the added complexity and slightly slower performance for this nit? Definitely.

…ctly

This avoids an extra stack frame when we're replaying.
Copy link

vercel bot commented Jul 25, 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 Jul 25, 2024 4:15pm

@react-sizebot
Copy link

Comparing: 14a4699...448c152

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 = 1.83 kB 1.83 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 501.39 kB 501.39 kB = 89.96 kB 89.96 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 6.69 kB 6.69 kB +0.05% 1.83 kB 1.83 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 506.21 kB 506.21 kB = 90.66 kB 90.66 kB
facebook-www/ReactDOM-prod.classic.js = 598.83 kB 598.83 kB = 105.76 kB 105.76 kB
facebook-www/ReactDOM-prod.modern.js = 574.94 kB 574.94 kB = 101.99 kB 101.99 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-flight-client.development.js +3.76% 2.02 kB 2.10 kB +3.56% 0.76 kB 0.79 kB
oss-stable-rc/react-noop-renderer/cjs/react-noop-renderer-flight-client.development.js +3.76% 2.02 kB 2.10 kB +3.56% 0.76 kB 0.79 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-flight-client.development.js +3.76% 2.02 kB 2.10 kB +3.56% 0.76 kB 0.79 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-flight-client.development.js +3.76% 2.02 kB 2.10 kB +3.56% 0.76 kB 0.79 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-flight-client.production.js +3.63% 1.76 kB 1.83 kB +3.52% 0.71 kB 0.74 kB
oss-stable-rc/react-noop-renderer/cjs/react-noop-renderer-flight-client.production.js +3.63% 1.76 kB 1.83 kB +3.52% 0.71 kB 0.74 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-flight-client.production.js +3.63% 1.76 kB 1.83 kB +3.52% 0.71 kB 0.74 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-flight-client.production.js +3.63% 1.76 kB 1.83 kB +3.52% 0.71 kB 0.74 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-noop-renderer/cjs/react-noop-renderer-flight-client.development.js +3.76% 2.02 kB 2.10 kB +3.56% 0.76 kB 0.79 kB
oss-stable-rc/react-noop-renderer/cjs/react-noop-renderer-flight-client.development.js +3.76% 2.02 kB 2.10 kB +3.56% 0.76 kB 0.79 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-flight-client.development.js +3.76% 2.02 kB 2.10 kB +3.56% 0.76 kB 0.79 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-flight-client.development.js +3.76% 2.02 kB 2.10 kB +3.56% 0.76 kB 0.79 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-flight-client.production.js +3.63% 1.76 kB 1.83 kB +3.52% 0.71 kB 0.74 kB
oss-stable-rc/react-noop-renderer/cjs/react-noop-renderer-flight-client.production.js +3.63% 1.76 kB 1.83 kB +3.52% 0.71 kB 0.74 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-flight-client.production.js +3.63% 1.76 kB 1.83 kB +3.52% 0.71 kB 0.74 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-flight-client.production.js +3.63% 1.76 kB 1.83 kB +3.52% 0.71 kB 0.74 kB
oss-stable-rc/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.42% 79.25 kB 79.59 kB +0.25% 14.99 kB 15.03 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.42% 79.25 kB 79.59 kB +0.25% 14.99 kB 15.03 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.42% 79.25 kB 79.59 kB +0.25% 14.99 kB 15.03 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +0.42% 80.67 kB 81.00 kB +0.24% 15.30 kB 15.34 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +0.42% 80.67 kB 81.00 kB +0.24% 15.30 kB 15.34 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +0.42% 80.67 kB 81.00 kB +0.24% 15.30 kB 15.34 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.29% 90.07 kB 90.33 kB = 16.89 kB 16.89 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.29% 90.86 kB 91.13 kB = 17.07 kB 17.06 kB
oss-stable-rc/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.24% 74.32 kB 74.50 kB +0.36% 13.98 kB 14.03 kB
oss-stable-semver/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.24% 74.32 kB 74.50 kB +0.36% 13.98 kB 14.03 kB
oss-stable/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.24% 74.32 kB 74.50 kB +0.36% 13.98 kB 14.03 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.24% 76.17 kB 76.35 kB +0.31% 14.38 kB 14.42 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.24% 76.17 kB 76.35 kB +0.31% 14.38 kB 14.42 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.24% 76.17 kB 76.35 kB +0.31% 14.38 kB 14.42 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.browser.development.js +0.24% 79.69 kB 79.88 kB +0.08% 14.99 kB 15.00 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.23% 76.63 kB 76.81 kB +0.29% 14.49 kB 14.54 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.23% 76.63 kB 76.81 kB +0.29% 14.49 kB 14.54 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.23% 76.63 kB 76.81 kB +0.29% 14.49 kB 14.54 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +0.23% 81.65 kB 81.84 kB +0.03% 15.41 kB 15.41 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +0.23% 82.11 kB 82.30 kB +0.03% 15.52 kB 15.52 kB
oss-experimental/react-server-dom-esm/cjs/react-server-dom-esm-client.node.development.js +0.23% 84.73 kB 84.93 kB +0.12% 16.04 kB 16.05 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.23% 81.63 kB 81.81 kB +0.25% 15.47 kB 15.51 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.23% 81.63 kB 81.81 kB +0.25% 15.47 kB 15.51 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.23% 81.63 kB 81.81 kB +0.25% 15.47 kB 15.51 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.unbundled.development.js +0.23% 86.15 kB 86.34 kB +0.06% 16.36 kB 16.37 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.22% 82.99 kB 83.18 kB +0.23% 15.76 kB 15.80 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.22% 82.99 kB 83.18 kB +0.23% 15.76 kB 15.80 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.22% 82.99 kB 83.18 kB +0.23% 15.76 kB 15.80 kB
oss-stable-rc/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.22% 83.01 kB 83.19 kB +0.23% 15.75 kB 15.78 kB
oss-stable-semver/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.22% 83.01 kB 83.19 kB +0.23% 15.75 kB 15.78 kB
oss-stable/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.22% 83.01 kB 83.19 kB +0.23% 15.75 kB 15.78 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +0.22% 86.96 kB 87.15 kB +0.02% 16.53 kB 16.53 kB
oss-experimental/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +0.22% 88.32 kB 88.52 kB = 16.79 kB 16.79 kB
oss-experimental/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +0.22% 88.34 kB 88.53 kB = 16.77 kB 16.77 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.22% 84.73 kB 84.92 kB +0.22% 15.83 kB 15.86 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.22% 84.73 kB 84.92 kB +0.22% 15.83 kB 15.86 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +0.22% 84.73 kB 84.92 kB +0.22% 15.83 kB 15.86 kB
oss-stable-rc/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.22% 85.53 kB 85.71 kB +0.21% 16.01 kB 16.04 kB
oss-stable-semver/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.22% 85.53 kB 85.71 kB +0.21% 16.01 kB 16.04 kB
oss-stable/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +0.22% 85.53 kB 85.71 kB +0.21% 16.01 kB 16.04 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer.production.js +0.22% 35.12 kB 35.20 kB +0.30% 6.60 kB 6.62 kB
oss-stable-rc/react-noop-renderer/cjs/react-noop-renderer.production.js +0.22% 35.12 kB 35.20 kB +0.30% 6.60 kB 6.62 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer.production.js +0.22% 35.12 kB 35.20 kB +0.30% 6.60 kB 6.62 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer.production.js +0.22% 35.12 kB 35.20 kB +0.30% 6.60 kB 6.62 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-persistent.production.js +0.22% 35.25 kB 35.32 kB +0.30% 6.61 kB 6.63 kB
oss-stable-rc/react-noop-renderer/cjs/react-noop-renderer-persistent.production.js +0.22% 35.25 kB 35.32 kB +0.30% 6.61 kB 6.63 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-persistent.production.js +0.22% 35.25 kB 35.32 kB +0.30% 6.61 kB 6.63 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-persistent.production.js +0.22% 35.25 kB 35.32 kB +0.30% 6.61 kB 6.63 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer.development.js +0.21% 39.23 kB 39.31 kB +0.26% 7.18 kB 7.20 kB
oss-stable-rc/react-noop-renderer/cjs/react-noop-renderer.development.js +0.21% 39.23 kB 39.31 kB +0.26% 7.18 kB 7.20 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer.development.js +0.21% 39.23 kB 39.31 kB +0.26% 7.18 kB 7.20 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer.development.js +0.21% 39.23 kB 39.31 kB +0.26% 7.18 kB 7.20 kB
oss-experimental/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js +0.21% 39.37 kB 39.45 kB +0.26% 7.20 kB 7.22 kB
oss-stable-rc/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js +0.21% 39.37 kB 39.45 kB +0.26% 7.20 kB 7.22 kB
oss-stable-semver/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js +0.21% 39.37 kB 39.45 kB +0.26% 7.20 kB 7.22 kB
oss-stable/react-noop-renderer/cjs/react-noop-renderer-persistent.development.js +0.21% 39.37 kB 39.45 kB +0.26% 7.20 kB 7.22 kB

Generated by 🚫 dangerJS against 41c415c

@sebmarkbage sebmarkbage merged commit e8df0cf into facebook:main Jul 25, 2024
187 checks passed
github-actions bot pushed a commit that referenced this pull request Jul 25, 2024
…ctly (#30461)

This is a major nit but this avoids an extra stack frame when we're
replaying logs.

Normally the `printToConsole` frame doesn't show up because it'd be
ignore listed.

<img width="421" alt="Screenshot 2024-07-25 at 11 49 39 AM"
src="https://github.com/user-attachments/assets/81334c2f-e19e-476a-871e-c4db9dee294e">

When you expand to show ignore listed frames a ton of other frames show
up.

<img width="516" alt="Screenshot 2024-07-25 at 11 49 47 AM"
src="https://github.com/user-attachments/assets/2ab8bdfb-464c-408d-9176-ee2fabc114b6">

The annoying thing about this frame is that it's at the top of the stack
where as typically framework stuff ends up at the bottom and something
you can ignore. The user space stack comes first.

With this fix there's no longer any `printToConsole` frame.

<img width="590" alt="Screenshot 2024-07-25 at 12 09 09 PM"
src="https://github.com/user-attachments/assets/b8365d53-31f3-43df-abce-172d608d3c9c">

Am I wiling to eat the added complexity and slightly slower performance
for this nit? Definitely.

DiffTrain build for commit e8df0cf.
github-actions bot pushed a commit that referenced this pull request Jul 25, 2024
…ctly (#30461)

This is a major nit but this avoids an extra stack frame when we're
replaying logs.

Normally the `printToConsole` frame doesn't show up because it'd be
ignore listed.

<img width="421" alt="Screenshot 2024-07-25 at 11 49 39 AM"
src="https://github.com/user-attachments/assets/81334c2f-e19e-476a-871e-c4db9dee294e">

When you expand to show ignore listed frames a ton of other frames show
up.

<img width="516" alt="Screenshot 2024-07-25 at 11 49 47 AM"
src="https://github.com/user-attachments/assets/2ab8bdfb-464c-408d-9176-ee2fabc114b6">

The annoying thing about this frame is that it's at the top of the stack
where as typically framework stuff ends up at the bottom and something
you can ignore. The user space stack comes first.

With this fix there's no longer any `printToConsole` frame.

<img width="590" alt="Screenshot 2024-07-25 at 12 09 09 PM"
src="https://github.com/user-attachments/assets/b8365d53-31f3-43df-abce-172d608d3c9c">

Am I wiling to eat the added complexity and slightly slower performance
for this nit? Definitely.

DiffTrain build for [e8df0cf](e8df0cf)
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