-
-
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(Worklets): JS code duplication #6921
base: main
Are you sure you want to change the base?
Conversation
…lets-source-sets' into @tjzel/worklets/duplicate-reanimated-code
…worklets/duplicate-javascript
- name: Use external worklets | ||
if: ${{ inputs.use-external-worklets == 'true' }} | ||
working-directory: ${{ env.COMMON_APP_DIR }} | ||
run: yarn add react-native-worklets@workspace:"*" | ||
|
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 don't understand how things keep duplicating when I rebase 😭
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.
:(((
- name: Use external worklets | ||
if: ${{ inputs.use-external-worklets == 'true' }} | ||
working-directory: ${{ env.COMMON_APP_DIR }} | ||
run: yarn add react-native-worklets@workspace:"*" | ||
|
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.
:(((
Summary
In this PR I'm moving the
WorkletsModule
part of the JS code toreact-native-worklets
. Reanimated would still have those files duplicated via a mechanism introduced in #6827.Now in Reanimated all worklets code must be acquired via a special
WorkletsResolver
module. This is a temporary solution and will be dropped once we requirereact-native-worklets
as a mandatory dependency forreact-native-reanimated
.react-native-worklets
wouldn't be used in the app even though it's not a dependency.WorkletsResolver
.PlatformChecker.ts
explicitly inreact-native-worklets
. This file is small and stable so I don't consider this to be an issue. We can think of some better solution once the package is more polished.commonTypes.ts
between packages.Test plan
Fabric example should work with & without
react-native-worklets
installed. You can check using the debugger that always the correct instance of Worklets' JavaScript code is used.