Native Animated - Restore default values when removing props on Android#12842
Native Animated - Restore default values when removing props on Android#12842janicduplessis wants to merge 6 commits intofacebook:masterfrom
Conversation
6203dcb to
ffc8b92
Compare
|
Hi Janic, do you know who can review changes to native animated on Android? |
|
Replied on slack |
There was a problem hiding this comment.
Not sure if there is a better way to do this, we have to inject a mock in here but there is no way currently. I tried using PowerMockito.whenNew but could not get it to work.
There was a problem hiding this comment.
Ideally we'd also test multithreading here to make sure everything gets called on the proper thread and is safe but I'm not sure how to do that.
|
Also added a regression test and a few extra tests around the scheduling of NativeAnimatedNodesManager operations. |
hramos
left a comment
There was a problem hiding this comment.
Sorry for the delayed review. Is there someone on the React or RN team that you think should review this? I can reach out to them.
There was a problem hiding this comment.
Is reactCtx defined at this point?
There was a problem hiding this comment.
You are right, I messed that up when fixing conflicts.
There was a problem hiding this comment.
Was this method used anywhere?
There was a problem hiding this comment.
This is a method native modules can override that gets called when batches are completed so it is fine to remove it since it will just call the one from the super class.
|
@AaaChiuuu or Andrew Chen could review this |
|
@hramos Could you try to have this reviewed? |
0ede136 to
f6b3f7f
Compare
|
Just pinged @AaaChiuuu |
f6b3f7f to
5fbf352
Compare
hramos
left a comment
There was a problem hiding this comment.
Approving this without any further review as it has been a while since the review was requested, and Janic has already been using this in production for a while. I don't want to slow down contributions from the core team unnecessarily.
|
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
|
This PR has been submitted by a core contributor. Attention: @janicduplessis Generated by 🚫 dangerJS |
|
@hramos Oups, there was a buck build issue and a test I forgot to update, circle is green now it should land smoothly. |
|
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
|
ac43548 is in the process of being reverted. The NativeAnimatedModuleTest started failing when this landed: At this point I am not yet sure why this is breaking internally, when the PR passed tests. Tests also passed on master after this landed. |
|
@hramos Strange that it doesn't fail on OSS CI, is it possible that you are using a different version of mockito internally? According to OSS gradle.properties (https://github.com/facebook/react-native/blob/master/ReactAndroid/gradle.properties#L10) we are using version 1.10.19, same with buck https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/third-party/java/mockito/BUCK#L19. |
Same as #11819 but for Android. I didn't notice the bug initially in my app because I was using different animations on Android which did not trigger this issue.
Test plan
Created a simple repro example and tested that this fixes it. https://gist.github.com/janicduplessis/0f3eb362dae63fedf99a0d3ee041796a