-
Notifications
You must be signed in to change notification settings - Fork 48.5k
Update legacy context warning message #17882
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
Conversation
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 32cdbda:
|
Details of bundled changes.Comparing: 0c04aca...32cdbda react-test-renderer
react-native-renderer
react-art
react-dom
react-reconciler
Size changes (experimental) |
Details of bundled changes.Comparing: 0c04aca...32cdbda react-native-renderer
react-reconciler
react-dom
react-art
react-test-renderer
Size changes (stable) |
Fix flow
294effd
to
8baff7e
Compare
packages/react-reconciler/src/__tests__/ReactIncremental-test.internal.js
Show resolved
Hide resolved
packages/react-reconciler/src/__tests__/ReactIncremental-test.internal.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand your original concern better now. I agree with @bvaughn we shouldn't regress DEV perf here since it's a lot of Fibers. I think replacing didWarnAboutLegacyContext
with a Map of Fiber Type => Number of Occurrences makes sense so that we don't have to ask every component's stack.
I think you'll still need a Set to track which types we've flushed the warnings for. So that we don't consider their stacks in next messages.
Does this make sense?
ce97e99
to
ccbd9d9
Compare
Address more feedback Address more feedback
ccbd9d9
to
12d95b6
Compare
@gaearon I've made those changes, let me know if you're happy with them. |
After speaking to @gaearon, we spoke about how we can improve the warning message when using StrictMode with legacy context. Previously, we would output all the offending components and the component stack of the StrictMode, which wasn't that useful in practice. With the changes in this PR, we now output the component stack of the component that most frequently had legacy context warnings in StrictMoode.