-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Android: Support RN50-51 changes #652
Conversation
…lingResource sync by any means, but should help in dire straits.
|
||
static { | ||
try { | ||
Class reactNativeVersion = Class.forName("com.facebook.react.modules.systeminfo.ReactNativeVersion"); |
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.
This class is present only in RN 50 and above.
Later, the getMinor call could fail on these older versions. As we don't actually use this API on older versions, I think we could just set it to 49.5.0 in the catch as a default version.
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.
Good catch, thanks
if (callback != null) { | ||
callback.onTransitionToIdle(); | ||
} | ||
Log.i(LOG_TAG, "AnimatedModule is idle, no operations"); |
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 think we shouldn't log out idle states. Only busy states.
Originally, I also logged both states, but after the initial debugging it become overwhelming.
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.
Agreed
if (callback != null) { | ||
callback.onTransitionToIdle(); | ||
} | ||
Log.i(LOG_TAG, "AnimatedModule is idle, no operations"); |
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 looked at this diff.
I am not even sure that we need an animatedIdlingResource at all on later RN versions. It seems, they delegate everything to the UIModule. I don't fully understand the new flow in that code though.
The check here certainly doesn't do any harm.
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.
Well, it was a trial and error kinda fix :)
But I think that there's a small gap between the time when the UIBlock is posted and when it starts executing.
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 check the VERSION checker comment.
The rest is ok for me.
Done deal |
Awesome! 👍 |
This PR aims to:
waitForReactNativeLoad
by adding Thread.sleep() on RN>=50, not ideal, but will enable usage of Detox on RN51 projects even before we find the true culprit of this sync defect.