Skip to content

feat: honor displayName of context types#18035

Merged
bvaughn merged 3 commits into
react:masterfrom
eps1lon:fix/context-displayname
Mar 4, 2020
Merged

feat: honor displayName of context types#18035
bvaughn merged 3 commits into
react:masterfrom
eps1lon:fix/context-displayname

Conversation

@eps1lon

@eps1lon eps1lon commented Feb 13, 2020

Copy link
Copy Markdown
Collaborator

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

codesandbox-ci Bot commented Feb 13, 2020

Copy link
Copy Markdown

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

sizebot commented Feb 13, 2020

Copy link
Copy Markdown
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

sizebot commented Feb 13, 2020

Copy link
Copy Markdown
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 force-pushed the fix/context-displayname branch from ea82cd5 to 1c17554 Compare February 13, 2020 18:46
@eps1lon eps1lon mentioned this pull request Mar 3, 2020
@eps1lon eps1lon force-pushed the fix/context-displayname branch from 1c17554 to 0728d1f Compare March 3, 2020 21:15
@eps1lon

eps1lon commented Mar 3, 2020

Copy link
Copy Markdown
Collaborator Author

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

@bvaughn bvaughn left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread packages/react/src/__tests__/ReactContext-test.js Outdated
@bvaughn bvaughn merged commit 45c172d into react: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

trueadm commented Mar 5, 2020

Copy link
Copy Markdown
Contributor

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

bvaughn commented Mar 5, 2020

Copy link
Copy Markdown
Contributor

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