-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
feat: Add NativeWorkletsModule #6378
Conversation
f53cd68
to
567ce36
Compare
6de33a7
to
d87a9e1
Compare
## Summary Taken those changes from #6378 for more granularity. I applied various suggestions coming from Android Studio and clangd. ## Test plan GitHub Actions +
packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/NativeReanimatedModule.cpp
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/NativeReanimatedModule.cpp
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/NativeReanimatedModule.cpp
Outdated
Show resolved
Hide resolved
@@ -265,10 +183,10 @@ jsi::Value NativeReanimatedModule::registerEventHandler( | |||
rt, worklet, "[Reanimated] Event handler must be a worklet."); | |||
int emitterReactTagInt = emitterReactTag.asNumber(); | |||
|
|||
uiScheduler_->scheduleOnUI([=] { | |||
NativeWorkletsModule_->getUIScheduler()->scheduleOnUI([=, 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.
How about exposing scheduleOnUI
directly from NativeWorkletsModule
? Actually, we could do the same for scheduleOnJS
.
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 idea, but let's save it for the follow-up PR.
packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/NativeReanimatedModule.h
Outdated
Show resolved
Hide resolved
...act-native-reanimated/Common/cpp/reanimated/RuntimeDecorators/REAWorkletRuntimeDecorator.cpp
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/Common/cpp/worklets/NativeModules/NativeWorkletsModule.cpp
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/Common/cpp/worklets/NativeModules/NativeWorkletsModule.h
Outdated
Show resolved
Hide resolved
Sunsetting this PR. I will split it into more PRs for the ease of review. |
Summary
This pull request is another part of the effort of bringing
react-native-worklets
to life. Here I createdNativeWorkletsModule
to split the responsibilities ofNativeReanimatedModule
. I basically split all the native code (C++, Java, Obj-C) into compilation-wise structures between Worklets and Reanimated, instead of directory-wise only as previously.Test plan