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

Revert "feat: honor displayName of context types" #18223

Merged
merged 1 commit into from
Mar 5, 2020

Conversation

trueadm
Copy link
Contributor

@trueadm trueadm commented Mar 5, 2020

Reverts #18035. This breaks an internal FB test where we try and set the displayName on the context consumer. Otherwise we get this runtime exception:

TypeError: Cannot set property displayName of #<Object> which has only a getter

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Mar 5, 2020
@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 5, 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 a4f6cfe:

Sandbox Source
elated-curran-nzrtk Configuration

@sizebot
Copy link

sizebot commented Mar 5, 2020

Details of bundled changes.

Comparing: 6a0efdd...a4f6cfe

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -0.3% -0.2% 107.82 KB 107.52 KB 25.77 KB 25.72 KB UMD_DEV
react.production.min.js 0.0% 0.0% 12.45 KB 12.45 KB 4.8 KB 4.8 KB UMD_PROD
react.profiling.min.js 0.0% 0.0% 15.98 KB 15.98 KB 5.88 KB 5.88 KB UMD_PROFILING
react.development.js -0.4% -0.2% 69.3 KB 69.02 KB 18.04 KB 18 KB NODE_DEV
React-dev.js -0.4% -0.2% 74.21 KB 73.93 KB 18.82 KB 18.77 KB FB_WWW_DEV
React-prod.js 0.0% 0.0% 17.63 KB 17.63 KB 4.55 KB 4.55 KB FB_WWW_PROD
React-profiling.js 0.0% 0.0% 17.63 KB 17.63 KB 4.55 KB 4.55 KB FB_WWW_PROFILING

React: size: 0.0%, gzip: 0.0%

Size changes (experimental)

Generated by 🚫 dangerJS against a4f6cfe

@sizebot
Copy link

sizebot commented Mar 5, 2020

Details of bundled changes.

Comparing: 6a0efdd...a4f6cfe

react

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react.development.js -0.3% -0.2% 99.93 KB 99.63 KB 24.56 KB 24.51 KB UMD_DEV
react.production.min.js 0.0% 0.0% 11.59 KB 11.59 KB 4.56 KB 4.56 KB UMD_PROD
react.profiling.min.js 0.0% 0.0% 15.13 KB 15.13 KB 5.67 KB 5.67 KB UMD_PROFILING
react.development.js -0.5% -0.3% 61.77 KB 61.49 KB 16.84 KB 16.79 KB NODE_DEV
React-dev.js -0.4% -0.2% 74.88 KB 74.61 KB 19 KB 18.95 KB FB_WWW_DEV
React-prod.js 0.0% 0.0% 17.69 KB 17.69 KB 4.56 KB 4.56 KB FB_WWW_PROD
React-profiling.js 0.0% 0.0% 17.69 KB 17.69 KB 4.56 KB 4.56 KB FB_WWW_PROFILING

React: size: 0.0%, gzip: 0.0%

Size changes (stable)

Generated by 🚫 dangerJS against a4f6cfe

@trueadm trueadm merged commit 3ee812e into master Mar 5, 2020
@eps1lon
Copy link
Collaborator

eps1lon commented Mar 5, 2020

@trueadm Could you share what you're doing internally so that we can get this in properly?

@eps1lon
Copy link
Collaborator

eps1lon commented Mar 5, 2020

You mean you're setting the displayName on the consumer not context type, right? Like Context.Consumer.displayName = 'Unused'? Is this even supported by react-devtools?

@gaearon
Copy link
Collaborator

gaearon commented Mar 5, 2020

Even if it's unsupported, this is a breaking change if not fixed. :-)

@eps1lon
Copy link
Collaborator

eps1lon commented Mar 5, 2020

Even if it's unsupported, this is a breaking change if not fixed. :-)

Sure I can go ahead and add a warning to the setter. I just think this stance locks any object shape once released because someone might set unsupported properties.

I just need to know what the expected behavior should be.

@trueadm
Copy link
Contributor Author

trueadm commented Mar 5, 2020

Sorry, I meant the context consumer object.

eps1lon added a commit to eps1lon/react that referenced this pull request Mar 5, 2020
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
@kassens kassens deleted the revert-18035-fix/context-displayname branch November 29, 2022 22:20
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.

6 participants