Commit 48d674b
authored
Do not check for
## Description
In some environments babel plugin is not used (e.g. it can be omitted
when using `Next.js`). Our detector checks if callbacks are `worklets`
by checking `__workletHash` field. However, if plugin wasn't used, this
will be `undefined`. In that case, our warning will wrongly suggest to
use `runOnJS`. This may be misleading, if plugin was skipped on `web`,
but used on native platforms.
In this PR, we check if plugin was applied by checking empty worklet
function. If it has `__workletHash` field it means that plugin was used.
If it wasn't, we won't suggest using `runOnJS`.
## Test plan
Confirmed by the original reporterworklets if babel plugin was not used (#4107)1 parent 118775a commit 48d674b
1 file changed
Lines changed: 11 additions & 1 deletion
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
105 | 115 | | |
106 | 116 | | |
107 | 117 | | |
108 | | - | |
| 118 | + | |
109 | 119 | | |
110 | 120 | | |
111 | 121 | | |
| |||
0 commit comments