Skip to content

chore: cherry-pick for 3.17.0 #7039

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

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

@tjzel tjzel changed the title feat(plugin): multiple worklet referencing (#6904) chore: cherry-pick for 3.17.0 Feb 18, 2025
tjzel and others added 4 commits February 18, 2025 12:11
Some time ago I added a feature of worklet referencing to the Plugin,
but this was limited to only a single reference:

```ts
function foo(){
	// UI stuff
};

runOnUI(foo)(); // ok, `foo` will get workletized

function bar(){
	// UI stuff
};

const foobar = bar;

runOnUI(foobar); // error, foobar didn't get workletized
```

This PR allows for any amount of references in the reference chain.
Simultaneously I discovered that Gesture Handler callbacks didn't
benefit from worklet referencing, i.e. the following code would be
invalid:

```ts
function foo(){
	// do something
}

const pan = Gesture.Pan().onActive(foo) // `foo` wouldn't be workletized
```

This PR adds this QoL feat for Gesture Handler callbacks.

I added new unit tests for these cases.
Turns out that `sideEffects` field was ignored and `isWeb()` check
evaluated to static false, removing `initializers.ts` from the bundle.

Fixes
- #6740
- #6839

Tested it on RNGH web example app using Expo52

Co-authored-by: Michał Bert <[email protected]>
Since the minimal supported version for Reanimated 4 and Reanimated 3.17
will be 0.75

:shipit:
because why not

all the changes were made by `eslint --fix` and prettier.

🚀
@tjzel tjzel force-pushed the @tjzel/reanimated3/cherry-pick-for-3.17.0-v2 branch from c52e19a to 0116a93 Compare February 18, 2025 11:14
@tjzel tjzel marked this pull request as ready for review February 18, 2025 11:14
@tjzel tjzel merged commit c3ff89f into 3.17-stable Feb 18, 2025
26 of 48 checks passed
@tjzel tjzel deleted the @tjzel/reanimated3/cherry-pick-for-3.17.0-v2 branch February 18, 2025 11:29
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