react-native-worklets 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@
5
5
  * version used to build the native part of the library in runtime. Remember to
6
6
  * keep this in sync with the version declared in `package.json`
7
7
  */
8
- export const jsVersion = '0.5.0';
8
+ export const jsVersion = '0.5.1';
9
9
  //# sourceMappingURL=jsVersion.js.map
@@ -18,8 +18,12 @@ import { WorkletsError } from "./WorkletsError.js";
18
18
  * `_WORKLETS_BUNDLE_MODE` flag.
19
19
  */
20
20
  export function bundleModeInit() {
21
+ if (SHOULD_BE_USE_WEB) {
22
+ return;
23
+ }
21
24
  globalThis._WORKLETS_BUNDLE_MODE = true;
22
- if (!SHOULD_BE_USE_WEB && globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative) {
25
+ const runtimeKind = globalThis.__RUNTIME_KIND;
26
+ if (runtimeKind && runtimeKind !== RuntimeKind.ReactNative) {
23
27
  /**
24
28
  * We shouldn't call `init()` on RN Runtime here, as it would initialize our
25
29
  * module before React Native has configured the RN Runtime.
@@ -1 +1 @@
1
- {"version":3,"names":["init","SHOULD_BE_USE_WEB","RuntimeKind","WorkletsError","bundleModeInit","globalThis","_WORKLETS_BUNDLE_MODE","__RUNTIME_KIND","ReactNative"],"sourceRoot":"../../src","sources":["workletRuntimeEntry.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,IAAI,QAAQ,mBAAgB;AACrC,SAASC,iBAAiB,QAAQ,4BAAmB;AACrD,SAASC,WAAW,QAAQ,kBAAe;AAC3C,SAASC,aAAa,QAAQ,oBAAiB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAC/BC,UAAU,CAACC,qBAAqB,GAAG,IAAI;EACvC,IACE,CAACL,iBAAiB,IAClBI,UAAU,CAACE,cAAc,KAAKL,WAAW,CAACM,WAAW,EACrD;IACA;AACJ;AACA;AACA;IACIR,IAAI,CAAC,CAAC;IACN,MAAM,IAAIG,aAAa,CAAC,mCAAmC,CAAC;EAC9D;AACF;AAEAC,cAAc,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["init","SHOULD_BE_USE_WEB","RuntimeKind","WorkletsError","bundleModeInit","globalThis","_WORKLETS_BUNDLE_MODE","runtimeKind","__RUNTIME_KIND","ReactNative"],"sourceRoot":"../../src","sources":["workletRuntimeEntry.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,IAAI,QAAQ,mBAAgB;AACrC,SAASC,iBAAiB,QAAQ,4BAAmB;AACrD,SAASC,WAAW,QAAQ,kBAAe;AAC3C,SAASC,aAAa,QAAQ,oBAAiB;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAAA,EAAG;EAC/B,IAAIH,iBAAiB,EAAE;IACrB;EACF;EAEAI,UAAU,CAACC,qBAAqB,GAAG,IAAI;EAEvC,MAAMC,WAAW,GAAGF,UAAU,CAACG,cAAc;EAC7C,IAAID,WAAW,IAAIA,WAAW,KAAKL,WAAW,CAACO,WAAW,EAAE;IAC1D;AACJ;AACA;AACA;IACIT,IAAI,CAAC,CAAC;IACN,MAAM,IAAIG,aAAa,CAAC,mCAAmC,CAAC;EAC9D;AACF;AAEAC,cAAc,CAAC,CAAC","ignoreList":[]}
@@ -3,5 +3,5 @@
3
3
  * version used to build the native part of the library in runtime. Remember to
4
4
  * keep this in sync with the version declared in `package.json`
5
5
  */
6
- export declare const jsVersion = "0.5.0";
6
+ export declare const jsVersion = "0.5.1";
7
7
  //# sourceMappingURL=jsVersion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"workletRuntimeEntry.d.ts","sourceRoot":"","sources":["../../src/workletRuntimeEntry.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,SAa7B"}
1
+ {"version":3,"file":"workletRuntimeEntry.d.ts","sourceRoot":"","sources":["../../src/workletRuntimeEntry.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,SAgB7B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-worklets",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "The React Native multithreading library",
5
5
  "keywords": [
6
6
  "react-native",
package/plugin/index.js CHANGED
@@ -439,6 +439,7 @@ var require_closure = __commonJS({
439
439
  const closureVariables = new Array();
440
440
  const libraryBindingsToImport = /* @__PURE__ */ new Set();
441
441
  const relativeBindingsToImport = /* @__PURE__ */ new Set();
442
+ let recrawled = false;
442
443
  funPath.traverse({
443
444
  "TSType|TSTypeAliasDeclaration|TSInterfaceDeclaration"(typePath) {
444
445
  typePath.skip();
@@ -451,7 +452,12 @@ var require_closure = __commonJS({
451
452
  if (capturedNames.has(name)) {
452
453
  return;
453
454
  }
454
- const binding = idPath.scope.getBinding(name);
455
+ let binding = idPath.scope.getBinding(name);
456
+ if (!binding && !recrawled) {
457
+ recrawled = true;
458
+ idPath.scope.crawl();
459
+ binding = idPath.scope.getBinding(name);
460
+ }
455
461
  if (!binding) {
456
462
  if (globals_12.globals.has(name)) {
457
463
  return;
@@ -1163,7 +1169,12 @@ var require_autoworkletization = __commonJS({
1163
1169
  "withDecay",
1164
1170
  "withRepeat",
1165
1171
  "runOnUI",
1166
- "executeOnUIRuntimeSync"
1172
+ "executeOnUIRuntimeSync",
1173
+ "scheduleOnUI",
1174
+ "runOnUISync",
1175
+ "runOnUIAsync",
1176
+ "runOnRuntime",
1177
+ "scheduleOnRuntime"
1167
1178
  ]);
1168
1179
  var reanimatedFunctionArgsToWorkletize = new Map([
1169
1180
  ["useFrameCallback", [0]],
@@ -1179,6 +1190,11 @@ var require_autoworkletization = __commonJS({
1179
1190
  ["withRepeat", [3]],
1180
1191
  ["runOnUI", [0]],
1181
1192
  ["executeOnUIRuntimeSync", [0]],
1193
+ ["scheduleOnUI", [0]],
1194
+ ["runOnUISync", [0]],
1195
+ ["runOnUIAsync", [0]],
1196
+ ["runOnRuntime", [1]],
1197
+ ["scheduleOnRuntime", [1]],
1182
1198
  ...Array.from(gestureHandlerAutoworkletization_1.gestureHandlerBuilderMethods).map((name) => [name, [0]])
1183
1199
  ]);
1184
1200
  function processIfAutoworkletizableCallback(path, state) {
@@ -4,4 +4,4 @@
4
4
  * version used to build the native part of the library in runtime. Remember to
5
5
  * keep this in sync with the version declared in `package.json`
6
6
  */
7
- export const jsVersion = '0.5.0';
7
+ export const jsVersion = '0.5.1';
@@ -18,11 +18,14 @@ import { WorkletsError } from './WorkletsError';
18
18
  * `_WORKLETS_BUNDLE_MODE` flag.
19
19
  */
20
20
  export function bundleModeInit() {
21
+ if (SHOULD_BE_USE_WEB) {
22
+ return;
23
+ }
24
+
21
25
  globalThis._WORKLETS_BUNDLE_MODE = true;
22
- if (
23
- !SHOULD_BE_USE_WEB &&
24
- globalThis.__RUNTIME_KIND !== RuntimeKind.ReactNative
25
- ) {
26
+
27
+ const runtimeKind = globalThis.__RUNTIME_KIND;
28
+ if (runtimeKind && runtimeKind !== RuntimeKind.ReactNative) {
26
29
  /**
27
30
  * We shouldn't call `init()` on RN Runtime here, as it would initialize our
28
31
  * module before React Native has configured the RN Runtime.