GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — devtools: Use context displayName for context hook name by eps1lon · Pull Request #25954 · react/react

Conversation

@eps1lon

@eps1lon eps1lon commented Jan 1, 2023

Copy link
Copy Markdown
Collaborator

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@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 commented Jan 1, 2023
View reviewed changes
Comment thread packages/react-debug-tools/src/ReactDebugHooks.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

eps1lon
eps1lon commented Jan 1, 2023
View reviewed changes
Comment thread packages/react-debug-tools/src/ReactDebugHooks.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@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 Sebastian Silbermann
devtools: Use context displayName for context hook name
4b7d443
@eps1lon
eps1lon force-pushed the devtools/context-hook-displayName branch from aaf7542 to a4acd28 Compare February 18, 2024 15:36
@react-sizebot

react-sizebot commented Feb 18, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sebastian Silbermann
f
d0a4b61
@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
Sebastian Silbermann
Remove duplicate test
b173f2e
hoxyq
hoxyq approved these changes Feb 19, 2024
View reviewed changes
@eps1lon
eps1lon merged commit aed00da into react:main Feb 24, 2024
github-actions Bot pushed a commit that referenced this pull request Feb 24, 2024
@eps1lon
devtools: Use context displayName for context hook name (#25954)
4f260c3
DiffTrain build for [aed00da](aed00da)
@eps1lon
eps1lon deleted the devtools/context-hook-displayName branch February 24, 2024 11:18
@huozhi huozhi mentioned this pull request Feb 26, 2024
Upgrade vendored react vercel/next.js#62549
Merged
huozhi added a commit to vercel/next.js that referenced this pull request Feb 26, 2024
@huozhi
Upgrade vendored react (#62549)
87015ac
### React upstream changes

- react/react#28438
- react/react#28436
- react/react#25954
- react/react#28434
- react/react#28433
- react/react#28432
- react/react#28415
- react/react#27903
- react/react#28430
- react/react#28424
- react/react#28400
- react/react#28422
- react/react#28423
- react/react#28412
- react/react#28418
- react/react#28421
- react/react#28417
- react/react#28399
- react/react#28408
- react/react#28350
- react/react#28387
- react/react#28403
- react/react#28384
- react/react#28409
- react/react#28398
- react/react#28405
- react/react#28328
- react/react#28402
- react/react#28386
- react/react#28388
- react/react#28379
- react/react#28383
- react/react#28390
- react/react#28389
- react/react#28382
- react/react#28348



Closes NEXT-2600
@ztanner ztanner mentioned this pull request Mar 19, 2024
(backport) Update React from 60a927d04 to 14898b6a9 vercel/next.js#63442
Closed
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@eps1lon @AndyPengc12
devtools: Use context displayName for context hook name (react#25954)
a76568e
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
@eps1lon
devtools: Use context displayName for context hook name (#25954)
9dcf6c5
DiffTrain build for commit aed00da.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@eps1lon
devtools: Use context displayName for context hook name (react#25954)
5c7e565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@hoxyq hoxyq hoxyq approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@eps1lon @react-sizebot @hoxyq @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.