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

feat: honor displayName of context types #18035

Merged
merged 3 commits into from
Mar 4, 2020

Conversation

eps1lon
Copy link
Collaborator

@eps1lon eps1lon commented Feb 13, 2020

Summary

Any component name in errors/warnings that occur during server-side rendering ignore the displayName. However, react-devtools does use this property when computing the component name. The docs mention this property but are very specific about dev tools usage. Is this limitation intentional and if so: why?

Test Plan

Tested by triggering a prop-types error.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 13, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 3968e0b:

Sandbox Source
affectionate-water-rk4n5 Configuration

@sizebot
Copy link

sizebot commented Feb 13, 2020

Details of bundled changes.

Comparing: d2158d6...3968e0b

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js +0.3% +0.2% 99.51 KB 99.81 KB 24.48 KB 24.53 KB UMD_DEV
react.development.js +0.5% +0.3% 61.38 KB 61.66 KB 16.75 KB 16.8 KB NODE_DEV
React-dev.js +0.4% +0.2% 74.44 KB 74.71 KB 18.91 KB 18.95 KB FB_WWW_DEV
React-prod.js 0.0% -0.0% 17.71 KB 17.71 KB 4.57 KB 4.57 KB FB_WWW_PROD
React-profiling.js 0.0% -0.0% 17.71 KB 17.71 KB 4.57 KB 4.57 KB FB_WWW_PROFILING

Size changes (stable)

Generated by 🚫 dangerJS against 3968e0b

@sizebot
Copy link

sizebot commented Feb 13, 2020

Details of bundled changes.

Comparing: d2158d6...3968e0b

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js +0.3% +0.2% 107.4 KB 107.7 KB 25.69 KB 25.74 KB UMD_DEV
react.profiling.min.js 0.0% 0.0% 16 KB 16 KB 5.89 KB 5.89 KB UMD_PROFILING
react.development.js +0.4% +0.2% 68.91 KB 69.19 KB 17.96 KB 18 KB NODE_DEV
react.production.min.js 0.0% 0.0% 7.51 KB 7.51 KB 2.91 KB 2.91 KB NODE_PROD
React-dev.js +0.4% +0.2% 73.76 KB 74.04 KB 18.73 KB 18.77 KB FB_WWW_DEV
React-prod.js 0.0% -0.1% 17.65 KB 17.65 KB 4.56 KB 4.56 KB FB_WWW_PROD
React-profiling.js 0.0% -0.1% 17.65 KB 17.65 KB 4.56 KB 4.56 KB FB_WWW_PROFILING

Size changes (experimental)

Generated by 🚫 dangerJS against 3968e0b

@eps1lon eps1lon mentioned this pull request Mar 3, 2020
@eps1lon
Copy link
Collaborator Author

eps1lon commented Mar 3, 2020

Changed the testing approach and rebase. @bvaughn could you take a look?

Copy link
Contributor

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. One small request.

packages/react/src/__tests__/ReactContext-test.js Outdated Show resolved Hide resolved
@bvaughn bvaughn merged commit 45c172d into facebook:master Mar 4, 2020
@eps1lon eps1lon deleted the fix/context-displayname branch March 4, 2020 23:19
trueadm added a commit that referenced this pull request Mar 5, 2020
@trueadm
Copy link
Contributor

trueadm commented Mar 5, 2020

I've had to revert this PR. Details are in #18223.

trueadm added a commit that referenced this pull request Mar 5, 2020
@eps1lon eps1lon restored the fix/context-displayname branch March 5, 2020 16:38
eps1lon added a commit to eps1lon/react that referenced this pull request Mar 5, 2020
@bvaughn
Copy link
Contributor

bvaughn commented Mar 5, 2020

Thanks, Dominic!

bvaughn pushed a commit that referenced this pull request Mar 5, 2020
* Revert "Revert "feat: honor displayName of context types (#18035)" (#18223)"

This reverts commit 3ee812e.

* Add warning of displayName is set on the consumer

* dedupe warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants