feat: duplicate worklets code the smart way #6827
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
In the transitional period of
react-native-worklets
coming as a separate package, Reanimated should work with or withoutreact-native-worklets
installed. This requires the code of Worklets to be present both inreact-native-reanimated
andreact-native-worklets
.This PR duplicated that code using hard links, so nothing is effectively duplicated. Worklet files remain committed in
react-native-reanimated
for the time being and they are hard linked when executingyarn build
inreact-native-worklets
workspace.I moved
ReanimatedVersion.cpp/h
files back to Reanimated. We'll implement version checking for Worklets when we actually need it.Test plan
Run an Example with these changes.
Then do
yarn add react-native-worklets
(it will use workspace version by default) in the example directory and run it again.