Conversation
kmagiera
left a comment
There was a problem hiding this comment.
Looks good 👍 Left a couple of comments. Would be good to test jest environment with these changes as well
|
I can confirm that |
| public class ReanimatedJSIModulePackage implements JSIModulePackage { | ||
|
|
||
| @Override | ||
| public List<JSIModuleSpec> getJSIModules( |
There was a problem hiding this comment.
One thing that I think of now is that we can actually make the transition less of a pain and keep this class with empty implementation + some warning message. This way people won't get compile errors after upgrading. We can show a yellow box for them to update MainApplication.java
There was a problem hiding this comment.
I added @Deprecation annotation and Log.w(). LogBox doesn't have a native interface so we'd need to set some global variable or emit an event which isn't ideal.
|
Is this supposed to work? I cleaned all Gradle caches and tried to reinstall multiple times, but it looks like Reanimated it not built, or not found |
## Description with #3005, we don't need the expo adapter to install JSI bindings. by removing the adapter, this pr will also fix #3084 and fix #3021 ## Changes remove expo adapter ## Test code and steps to reproduce 1. `$ createNPMPackage.sh` 2. create an expo sdk44 project, `yarn add file:/path/to/react-native-reanimated-2.5.0.tgz` and test launching. 2. create an react-native 0.67 project, `yarn add file:/path/to/react-native-reanimated-2.5.0.tgz` and test launching. ## Checklist - [ ] Included code example that can be used to test this change - [ ] Updated TS types - [ ] Added TS types tests - [ ] Added unit / integration tests - [ ] Updated documentation - [ ] Ensured that CI passes
|
@renchap i am getting the same issue. did you solve it? |
|
@ugurdalkiran I did solve it, but I dont remember how. Probably either:
|
## Summary This PR bumps react-native to 0.72.0-rc.5 and slightly changes initialization path on iOS (Paper) due to recent changes in the framework (facebook/react-native#37523). Fixes #4521. Continues #3005. On iOS, Reanimated needs to overwrite two React internal modules: * `RCTUIManager` → `REAUIManager` to intercept `manageChildren` calls in order to observe React tree changes ([here](https://github.com/software-mansion/react-native-reanimated/blob/main/ios/LayoutReanimation/REAUIManager.mm)) * `RCTEventDispatcher` → `REAEventDispatcher` to intercept events in the native code while still on the UI thread ([here](https://github.com/software-mansion/react-native-reanimated/blob/663ee74925cafa4a1a802f4722466dc02cb1760f/ios/REAEventDispatcher.m#L9-L10)) The rest of the initialization (injecting JSI bindings) can be safely done in `installTurboModule` method, as we already do on Android and iOS/Fabric. Previously, this was done using categories (see [`UIResponder+Reanimated.mm`](https://github.com/software-mansion/react-native-reanimated/blob/663ee74925cafa4a1a802f4722466dc02cb1760f/ios/native/UIResponder%2BReanimated.mm#L19-L30)), in particular by overwriting `jsExecutorFactoryForBridge:` method which is called during initialization. However, since 0.72.0-rc.4, this method is already implemented in `RCTAppDelegate` so the trick does no longer work, making the app fail with the following error "[Reanimated] The native part of Reanimated doesn't seem to be initialized". In this PR, I've used a category to overwrite another method `extraModulesForBridge` which swizzles the implementation of `jsExecutorFactoryForBridge` method and runs `REAInitializer` before the original call. As suggested by @kmagiera, alternatively we could just swizzle the methods of `RCTUIManager` and `RCTEventDispatcher`. ## TODO - [x] Restore support for 0.71 and below with #ifdefs ## Test plan <!-- Provide a minimal but complete code snippet that can be used to test out this change along with instructions how to run it and a description of the expected behavior. -->
Description
This patch removes setup instructions for Android. iOS is in progress (there's some complexity with bridge init lifecycle - Reanimated replaces native RN modules).
Changes
ReanimatedJSIModulePackagetoReanimatedModuleby utilizing@ReactMethod(isBlockingSynchronousMethod = true)annotation.Test code and steps to reproduce
I tested it on the example app but maybe it's worth building the package and checking on the freshly generated app.