Skip to content

Inject _WORKLET to RN runtime#4511

Merged
tomekzaw merged 3 commits intomainfrom
@tomekzaw/fix-missing-worklet
Jun 6, 2023
Merged

Inject _WORKLET to RN runtime#4511
tomekzaw merged 3 commits intomainfrom
@tomekzaw/fix-missing-worklet

Conversation

@tomekzaw
Copy link
Member

@tomekzaw tomekzaw commented May 31, 2023

Summary

Fixes #4506 and fixes #4507.

Test plan

@leandro-carlos
Copy link

where i inject _WORKLET ?

@t0ma5h
Copy link

t0ma5h commented Jun 1, 2023

@tomekzaw is there an estimate to when this will get merged or should i just fork it 😁?

Copy link
Member

@kmagiera kmagiera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting this has to be added in three places instead of just one, but what can you do 🤷

@tomekzaw
Copy link
Member Author

tomekzaw commented Jun 5, 2023

Once we merge #4523 it will be only two places (one for each platform), and once we cleanup runtime initialization hopefully it will be just one 😄

Co-authored-by: Tymoteusz Boba <tymoteusz.boba@swmansion.com>
@tomekzaw tomekzaw force-pushed the @tomekzaw/fix-missing-worklet branch from 14fb217 to cc8531c Compare June 5, 2023 13:51
@piaskowyk
Copy link
Member

According to my investigation, in out code is possible to call worklet function before globals initialisation - runOnUI doesn't imports core.ts

import { useSharedValue } from 'react-native-reanimated';
console.log(_WORKLET, useSharedValue); // doesn't work
console.log(useSharedValue, _WORKLET); // works

@tomekzaw tomekzaw added this pull request to the merge queue Jun 6, 2023
Merged via the queue into main with commit a27e45f Jun 6, 2023
@tomekzaw tomekzaw deleted the @tomekzaw/fix-missing-worklet branch June 6, 2023 14:31
@alistairholt
Copy link

Great to see this merged. Will it make it into a release soon?

@tomekzaw
Copy link
Member Author

Yep, we're releasing 3.3.0 today.

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.

Missing 'react-native-reanimated/plugin' [3.2.0] V3 Failed to create a worklet. Did you forget to add Reanimated Babel plugin in babel.config.js?

8 participants