-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
[devtools] Fix can't expand prop value in some scenario #20534
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a8111b2
[devtools] Fix can't expand in some scenario
iChenLei 7627c9a
[devtools] Fix can't expand prop value in some scenarios
iChenLei 77f9b70
Merge branch 'devtools-cant-expand' of github.com:iChenLei/react into…
8290732
Merged master and resolved conflicts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
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.
Maybe we can have same issue for Infinty ?
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.
yeah, I miss the scenario which value is Infinity(Infinity is Truthy). Any suggestion for me ? I think i did not understand your PR #19786 (I mean all logic detail) is the biggest obstacle to fix this bug.
Is these code ok? When we loop cleaned array, we filter the duplicate item and don't need check the parent[last]?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.
We don't have duplicate keys here actually. In your example I think we have two symbols with the same name and as I have to change the symbols into a
string
so that we can do thepostmessage
that's why we have this issue.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 didn't write any Symbol in my business code, Just class(decorators) 、mobx and react. I think store and store prototype has same params is the reason. (mobx internal reactivity machine logic)
Mobx will add @observable params to the prototype, so getAllEnumerableKeys will return [..., 'finished', 'finished'].
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.
Thank you. I can now reproduce the issue with a basic object.
Reproduce issue
Maybe @bvaughn we should not include inherited keys or find a way to avoid duplicates ?
Or you think it is normal to have this ?
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.
Ok, I rebase my PR with your code 😆 , and add unit test later. ( Now it's 02:16 in shanghai, china. I need to sleep. Thank u, bvaughn
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.
Please rest! 🙇
Ping me once you've added a test and I'll review again.
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.
@bvaughn Hi, I had finished the unit test, please review, thank u very much ! 😆
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.
Thanks. It's back in my queue.
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.
If no problem in this pull request, I hope you can release a new small version (eg: 4.10.2) for react devtools , that's very helpful for my team. Thank you ! bvaughn