Skip to content
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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

tjzel
Copy link
Collaborator

@tjzel tjzel commented Aug 6, 2024

Summary

This pull request is another part of the effort of bringing react-native-worklets to life. Here I created NativeWorkletsModule to split the responsibilities of NativeReanimatedModule. 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

  • All linting GitHub Actions pass
  • All runtime tests pass
  • Reanimated compatibility checks pass

@tjzel tjzel changed the base branch from main to @tjzel/worklets/dirs-for-native-code August 7, 2024 10:43
@tjzel tjzel force-pushed the @tjzel/worklets/dirs-for-native-code branch from f53cd68 to 567ce36 Compare August 9, 2024 11:21
Base automatically changed from @tjzel/worklets/dirs-for-native-code to main August 12, 2024 13:14
@tjzel tjzel changed the base branch from main to @tjzel/native-code-autosuggestions September 2, 2024 13:26
@tjzel tjzel force-pushed the @tjzel/worklets/common-worklets-module branch from 6de33a7 to d87a9e1 Compare September 3, 2024 07:50
@tjzel tjzel changed the title feat: Add CommonWorkletsModule feat: Add NativeWorkletsModule Sep 3, 2024
@tjzel tjzel marked this pull request as ready for review September 3, 2024 07:58
github-merge-queue bot pushed a commit that referenced this pull request Sep 3, 2024
## Summary

Taken those changes from #6378 for more granularity. I applied various
suggestions coming from Android Studio and clangd.

## Test plan

GitHub Actions + :shipit:
Base automatically changed from @tjzel/native-code-autosuggestions to main September 3, 2024 10:19
@tjzel tjzel requested a review from kmagiera as a code owner September 3, 2024 10:19
@@ -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] {
Copy link
Member

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.

Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants