react-native-worklets 0.7.4 → 0.8.0-bundle-mode-preview-2
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/.worklets/dummy.md +1 -0
- package/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp +32 -28
- package/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.h +13 -5
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +7 -5
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +5 -4
- package/Common/cpp/worklets/Resources/SynchronizableUnpacker.cpp +1 -1
- package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp +42 -19
- package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h +2 -0
- package/Common/cpp/worklets/Tools/Defs.h +2 -2
- package/Common/cpp/worklets/Tools/ScriptBuffer.h +34 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeBindings.h +24 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +11 -6
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +82 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +12 -0
- package/RNWorklets.podspec +15 -14
- package/android/CMakeLists.txt +8 -2
- package/android/build.gradle +92 -56
- package/android/src/main/cpp/worklets/android/JScriptBufferWrapper.cpp +67 -0
- package/android/src/main/cpp/worklets/android/JScriptBufferWrapper.h +48 -0
- package/android/src/main/cpp/worklets/android/JWorkletRuntimeWrapper.cpp +52 -0
- package/android/src/main/cpp/worklets/android/JWorkletRuntimeWrapper.h +43 -0
- package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +115 -19
- package/android/src/main/cpp/worklets/android/WorkletsModule.h +11 -13
- package/android/src/main/cpp/worklets/android/WorkletsOnLoad.cpp +6 -0
- package/android/src/main/java/com/swmansion/worklets/ScriptBufferWrapper.java +88 -0
- package/android/src/networking/com/swmansion/worklets/WorkletRuntimeWrapper.kt +23 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsHeaderUtil.kt +30 -0
- package/android/src/{legacyBundling → networking}/com/swmansion/worklets/WorkletsModule.java +52 -2
- package/android/src/networking/com/swmansion/worklets/WorkletsNetworkEventUtil.kt +268 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsNetworking.kt +1084 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsOkHttpCallUtil.kt +37 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressListener.kt +9 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressRequestBody.kt +98 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressResponseBody.kt +57 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressiveStringDecoder.kt +82 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsRequestBodyUtil.kt +177 -0
- package/android/src/{experimentalBundling → no-networking}/com/swmansion/worklets/WorkletsModule.java +10 -15
- package/apple/worklets/apple/Networking/WorkletsNetworking.h +22 -0
- package/apple/worklets/apple/Networking/WorkletsNetworking.mm +706 -0
- package/apple/worklets/apple/WorkletsModule.mm +56 -17
- package/bundleMode/index.d.ts +3 -0
- package/bundleMode/index.js +103 -48
- package/compatibility.json +5 -2
- package/lib/module/WorkletsModule/NativeWorklets.native.js +8 -2
- package/lib/module/WorkletsModule/NativeWorklets.native.js.map +1 -1
- package/lib/module/bundleMode/metroOverrides.native.js +115 -0
- package/lib/module/bundleMode/metroOverrides.native.js.map +1 -0
- package/lib/module/bundleMode/network.native.js +41 -0
- package/lib/module/bundleMode/network.native.js.map +1 -0
- package/lib/module/debug/jsVersion.js +1 -1
- package/lib/module/debug/jsVersion.js.map +1 -1
- package/lib/module/featureFlags/staticFlags.json +2 -0
- package/lib/module/featureFlags/types.js +3 -1
- package/lib/module/featureFlags/types.js.map +1 -1
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/initializers/initializers.native.js +14 -43
- package/lib/module/initializers/initializers.native.js.map +1 -1
- package/lib/module/initializers/workletRuntimeEntry.native.js +3 -3
- package/lib/module/initializers/workletRuntimeEntry.native.js.map +1 -1
- package/lib/module/memory/bundleUnpacker.native.js +2 -2
- package/lib/module/memory/bundleUnpacker.native.js.map +1 -1
- package/lib/module/memory/serializable.native.js +3 -3
- package/lib/module/memory/serializable.native.js.map +1 -1
- package/lib/module/memory/synchronizableUnpacker.native.js +1 -1
- package/lib/module/memory/synchronizableUnpacker.native.js.map +1 -1
- package/lib/module/platformChecker.js +2 -2
- package/lib/module/platformChecker.js.map +1 -1
- package/lib/module/runtimeKind.js +51 -0
- package/lib/module/runtimeKind.js.map +1 -1
- package/lib/module/runtimes.js +3 -0
- package/lib/module/runtimes.js.map +1 -1
- package/lib/module/runtimes.native.js +32 -2
- package/lib/module/runtimes.native.js.map +1 -1
- package/lib/module/threads.native.js +2 -2
- package/lib/module/threads.native.js.map +1 -1
- package/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts.map +1 -1
- package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts +2 -1
- package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map +1 -1
- package/lib/typescript/bundleMode/metroOverrides.native.d.ts +28 -0
- package/lib/typescript/bundleMode/metroOverrides.native.d.ts.map +1 -0
- package/lib/typescript/bundleMode/network.native.d.ts +7 -0
- package/lib/typescript/bundleMode/network.native.d.ts.map +1 -0
- package/lib/typescript/debug/jsVersion.d.ts +1 -1
- package/lib/typescript/debug/jsVersion.d.ts.map +1 -1
- package/lib/typescript/featureFlags/types.d.ts +3 -1
- package/lib/typescript/featureFlags/types.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +2 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/initializers/initializers.native.d.ts.map +1 -1
- package/lib/typescript/initializers/workletRuntimeEntry.native.d.ts +1 -1
- package/lib/typescript/memory/bundleUnpacker.native.d.ts.map +1 -1
- package/lib/typescript/platformChecker.d.ts.map +1 -1
- package/lib/typescript/runtimeKind.d.ts +31 -0
- package/lib/typescript/runtimeKind.d.ts.map +1 -1
- package/lib/typescript/runtimes.d.ts +1 -0
- package/lib/typescript/runtimes.d.ts.map +1 -1
- package/lib/typescript/runtimes.native.d.ts +20 -2
- package/lib/typescript/runtimes.native.d.ts.map +1 -1
- package/lib/typescript/threads.native.d.ts +1 -1
- package/package.json +11 -13
- package/plugin/index.d.ts +109 -0
- package/plugin/index.js +60 -13
- package/scripts/worklets_utils.rb +21 -5
- package/src/WorkletsModule/NativeWorklets.native.ts +14 -4
- package/src/WorkletsModule/workletsModuleProxy.ts +6 -3
- package/src/bundleMode/metroOverrides.native.ts +151 -0
- package/src/bundleMode/network.native.ts +59 -0
- package/src/debug/jsVersion.ts +1 -1
- package/src/featureFlags/staticFlags.json +2 -0
- package/src/featureFlags/types.ts +3 -1
- package/src/index.ts +10 -1
- package/src/initializers/initializers.native.ts +19 -63
- package/src/initializers/workletRuntimeEntry.native.ts +3 -3
- package/src/memory/bundleUnpacker.native.ts +2 -4
- package/src/memory/serializable.native.ts +3 -3
- package/src/memory/synchronizableUnpacker.native.ts +1 -1
- package/src/platformChecker.ts +3 -2
- package/src/privateGlobals.d.ts +3 -1
- package/src/runtimeKind.ts +47 -0
- package/src/runtimes.native.ts +41 -2
- package/src/runtimes.ts +10 -0
- package/src/threads.native.ts +2 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluating HMR updates on Worklet Runtimes leads to verbose warnings which
|
|
3
|
+
* don't affect runtime. This function silences those warnings by providing a
|
|
4
|
+
* dummy Refresh module to the global scope.
|
|
5
|
+
*
|
|
6
|
+
* Use only in dev builds.
|
|
7
|
+
*/
|
|
8
|
+
export declare function silenceHMRWarnings(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Importing `react-native` on Worklet Runtimes will result in a crash due to
|
|
11
|
+
* the fact that React Native will try to set itself up as on the React Native
|
|
12
|
+
* runtime. To provide better developer experience we override the main React
|
|
13
|
+
* Native module with a proxy that puts an actionable warning.
|
|
14
|
+
*
|
|
15
|
+
* Note that this doesn't affect deep imports.
|
|
16
|
+
*
|
|
17
|
+
* Use only in dev builds.
|
|
18
|
+
*/
|
|
19
|
+
export declare function disallowRNImports(): void;
|
|
20
|
+
/**
|
|
21
|
+
* To use code from React Native that obtains TurboModules we need to mock the
|
|
22
|
+
* registry even if the TurboModules aren't actually used.
|
|
23
|
+
*
|
|
24
|
+
* This is needed for example for the XHR setup code that is imported from React
|
|
25
|
+
* Native.
|
|
26
|
+
*/
|
|
27
|
+
export declare function mockTurboModuleRegistry(): void;
|
|
28
|
+
//# sourceMappingURL=metroOverrides.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metroOverrides.native.d.ts","sourceRoot":"","sources":["../../../src/bundleMode/metroOverrides.native.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,SAajC;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,SAyChC;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,SAsCtC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mocks necessary networking TurboModules on Worklet Runtimes to prevent
|
|
3
|
+
* crashes when code running on Worklet Runtimes tries to use networking APIs.
|
|
4
|
+
* The NetworkingModule itself is injected via C++.
|
|
5
|
+
*/
|
|
6
|
+
export declare function initializeNetworking(): void;
|
|
7
|
+
//# sourceMappingURL=network.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.native.d.ts","sourceRoot":"","sources":["../../../src/bundleMode/network.native.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,oBAAoB,SAuBnC"}
|
|
@@ -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.
|
|
6
|
+
export declare const jsVersion = "0.8.0-bundle-mode-preview-2";
|
|
7
7
|
//# sourceMappingURL=jsVersion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsVersion.d.ts","sourceRoot":"","sources":["../../../src/debug/jsVersion.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"jsVersion.d.ts","sourceRoot":"","sources":["../../../src/debug/jsVersion.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,gCAAgC,CAAC"}
|
|
@@ -12,7 +12,9 @@ export type DynamicFlagName = keyof Omit<Omit<DynamicFlagsType, 'setFlag' | 'get
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const DefaultStaticFeatureFlags: {
|
|
14
14
|
readonly RUNTIME_TEST_FLAG: false;
|
|
15
|
-
readonly
|
|
15
|
+
readonly BUNDLE_MODE_ENABLED: false;
|
|
16
|
+
readonly FETCH_PREVIEW_ENABLED: false;
|
|
17
|
+
readonly IOS_DYNAMIC_FRAMERATE_ENABLED: true;
|
|
16
18
|
};
|
|
17
19
|
export type StaticFeatureFlagsSchema = {
|
|
18
20
|
-readonly [K in keyof typeof DefaultStaticFeatureFlags]: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACrD,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CACtC,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAAC,EAC7C,MAAM,CACP,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,CAAC,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACrD,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC;CACzC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CACtC,IAAI,CAAC,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAAC,EAC7C,MAAM,CACP,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,yBAAyB;;;;;CAKY,CAAC;AAEnD,MAAM,MAAM,wBAAwB,GAAG;IACrC,CAAC,UAAU,CAAC,IAAI,MAAM,OAAO,yBAAyB,GAAG,OAAO;CACjE,CAAC"}
|
|
@@ -5,8 +5,8 @@ export { createSerializable, isSerializableRef, registerCustomSerializable, } fr
|
|
|
5
5
|
export { serializableMappingCache } from './memory/serializableMappingCache';
|
|
6
6
|
export { createSynchronizable } from './memory/synchronizable';
|
|
7
7
|
export type { RegistrationData, SerializableRef, Synchronizable, SynchronizableRef, } from './memory/types';
|
|
8
|
-
export { getRuntimeKind, RuntimeKind } from './runtimeKind';
|
|
9
|
-
export { createWorkletRuntime, runOnRuntime, scheduleOnRuntime, } from './runtimes';
|
|
8
|
+
export { getRuntimeKind, isRNRuntime, isUIRuntime, isWorkerRuntime, isWorkletRuntime, RuntimeKind, } from './runtimeKind';
|
|
9
|
+
export { createWorkletRuntime, runOnRuntime, runOnRuntimeSync, scheduleOnRuntime, } from './runtimes';
|
|
10
10
|
export { callMicrotasks, executeOnUIRuntimeSync, runOnJS, runOnUI, runOnUIAsync, runOnUISync, scheduleOnRN, scheduleOnUI, unstable_eventLoopTask, } from './threads';
|
|
11
11
|
export type { WorkletFunction, WorkletRuntime, WorkletStackDetails, } from './types';
|
|
12
12
|
export { isWorkletFunction } from './workletFunction';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,cAAc,EACd,aAAa,EACb,KAAK,kBAAkB,EACvB,+BAA+B,EAC/B,2BAA2B,EAC3B,qBAAqB,EACrB,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,cAAc,EACd,WAAW,EACX,WAAW,EACX,eAAe,EACf,gBAAgB,EAChB,WAAW,GACZ,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,OAAO,EACP,OAAO,EACP,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EAEZ,sBAAsB,GACvB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,eAAe,EACf,cAAc,EACd,mBAAmB,GACpB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,YAAY,EACV,eAAe,EACf,mBAAmB,GACpB,MAAM,sCAAsC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializers.native.d.ts","sourceRoot":"","sources":["../../../src/initializers/initializers.native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initializers.native.d.ts","sourceRoot":"","sources":["../../../src/initializers/initializers.native.ts"],"names":[],"mappings":"AAkCA;;;;;;;;;;;;GAYG;AACH,wBAAgB,8BAA8B,IAAI,OAAO,OAAO,CA8B/D;AAED,wBAAgB,YAAY,CAAC,sBAAsB,EAAE,OAAO,OAAO,QAWlE;AAED,wBAAgB,eAAe,SAG9B;AAID,wBAAgB,IAAI,SAcnB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* error is caught in C++ code.
|
|
9
9
|
*
|
|
10
10
|
* This function has no effect on the RN Runtime beside setting the
|
|
11
|
-
* `
|
|
11
|
+
* `_WORKLETS_BUNDLE_MODE_ENABLED` flag.
|
|
12
12
|
*/
|
|
13
13
|
export declare function bundleModeInit(): void;
|
|
14
14
|
//# sourceMappingURL=workletRuntimeEntry.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundleUnpacker.native.d.ts","sourceRoot":"","sources":["../../../src/memory/bundleUnpacker.native.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhE,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,QAAQ,CAAC,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CA4BT;
|
|
1
|
+
{"version":3,"file":"bundleUnpacker.native.d.ts","sourceRoot":"","sources":["../../../src/memory/bundleUnpacker.native.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhE,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,QAAQ,CAAC,EAAE,MAAM,EACjB,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CA4BT;AA+BD,UAAU,cAAe,SAAQ,eAAe;IAC9C,MAAM,EAAE,OAAO,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformChecker.d.ts","sourceRoot":"","sources":["../../src/platformChecker.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,EAAE,OAAsC,CAAC;AAC7D,eAAO,MAAM,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"platformChecker.d.ts","sourceRoot":"","sources":["../../src/platformChecker.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,EAAE,OAAsC,CAAC;AAC7D,eAAO,MAAM,MAAM,EAAE,OAAyD,CAAC;AAC/E,eAAO,MAAM,UAAU,EAAE,OACK,CAAC;AAC/B,eAAO,MAAM,iBAAiB,EAAE,OAAyC,CAAC"}
|
|
@@ -22,4 +22,35 @@ export declare enum RuntimeKind {
|
|
|
22
22
|
* @returns The kind of the current runtime.
|
|
23
23
|
*/
|
|
24
24
|
export declare function getRuntimeKind(): RuntimeKind;
|
|
25
|
+
/**
|
|
26
|
+
* Checks if the current runtime is the [React Native
|
|
27
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds/#rn-runtime).
|
|
28
|
+
*
|
|
29
|
+
* @returns `true` if the current runtime is the React Native Runtime, `false`
|
|
30
|
+
* otherwise.
|
|
31
|
+
*/
|
|
32
|
+
export declare function isRNRuntime(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Checks if the current runtime is a [Worklet
|
|
35
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds/#worklet-runtime).
|
|
36
|
+
*
|
|
37
|
+
* @returns `true` if the current runtime is a Worklet Runtime, `false`
|
|
38
|
+
* otherwise.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isWorkletRuntime(): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Checks if the current runtime is the [UI
|
|
43
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds/#ui-runtime).
|
|
44
|
+
*
|
|
45
|
+
* @returns `true` if the current runtime is the UI Runtime, `false` otherwise.
|
|
46
|
+
*/
|
|
47
|
+
export declare function isUIRuntime(): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Checks if the current runtime is a [Worker
|
|
50
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds/#worker-runtime).
|
|
51
|
+
*
|
|
52
|
+
* @returns `true` if the current runtime is a Worker Runtime, `false`
|
|
53
|
+
* otherwise.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isWorkerRuntime(): boolean;
|
|
25
56
|
//# sourceMappingURL=runtimeKind.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimeKind.d.ts","sourceRoot":"","sources":["../../src/runtimeKind.ts"],"names":[],"mappings":"AAEA,oBAAY,WAAW;IACrB;;;OAGG;IACH,WAAW,IAAI;IACf;;;OAGG;IACH,EAAE,IAAI;IACN,wDAAwD;IACxD,MAAM,IAAI;CACX;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAG5C"}
|
|
1
|
+
{"version":3,"file":"runtimeKind.d.ts","sourceRoot":"","sources":["../../src/runtimeKind.ts"],"names":[],"mappings":"AAEA,oBAAY,WAAW;IACrB;;;OAGG;IACH,WAAW,IAAI;IACf;;;OAGG;IACH,EAAE,IAAI;IACN,wDAAwD;IACxD,MAAM,IAAI;CACX;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAG5C;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAGrC;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,IAAI,OAAO,CAG1C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,IAAI,OAAO,CAGrC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAGzC"}
|
|
@@ -3,4 +3,5 @@ export declare function createWorkletRuntime(config?: WorkletRuntimeConfig): Wor
|
|
|
3
3
|
export declare function createWorkletRuntime(name?: string, initializer?: () => void): WorkletRuntime;
|
|
4
4
|
export declare function runOnRuntime<Args extends unknown[], ReturnValue>(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue): WorkletFunction<Args, ReturnValue>;
|
|
5
5
|
export declare function scheduleOnRuntime<Args extends unknown[], ReturnValue>(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue, ...args: Args): void;
|
|
6
|
+
export declare function runOnRuntimeSync<Args extends unknown[], ReturnValue>(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue, ...args: Args): ReturnValue;
|
|
6
7
|
//# sourceMappingURL=runtimes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/runtimes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CAAC;AAElB,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,cAAc,CAAC;AAMlB,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAMtC,wBAAgB,iBAAiB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EACnE,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"runtimes.d.ts","sourceRoot":"","sources":["../../src/runtimes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CAAC;AAElB,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,cAAc,CAAC;AAMlB,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAMtC,wBAAgB,iBAAiB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EACnE,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,IAAI,CAAC;AAMR,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAClE,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,WAAW,CAAC"}
|
|
@@ -41,8 +41,8 @@ export declare function createWorkletRuntime(name?: string, initializer?: () =>
|
|
|
41
41
|
* or another [Worker
|
|
42
42
|
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime),
|
|
43
43
|
* unless the [Bundle
|
|
44
|
-
* Mode](https://docs.swmansion.com/react-native-worklets/docs/
|
|
45
|
-
*
|
|
44
|
+
* Mode](https://docs.swmansion.com/react-native-worklets/docs/bundleMode/) is
|
|
45
|
+
* enabled.
|
|
46
46
|
*
|
|
47
47
|
* @param workletRuntime - The runtime to schedule the worklet on.
|
|
48
48
|
* @param worklet - The worklet to schedule.
|
|
@@ -56,4 +56,22 @@ export declare function scheduleOnRuntime<Args extends unknown[], ReturnValue>(w
|
|
|
56
56
|
* Schedule a worklet to execute on the background queue.
|
|
57
57
|
*/
|
|
58
58
|
export declare function runOnRuntime<Args extends unknown[], ReturnValue>(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue): WorkletFunction<Args, ReturnValue>;
|
|
59
|
+
/**
|
|
60
|
+
* Lets you run a function synchronously on a [Worker
|
|
61
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime).
|
|
62
|
+
*
|
|
63
|
+
* - This function cannot be called from the [UI
|
|
64
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
65
|
+
* or another [Worker
|
|
66
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime),
|
|
67
|
+
* unless the [Bundle
|
|
68
|
+
* Mode](https://docs.swmansion.com/react-native-worklets/docs/bundleMode/) is
|
|
69
|
+
* enabled.
|
|
70
|
+
*
|
|
71
|
+
* @param workletRuntime - The runtime to run the worklet on.
|
|
72
|
+
* @param worklet - The worklet to run.
|
|
73
|
+
* @param args - The arguments to pass to the worklet.
|
|
74
|
+
* @returns The return value of the worklet.
|
|
75
|
+
*/
|
|
76
|
+
export declare function runOnRuntimeSync<Args extends unknown[], ReturnValue>(workletRuntime: WorkletRuntime, worklet: (...args: Args) => ReturnValue, ...args: Args): ReturnValue;
|
|
59
77
|
//# sourceMappingURL=runtimes.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtimes.native.d.ts","sourceRoot":"","sources":["../../src/runtimes.native.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAIjB;;;;;;;;GAQG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CAAC;AAElB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,cAAc,CAAC;AAsDlB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,wBAAgB,iBAAiB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EACnE,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,IAAI,CAAC;AAiCR;;;;GAIG;AAGH,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"runtimes.native.d.ts","sourceRoot":"","sources":["../../src/runtimes.native.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAIjB;;;;;;;;GAQG;AAEH,wBAAgB,oBAAoB,CAClC,MAAM,CAAC,EAAE,oBAAoB,GAC5B,cAAc,CAAC;AAElB;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,CAAC,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,IAAI,GACvB,cAAc,CAAC;AAsDlB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,wBAAgB,iBAAiB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EACnE,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,IAAI,CAAC;AAiCR;;;;GAIG;AAGH,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,GACtC,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAmBtC;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAClE,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EACvC,GAAG,IAAI,EAAE,IAAI,GACZ,WAAW,CAgBb"}
|
|
@@ -14,7 +14,7 @@ export declare const callMicrotasks: typeof callMicrotasksOnUIThread;
|
|
|
14
14
|
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime)
|
|
15
15
|
* or a [Worker
|
|
16
16
|
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime),
|
|
17
|
-
* unless you have the [Bundle Mode](/docs/
|
|
17
|
+
* unless you have the [Bundle Mode](/docs/bundleMode/) enabled.
|
|
18
18
|
*
|
|
19
19
|
* @param fun - A reference to a function you want to schedule on the [UI
|
|
20
20
|
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-worklets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-bundle-mode-preview-2",
|
|
4
4
|
"description": "The React Native multithreading library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native",
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
"type:check:src:web": "yarn tsc --noEmit --project tsconfig.web.json",
|
|
37
37
|
"type:check:app": "yarn workspace common-app type:check",
|
|
38
38
|
"type:check:plugin": "yarn workspace babel-plugin-worklets type:check",
|
|
39
|
-
"type:check:tests": "../../scripts/test-ts.sh __typetests__"
|
|
39
|
+
"type:check:tests": "../../scripts/test-ts.sh __typetests__",
|
|
40
|
+
"tree-shake:check:web": "yarn is-tree-shakable --resolution web"
|
|
40
41
|
},
|
|
41
42
|
"repository": {
|
|
42
43
|
"type": "git",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"homepage": "https://docs.swmansion.com/react-native-worklets",
|
|
52
53
|
"peerDependencies": {
|
|
53
54
|
"@babel/core": "*",
|
|
55
|
+
"@react-native/metro-config": "*",
|
|
54
56
|
"react": "*",
|
|
55
57
|
"react-native": "*"
|
|
56
58
|
},
|
|
@@ -65,13 +67,14 @@
|
|
|
65
67
|
"@babel/plugin-transform-unicode-regex": "7.27.1",
|
|
66
68
|
"@babel/preset-typescript": "7.27.1",
|
|
67
69
|
"convert-source-map": "2.0.0",
|
|
70
|
+
"is-tree-shakable": "0.4.1",
|
|
68
71
|
"semver": "7.7.3"
|
|
69
72
|
},
|
|
70
73
|
"devDependencies": {
|
|
71
74
|
"@babel/cli": "7.28.3",
|
|
72
75
|
"@babel/core": "7.28.4",
|
|
73
|
-
"@react-native-community/cli": "20.
|
|
74
|
-
"@react-native/eslint-config": "0.83.
|
|
76
|
+
"@react-native-community/cli": "20.1.0",
|
|
77
|
+
"@react-native/eslint-config": "0.83.0",
|
|
75
78
|
"@types/jest": "30.0.0",
|
|
76
79
|
"@types/node": "24.7.0",
|
|
77
80
|
"@types/react": "19.2.2",
|
|
@@ -82,8 +85,8 @@
|
|
|
82
85
|
"knip": "5.61.3",
|
|
83
86
|
"madge": "8.0.0",
|
|
84
87
|
"prettier": "3.6.2",
|
|
85
|
-
"react": "19.2.
|
|
86
|
-
"react-native": "0.
|
|
88
|
+
"react": "19.2.3",
|
|
89
|
+
"react-native": "0.84.0-rc.2",
|
|
87
90
|
"react-native-builder-bob": "0.40.13",
|
|
88
91
|
"typescript": "5.8.3"
|
|
89
92
|
},
|
|
@@ -113,6 +116,8 @@
|
|
|
113
116
|
"!android/gradlew",
|
|
114
117
|
"!android/gradlew.bat",
|
|
115
118
|
"!android/local.properties",
|
|
119
|
+
"!.worklets",
|
|
120
|
+
".worklets/dummy.md",
|
|
116
121
|
"!**/__tests__",
|
|
117
122
|
"!**/__fixtures__",
|
|
118
123
|
"!**/__mocks__",
|
|
@@ -147,13 +152,6 @@
|
|
|
147
152
|
"jsSrcsDir": "src/specs",
|
|
148
153
|
"android": {
|
|
149
154
|
"javaPackageName": "com.swmansion.worklets"
|
|
150
|
-
},
|
|
151
|
-
"ios": {
|
|
152
|
-
"modulesConformingToProtocol": {
|
|
153
|
-
"RCTBundleConsumer": [
|
|
154
|
-
"WorkletsModule"
|
|
155
|
-
]
|
|
156
|
-
}
|
|
157
155
|
}
|
|
158
156
|
}
|
|
159
157
|
}
|
package/plugin/index.d.ts
CHANGED
|
@@ -1,13 +1,122 @@
|
|
|
1
1
|
export interface PluginOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Enables the [Bundle
|
|
4
|
+
* Mode](https://docs.swmansion.com/react-native-worklets/docs/experimental/bundle-mode).
|
|
5
|
+
*
|
|
6
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#bundle-mode}
|
|
7
|
+
*
|
|
8
|
+
* - Defaults to `false`.
|
|
9
|
+
*/
|
|
2
10
|
bundleMode?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Turning on this option suppresses a helpful warning when you use [inline
|
|
13
|
+
* shared
|
|
14
|
+
* values](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/glossary#animations-in-inline-styling).
|
|
15
|
+
*
|
|
16
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#disableinlinestyleswarning}
|
|
17
|
+
*
|
|
18
|
+
* - Defaults to `false`.
|
|
19
|
+
*/
|
|
3
20
|
disableInlineStylesWarning?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* This option turns off the source map generation for worklets. Mostly used
|
|
23
|
+
* for testing purposes.
|
|
24
|
+
*
|
|
25
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#disablesourcemaps}
|
|
26
|
+
*
|
|
27
|
+
* - Defaults to `false`.
|
|
28
|
+
*/
|
|
4
29
|
disableSourceMaps?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Disables [Worklet Classes
|
|
32
|
+
* support](https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/about#experimental-worklet-classes).
|
|
33
|
+
* You might need to disable this feature when using [Custom
|
|
34
|
+
* Serializables](https://docs.swmansion.com/react-native-worklets/docs/memory/registerCustomSerializable).
|
|
35
|
+
*
|
|
36
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#disableworkletclasses}
|
|
37
|
+
*
|
|
38
|
+
* - Defaults to `false`.
|
|
39
|
+
*/
|
|
5
40
|
disableWorkletClasses?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* This is a list of Babel plugins that will be used when transforming
|
|
43
|
+
* worklets' code with Worklets Babel Plugin.
|
|
44
|
+
*
|
|
45
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#extraplugins}
|
|
46
|
+
*
|
|
47
|
+
* - Defaults to an empty array `[]`.
|
|
48
|
+
*/
|
|
6
49
|
extraPlugins?: string[];
|
|
50
|
+
/**
|
|
51
|
+
* This is a list of Babel presets that will be used when transforming
|
|
52
|
+
* worklets' code with Worklets Babel Plugin.
|
|
53
|
+
*
|
|
54
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#extrapresets}
|
|
55
|
+
*
|
|
56
|
+
* - Defaults to an empty array `[]`.
|
|
57
|
+
*/
|
|
7
58
|
extraPresets?: string[];
|
|
59
|
+
/**
|
|
60
|
+
* This is a list of identifiers (objects) that will not be copied to the UI
|
|
61
|
+
* thread if a worklet requires them.
|
|
62
|
+
*
|
|
63
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#globals}
|
|
64
|
+
*
|
|
65
|
+
* - Defaults to an empty array `[]`.
|
|
66
|
+
*/
|
|
8
67
|
globals?: string[];
|
|
68
|
+
/**
|
|
69
|
+
* This option comes in handy for Web apps. Because Babel ordinarily doesn't
|
|
70
|
+
* get information about the target platform, it includes worklet data in
|
|
71
|
+
* the bundle that only Native apps find relevant. If you enable this
|
|
72
|
+
* option, your bundle size will be smaller.
|
|
73
|
+
*
|
|
74
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#omitnativeonlydata}
|
|
75
|
+
*
|
|
76
|
+
* - Defaults to `false`.
|
|
77
|
+
*/
|
|
9
78
|
omitNativeOnlyData?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* This option dictates the passed file location for a worklet's source map.
|
|
81
|
+
* If you enable this option, the file paths will be relative to
|
|
82
|
+
* `process.cwd` (the current directory where Babel executes). This can be
|
|
83
|
+
* handy for Jest test snapshots to ensure consistent results across
|
|
84
|
+
* machines.
|
|
85
|
+
*
|
|
86
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#relativesourcelocation}
|
|
87
|
+
*
|
|
88
|
+
* - Defaults to `false`.
|
|
89
|
+
*/
|
|
10
90
|
relativeSourceLocation?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* This option makes it so no global identifiers are implicitly captured in
|
|
93
|
+
* worklets' closures between runtimes.
|
|
94
|
+
*
|
|
95
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#strictglobal}
|
|
96
|
+
*
|
|
97
|
+
* Defaults to `false`.
|
|
98
|
+
*/
|
|
99
|
+
strictGlobal?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* This option can also be useful for Web apps. In Reanimated, there are
|
|
102
|
+
* numerous checks to determine the right function implementation for a
|
|
103
|
+
* specific target platform. Enabling this option changes all the checks
|
|
104
|
+
* that identify if the target is a Web app to `true`. This alteration can
|
|
105
|
+
* aid in tree-shaking and contribute to reducing the bundle size.
|
|
106
|
+
*
|
|
107
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#substitutewebplatformchecks}
|
|
108
|
+
*
|
|
109
|
+
* - Defaults to `false`.
|
|
110
|
+
*/
|
|
11
111
|
substituteWebPlatformChecks?: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* This option allows you to register modules as safe to use on Worklet
|
|
114
|
+
* Runtimes in the [Bundle
|
|
115
|
+
* Mode](https://docs.swmansion.com/react-native-worklets/docs/experimental/bundle-mode).
|
|
116
|
+
*
|
|
117
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/worklets-babel-plugin/plugin-options#workletizablemodules}
|
|
118
|
+
*
|
|
119
|
+
* - Defaults to an empty array `[]`.
|
|
120
|
+
*/
|
|
12
121
|
workletizableModules?: string[];
|
|
13
122
|
}
|