refactor: data source for errors and warnings tracking is now in Store#31010
Merged
hoxyq merged 1 commit intoSep 24, 2024
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
EdmondChuiHW
approved these changes
Sep 24, 2024
Comment on lines
+117
to
+118
| _cachedUniqueErrorCount: number = 0; | ||
| _cachedUniqueWarningCount: number = 0; |
Contributor
There was a problem hiding this comment.
Nit on naming: "unique" isn't really accurate, i.e. in the example from PR desc, every error can still be different, even if they originate from the same component.
If I understand the PR example correctly, it's a "count of components with any [errors/warnings]".
Maybe we can pick a concise version of the following?
Suggested change
| _cachedUniqueErrorCount: number = 0; | |
| _cachedUniqueWarningCount: number = 0; | |
| _cachedComponentWithAnyErrorCount: number = 0; | |
| _cachedComponentWIthAnyWarningCount: number = 0; |
Contributor
Author
There was a problem hiding this comment.
Yeah, that makes more sense, let me change that
404011c to
06ca431
Compare
This was referenced Sep 25, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on #31009.
showInlineWarningsAndErrorsinSettingscontext (which was removed in refactor[react-devtools]: propagate settings from global hook object to frontend #30610),Storewill now have a boolean flag, which controls if the UI should be displaying information about errors and warnings.2.1. Warning for element
Awas emitted once and warning for elementBwas emitted twice.2.2. With previous implementation, we would show
3 ⚠️, because in total there were 3 warnings in total. If user tries to iterate through these, it will only take 2 steps to do the full cycle, because there are only 2 elements with warnings (with one having same warning, which was emitted twice).2.3 With current implementation, we would show
2 ⚠️. Inspecting the element with doubled warning will still show the warning counter (2) before the warning message.With these changes, the feature correctly works.
https://fburl.com/a7fw92m4