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.
- package/lib/module/utils/jsVersion.js +1 -1
- package/lib/module/workletRuntimeEntry.js +5 -1
- package/lib/module/workletRuntimeEntry.js.map +1 -1
- package/lib/typescript/utils/jsVersion.d.ts +1 -1
- package/lib/typescript/workletRuntimeEntry.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugin/index.js +18 -2
- package/src/utils/jsVersion.ts +1 -1
- package/src/workletRuntimeEntry.ts +7 -4
|
@@ -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
|
-
|
|
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/
|
|
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.
|
|
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,
|
|
1
|
+
{"version":3,"file":"workletRuntimeEntry.d.ts","sourceRoot":"","sources":["../../src/workletRuntimeEntry.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,SAgB7B"}
|
package/package.json
CHANGED
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
|
-
|
|
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) {
|
package/src/utils/jsVersion.ts
CHANGED
|
@@ -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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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.
|