-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Add ReactMarkerConstants.CONTENT_APPEARED support on Android #43620
Closed
Closed
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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
Oops, something went wrong.
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.
Sorry for the very late review.
This feels risky because
getJSModuleName
asserts, which could introduce new crashes. I understand you changed this so we can override it, but we should either try/catch here or create a new method that doesn't assert and use it instead (and maybe use it to access instead ofmJSModuleName
everywhere in this file).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 for having the comment. after this pr,
mJSModuleName
is only access from the getter.i was thinking that assertion for
getJSModuleName()
could help us catching the issue as early as possible. if we believe thatgetJSModuleName()
should always be non-nullable. otherwise, ifgetJSModuleName()
could be nullable, i don't really like try-catch or introducing new method, having an alternative e6a722d change, please let me know which makes more sense to you.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 agree with this when adding a new API, but modifying an API to introduce this, if the previous behavior wasn't crashing, is not ideal.
Given that we already have some callers in the critical path (e.g.:
startSurface
) that were using the getter with the assert, I think it might be safe to continue using it, even for this use case.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.
alright, if that's more toward existing call paths, having try-catch makes more sense than introducing new method.
i've updated the pr to have try-catch. please check again if that makes sense to you. thanks!
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.
Sorry I think you misunderstood. I meant that you can keep the implementation you had replacing all usages with
getJSModuleName
with the assert because we were already calling that when loading a new surface. If there were cases where it was defined, that should've thrown an error in those cases too. So replacing all withgetJSModuleName
and removing the null checks should be fine.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.
sorry i was easily mistaken. i've reset the branch to the previous version. hopes that is correct.