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

devtools: Use context displayName for context hook name #25954

Merged
merged 3 commits into from
Feb 24, 2024

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Jan 1, 2023

Summary

When inspecting the hooks of an element, the display name of the passed context is now used for the context hook (with a fallback to the previous "Context" name).

Before:
Screenshot from 2023-01-01 19-07-45

After:

Screenshot from 2023-01-01 19-40-32

How did you test this change?

  • added tests
  • react-devtools-shell (see attached screenshots)

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jan 1, 2023
@eps1lon eps1lon requested a review from lunaruan January 1, 2023 18:49
@eps1lon eps1lon marked this pull request as ready for review January 1, 2023 18:50
@eps1lon eps1lon force-pushed the devtools/context-hook-displayName branch from aaf7542 to a4acd28 Compare February 18, 2024 15:36
@react-sizebot
Copy link

react-sizebot commented Feb 18, 2024

Comparing: c1fd2a9...b173f2e

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 = 177.01 kB 177.01 kB = 55.17 kB 55.17 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 179.00 kB 179.00 kB = 55.74 kB 55.74 kB
facebook-www/ReactDOM-prod.classic.js = 592.58 kB 592.58 kB = 104.54 kB 104.54 kB
facebook-www/ReactDOM-prod.modern.js = 575.87 kB 575.87 kB = 101.55 kB 101.55 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.production.min.js +4.21% 9.07 kB 9.45 kB +1.09% 3.21 kB 3.25 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.production.min.js +4.21% 9.07 kB 9.45 kB +1.09% 3.21 kB 3.25 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.production.min.js +4.21% 9.07 kB 9.45 kB +1.09% 3.21 kB 3.25 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.development.js +2.04% 27.66 kB 28.22 kB +0.77% 7.36 kB 7.42 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.development.js +2.04% 27.66 kB 28.22 kB +0.77% 7.36 kB 7.42 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.development.js +2.04% 27.66 kB 28.22 kB +0.77% 7.36 kB 7.42 kB
test_utils/ReactAllWarnings.js Deleted 66.79 kB 0.00 kB Deleted 16.36 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-experimental/react-debug-tools/cjs/react-debug-tools.production.min.js +4.21% 9.07 kB 9.45 kB +1.09% 3.21 kB 3.25 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.production.min.js +4.21% 9.07 kB 9.45 kB +1.09% 3.21 kB 3.25 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.production.min.js +4.21% 9.07 kB 9.45 kB +1.09% 3.21 kB 3.25 kB
oss-experimental/react-debug-tools/cjs/react-debug-tools.development.js +2.04% 27.66 kB 28.22 kB +0.77% 7.36 kB 7.42 kB
oss-stable-semver/react-debug-tools/cjs/react-debug-tools.development.js +2.04% 27.66 kB 28.22 kB +0.77% 7.36 kB 7.42 kB
oss-stable/react-debug-tools/cjs/react-debug-tools.development.js +2.04% 27.66 kB 28.22 kB +0.77% 7.36 kB 7.42 kB
test_utils/ReactAllWarnings.js Deleted 66.79 kB 0.00 kB Deleted 16.36 kB 0.00 kB

Generated by 🚫 dangerJS against b173f2e

@eps1lon eps1lon force-pushed the devtools/context-hook-displayName branch from a4acd28 to d0a4b61 Compare February 18, 2024 15:40
@eps1lon eps1lon requested review from hoxyq and removed request for lunaruan February 18, 2024 15:41
@eps1lon eps1lon merged commit aed00da into facebook:main Feb 24, 2024
36 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 24, 2024
@eps1lon eps1lon deleted the devtools/context-hook-displayName branch February 24, 2024 11:18
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
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