react-native-worklets 0.8.0 → 0.8.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/Common/cpp/worklets/SharedItems/Shareable.cpp +7 -5
- package/README.md +1 -1
- package/package.json +3 -2
- package/src/debug/jsVersion.ts +1 -1
- package/src/memory/serializable.native.ts +3 -4
- package/lib/module/WorkletsModule/NativeWorklets.js +0 -4
- package/lib/module/WorkletsModule/NativeWorklets.js.map +0 -1
- package/lib/module/WorkletsModule/NativeWorklets.native.js +0 -152
- package/lib/module/WorkletsModule/NativeWorklets.native.js.map +0 -1
- package/lib/module/WorkletsModule/workletsModuleProxy.js +0 -4
- package/lib/module/WorkletsModule/workletsModuleProxy.js.map +0 -1
- package/lib/module/bundleMode/metroOverrides.native.js +0 -115
- package/lib/module/bundleMode/metroOverrides.native.js.map +0 -1
- package/lib/module/bundleMode/network.native.js +0 -41
- package/lib/module/bundleMode/network.native.js.map +0 -1
- package/lib/module/callGuard.native.js +0 -30
- package/lib/module/callGuard.native.js.map +0 -1
- package/lib/module/debug/WorkletsError.js +0 -12
- package/lib/module/debug/WorkletsError.js.map +0 -1
- package/lib/module/debug/WorkletsError.native.js +0 -27
- package/lib/module/debug/WorkletsError.native.js.map +0 -1
- package/lib/module/debug/checkCppVersion.js +0 -30
- package/lib/module/debug/checkCppVersion.js.map +0 -1
- package/lib/module/debug/errors.native.js +0 -69
- package/lib/module/debug/errors.native.js.map +0 -1
- package/lib/module/debug/jsVersion.js +0 -9
- package/lib/module/debug/jsVersion.js.map +0 -1
- package/lib/module/debug/logger.js +0 -15
- package/lib/module/debug/logger.js.map +0 -1
- package/lib/module/debug/types.js +0 -2
- package/lib/module/debug/types.js.map +0 -1
- package/lib/module/deprecated.js +0 -27
- package/lib/module/deprecated.js.map +0 -1
- package/lib/module/featureFlags/featureFlags.js +0 -12
- package/lib/module/featureFlags/featureFlags.js.map +0 -1
- package/lib/module/featureFlags/featureFlags.native.js +0 -51
- package/lib/module/featureFlags/featureFlags.native.js.map +0 -1
- package/lib/module/featureFlags/staticFlags.json +0 -5
- package/lib/module/featureFlags/types.js +0 -13
- package/lib/module/featureFlags/types.js.map +0 -1
- package/lib/module/guardImplementation.native.js +0 -17
- package/lib/module/guardImplementation.native.js.map +0 -1
- package/lib/module/index.js +0 -28
- package/lib/module/index.js.map +0 -1
- package/lib/module/initializers/initializers.js +0 -24
- package/lib/module/initializers/initializers.js.map +0 -1
- package/lib/module/initializers/initializers.native.js +0 -174
- package/lib/module/initializers/initializers.native.js.map +0 -1
- package/lib/module/initializers/workletRuntimeEntry.js +0 -6
- package/lib/module/initializers/workletRuntimeEntry.js.map +0 -1
- package/lib/module/initializers/workletRuntimeEntry.native.js +0 -37
- package/lib/module/initializers/workletRuntimeEntry.native.js.map +0 -1
- package/lib/module/memory/bundleUnpacker.native.js +0 -47
- package/lib/module/memory/bundleUnpacker.native.js.map +0 -1
- package/lib/module/memory/customSerializableUnpacker.native.js +0 -18
- package/lib/module/memory/customSerializableUnpacker.native.js.map +0 -1
- package/lib/module/memory/isShareable.js +0 -8
- package/lib/module/memory/isShareable.js.map +0 -1
- package/lib/module/memory/isSynchronizable.js +0 -8
- package/lib/module/memory/isSynchronizable.js.map +0 -1
- package/lib/module/memory/serializable.js +0 -18
- package/lib/module/memory/serializable.js.map +0 -1
- package/lib/module/memory/serializable.native.js +0 -643
- package/lib/module/memory/serializable.native.js.map +0 -1
- package/lib/module/memory/serializableMappingCache.js +0 -11
- package/lib/module/memory/serializableMappingCache.js.map +0 -1
- package/lib/module/memory/serializableMappingCache.native.js +0 -29
- package/lib/module/memory/serializableMappingCache.native.js.map +0 -1
- package/lib/module/memory/shareable.js +0 -28
- package/lib/module/memory/shareable.js.map +0 -1
- package/lib/module/memory/shareable.native.js +0 -53
- package/lib/module/memory/shareable.native.js.map +0 -1
- package/lib/module/memory/shareableGuestUnpacker.native.js +0 -96
- package/lib/module/memory/shareableGuestUnpacker.native.js.map +0 -1
- package/lib/module/memory/shareableHostUnpacker.native.js +0 -18
- package/lib/module/memory/shareableHostUnpacker.native.js.map +0 -1
- package/lib/module/memory/synchronizable.js +0 -7
- package/lib/module/memory/synchronizable.js.map +0 -1
- package/lib/module/memory/synchronizable.native.js +0 -9
- package/lib/module/memory/synchronizable.native.js.map +0 -1
- package/lib/module/memory/synchronizableUnpacker.native.js +0 -42
- package/lib/module/memory/synchronizableUnpacker.native.js.map +0 -1
- package/lib/module/memory/types.js +0 -12
- package/lib/module/memory/types.js.map +0 -1
- package/lib/module/memory/valueUnpacker.native.js +0 -61
- package/lib/module/memory/valueUnpacker.native.js.map +0 -1
- package/lib/module/mock.js +0 -85
- package/lib/module/mock.js.map +0 -1
- package/lib/module/platformChecker.js +0 -8
- package/lib/module/platformChecker.js.map +0 -1
- package/lib/module/platformChecker.native.js +0 -4
- package/lib/module/platformChecker.native.js.map +0 -1
- package/lib/module/privateGlobals.d.js +0 -6
- package/lib/module/privateGlobals.d.js.map +0 -1
- package/lib/module/runLoop/common/setImmediatePolyfill.js +0 -15
- package/lib/module/runLoop/common/setImmediatePolyfill.js.map +0 -1
- package/lib/module/runLoop/common/setIntervalPolyfill.js +0 -26
- package/lib/module/runLoop/common/setIntervalPolyfill.js.map +0 -1
- package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js +0 -10
- package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js.map +0 -1
- package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js +0 -63
- package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js.map +0 -1
- package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js +0 -32
- package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js.map +0 -1
- package/lib/module/runLoop/workletRuntime/index.js +0 -19
- package/lib/module/runLoop/workletRuntime/index.js.map +0 -1
- package/lib/module/runLoop/workletRuntime/queueMicrotask.js +0 -11
- package/lib/module/runLoop/workletRuntime/queueMicrotask.js.map +0 -1
- package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js +0 -48
- package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js.map +0 -1
- package/lib/module/runLoop/workletRuntime/setTimeout.js +0 -28
- package/lib/module/runLoop/workletRuntime/setTimeout.js.map +0 -1
- package/lib/module/runLoop/workletRuntime/taskQueue.js +0 -37
- package/lib/module/runLoop/workletRuntime/taskQueue.js.map +0 -1
- package/lib/module/runtimeKind.js +0 -92
- package/lib/module/runtimeKind.js.map +0 -1
- package/lib/module/runtimes.js +0 -33
- package/lib/module/runtimes.js.map +0 -1
- package/lib/module/runtimes.native.js +0 -331
- package/lib/module/runtimes.native.js.map +0 -1
- package/lib/module/specs/NativeWorkletsModule.js +0 -5
- package/lib/module/specs/NativeWorkletsModule.js.map +0 -1
- package/lib/module/specs/index.js +0 -10
- package/lib/module/specs/index.js.map +0 -1
- package/lib/module/threads.js +0 -61
- package/lib/module/threads.js.map +0 -1
- package/lib/module/threads.native.js +0 -290
- package/lib/module/threads.native.js.map +0 -1
- package/lib/module/types.js +0 -5
- package/lib/module/types.js.map +0 -1
- package/lib/module/workletFunction.js +0 -36
- package/lib/module/workletFunction.js.map +0 -1
- package/lib/typescript/WorkletsModule/NativeWorklets.d.ts +0 -4
- package/lib/typescript/WorkletsModule/NativeWorklets.d.ts.map +0 -1
- package/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts +0 -3
- package/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts.map +0 -1
- package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts +0 -45
- package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map +0 -1
- package/lib/typescript/bundleMode/metroOverrides.native.d.ts +0 -28
- package/lib/typescript/bundleMode/metroOverrides.native.d.ts.map +0 -1
- package/lib/typescript/bundleMode/network.native.d.ts +0 -7
- package/lib/typescript/bundleMode/network.native.d.ts.map +0 -1
- package/lib/typescript/callGuard.native.d.ts +0 -4
- package/lib/typescript/callGuard.native.d.ts.map +0 -1
- package/lib/typescript/debug/WorkletsError.d.ts +0 -3
- package/lib/typescript/debug/WorkletsError.d.ts.map +0 -1
- package/lib/typescript/debug/WorkletsError.native.d.ts +0 -8
- package/lib/typescript/debug/WorkletsError.native.d.ts.map +0 -1
- package/lib/typescript/debug/checkCppVersion.d.ts +0 -3
- package/lib/typescript/debug/checkCppVersion.d.ts.map +0 -1
- package/lib/typescript/debug/errors.native.d.ts +0 -16
- package/lib/typescript/debug/errors.native.d.ts.map +0 -1
- package/lib/typescript/debug/jsVersion.d.ts +0 -7
- package/lib/typescript/debug/jsVersion.d.ts.map +0 -1
- package/lib/typescript/debug/logger.d.ts +0 -5
- package/lib/typescript/debug/logger.d.ts.map +0 -1
- package/lib/typescript/debug/types.d.ts +0 -9
- package/lib/typescript/debug/types.d.ts.map +0 -1
- package/lib/typescript/deprecated.d.ts +0 -19
- package/lib/typescript/deprecated.d.ts.map +0 -1
- package/lib/typescript/featureFlags/featureFlags.d.ts +0 -5
- package/lib/typescript/featureFlags/featureFlags.d.ts.map +0 -1
- package/lib/typescript/featureFlags/featureFlags.native.d.ts +0 -6
- package/lib/typescript/featureFlags/featureFlags.native.d.ts.map +0 -1
- package/lib/typescript/featureFlags/types.d.ts +0 -21
- package/lib/typescript/featureFlags/types.d.ts.map +0 -1
- package/lib/typescript/guardImplementation.native.d.ts +0 -2
- package/lib/typescript/guardImplementation.native.d.ts.map +0 -1
- package/lib/typescript/index.d.ts +0 -17
- package/lib/typescript/index.d.ts.map +0 -1
- package/lib/typescript/initializers/initializers.d.ts +0 -2
- package/lib/typescript/initializers/initializers.d.ts.map +0 -1
- package/lib/typescript/initializers/initializers.native.d.ts +0 -18
- package/lib/typescript/initializers/initializers.native.d.ts.map +0 -1
- package/lib/typescript/initializers/workletRuntimeEntry.d.ts +0 -2
- package/lib/typescript/initializers/workletRuntimeEntry.d.ts.map +0 -1
- package/lib/typescript/initializers/workletRuntimeEntry.native.d.ts +0 -14
- package/lib/typescript/initializers/workletRuntimeEntry.native.d.ts.map +0 -1
- package/lib/typescript/memory/bundleUnpacker.native.d.ts +0 -7
- package/lib/typescript/memory/bundleUnpacker.native.d.ts.map +0 -1
- package/lib/typescript/memory/customSerializableUnpacker.native.d.ts +0 -3
- package/lib/typescript/memory/customSerializableUnpacker.native.d.ts.map +0 -1
- package/lib/typescript/memory/isShareable.d.ts +0 -3
- package/lib/typescript/memory/isShareable.d.ts.map +0 -1
- package/lib/typescript/memory/isSynchronizable.d.ts +0 -3
- package/lib/typescript/memory/isSynchronizable.d.ts.map +0 -1
- package/lib/typescript/memory/serializable.d.ts +0 -7
- package/lib/typescript/memory/serializable.d.ts.map +0 -1
- package/lib/typescript/memory/serializable.native.d.ts +0 -37
- package/lib/typescript/memory/serializable.native.d.ts.map +0 -1
- package/lib/typescript/memory/serializableMappingCache.d.ts +0 -6
- package/lib/typescript/memory/serializableMappingCache.d.ts.map +0 -1
- package/lib/typescript/memory/serializableMappingCache.native.d.ts +0 -13
- package/lib/typescript/memory/serializableMappingCache.native.d.ts.map +0 -1
- package/lib/typescript/memory/shareable.d.ts +0 -23
- package/lib/typescript/memory/shareable.d.ts.map +0 -1
- package/lib/typescript/memory/shareable.native.d.ts +0 -23
- package/lib/typescript/memory/shareable.native.d.ts.map +0 -1
- package/lib/typescript/memory/shareableGuestUnpacker.native.d.ts +0 -4
- package/lib/typescript/memory/shareableGuestUnpacker.native.d.ts.map +0 -1
- package/lib/typescript/memory/shareableHostUnpacker.native.d.ts +0 -4
- package/lib/typescript/memory/shareableHostUnpacker.native.d.ts.map +0 -1
- package/lib/typescript/memory/synchronizable.d.ts +0 -3
- package/lib/typescript/memory/synchronizable.d.ts.map +0 -1
- package/lib/typescript/memory/synchronizable.native.d.ts +0 -3
- package/lib/typescript/memory/synchronizable.native.d.ts.map +0 -1
- package/lib/typescript/memory/synchronizableUnpacker.native.d.ts +0 -4
- package/lib/typescript/memory/synchronizableUnpacker.native.d.ts.map +0 -1
- package/lib/typescript/memory/types.d.ts +0 -132
- package/lib/typescript/memory/types.d.ts.map +0 -1
- package/lib/typescript/memory/valueUnpacker.native.d.ts +0 -6
- package/lib/typescript/memory/valueUnpacker.native.d.ts.map +0 -1
- package/lib/typescript/mock.d.ts +0 -2
- package/lib/typescript/mock.d.ts.map +0 -1
- package/lib/typescript/platformChecker.d.ts +0 -5
- package/lib/typescript/platformChecker.d.ts.map +0 -1
- package/lib/typescript/platformChecker.native.d.ts +0 -2
- package/lib/typescript/platformChecker.native.d.ts.map +0 -1
- package/lib/typescript/runLoop/common/setImmediatePolyfill.d.ts +0 -2
- package/lib/typescript/runLoop/common/setImmediatePolyfill.d.ts.map +0 -1
- package/lib/typescript/runLoop/common/setIntervalPolyfill.d.ts +0 -2
- package/lib/typescript/runLoop/common/setIntervalPolyfill.d.ts.map +0 -1
- package/lib/typescript/runLoop/uiRuntime/mockedRequestAnimationFrame.d.ts +0 -6
- package/lib/typescript/runLoop/uiRuntime/mockedRequestAnimationFrame.d.ts.map +0 -1
- package/lib/typescript/runLoop/uiRuntime/requestAnimationFrame.d.ts +0 -2
- package/lib/typescript/runLoop/uiRuntime/requestAnimationFrame.d.ts.map +0 -1
- package/lib/typescript/runLoop/uiRuntime/setTimeoutPolyfill.d.ts +0 -2
- package/lib/typescript/runLoop/uiRuntime/setTimeoutPolyfill.d.ts.map +0 -1
- package/lib/typescript/runLoop/workletRuntime/index.d.ts +0 -2
- package/lib/typescript/runLoop/workletRuntime/index.d.ts.map +0 -1
- package/lib/typescript/runLoop/workletRuntime/queueMicrotask.d.ts +0 -2
- package/lib/typescript/runLoop/workletRuntime/queueMicrotask.d.ts.map +0 -1
- package/lib/typescript/runLoop/workletRuntime/requestAnimationFramePolyfill.d.ts +0 -2
- package/lib/typescript/runLoop/workletRuntime/requestAnimationFramePolyfill.d.ts.map +0 -1
- package/lib/typescript/runLoop/workletRuntime/setTimeout.d.ts +0 -2
- package/lib/typescript/runLoop/workletRuntime/setTimeout.d.ts.map +0 -1
- package/lib/typescript/runLoop/workletRuntime/taskQueue.d.ts +0 -10
- package/lib/typescript/runLoop/workletRuntime/taskQueue.d.ts.map +0 -1
- package/lib/typescript/runtimeKind.d.ts +0 -56
- package/lib/typescript/runtimeKind.d.ts.map +0 -1
- package/lib/typescript/runtimes.d.ts +0 -14
- package/lib/typescript/runtimes.d.ts.map +0 -1
- package/lib/typescript/runtimes.native.d.ts +0 -137
- package/lib/typescript/runtimes.native.d.ts.map +0 -1
- package/lib/typescript/specs/NativeWorkletsModule.d.ts +0 -7
- package/lib/typescript/specs/NativeWorkletsModule.d.ts.map +0 -1
- package/lib/typescript/specs/index.d.ts +0 -3
- package/lib/typescript/specs/index.d.ts.map +0 -1
- package/lib/typescript/threads.d.ts +0 -8
- package/lib/typescript/threads.d.ts.map +0 -1
- package/lib/typescript/threads.native.d.ts +0 -132
- package/lib/typescript/threads.native.d.ts.map +0 -1
- package/lib/typescript/types.d.ts +0 -127
- package/lib/typescript/types.d.ts.map +0 -1
- package/lib/typescript/workletFunction.d.ts +0 -26
- package/lib/typescript/workletFunction.d.ts.map +0 -1
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
import { WorkletsError } from './debug/WorkletsError';
|
|
4
|
-
import { addGuardImplementation } from './guardImplementation';
|
|
5
|
-
import { createSerializable, makeShareableCloneOnUIRecursive } from './memory/serializable';
|
|
6
|
-
import { RuntimeKind } from './runtimeKind';
|
|
7
|
-
import { isWorkletFunction } from './workletFunction';
|
|
8
|
-
import { WorkletsModule } from './WorkletsModule/NativeWorklets';
|
|
9
|
-
let runOnUIQueue = [];
|
|
10
|
-
export function setupMicrotasks() {
|
|
11
|
-
'worklet';
|
|
12
|
-
|
|
13
|
-
let microtasksQueue = [];
|
|
14
|
-
let isExecutingMicrotasksQueue = false;
|
|
15
|
-
globalThis.queueMicrotask = callback => {
|
|
16
|
-
microtasksQueue.push(callback);
|
|
17
|
-
};
|
|
18
|
-
globalThis._microtaskQueueFinalizers = [];
|
|
19
|
-
globalThis.__callMicrotasks = () => {
|
|
20
|
-
if (isExecutingMicrotasksQueue) {
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
try {
|
|
24
|
-
isExecutingMicrotasksQueue = true;
|
|
25
|
-
for (let index = 0; index < microtasksQueue.length; index += 1) {
|
|
26
|
-
// we use classic 'for' loop because the size of the currentTasks array may change while executing some of the callbacks due to queueMicrotask calls
|
|
27
|
-
microtasksQueue[index]();
|
|
28
|
-
}
|
|
29
|
-
microtasksQueue = [];
|
|
30
|
-
globalThis._microtaskQueueFinalizers.forEach(finalizer => finalizer());
|
|
31
|
-
} finally {
|
|
32
|
-
isExecutingMicrotasksQueue = false;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Lets you schedule a function to be executed on the [UI
|
|
39
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
40
|
-
*
|
|
41
|
-
* - The callback executes asynchronously and doesn't return a value.
|
|
42
|
-
* - Passed function and args are automatically
|
|
43
|
-
* [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
44
|
-
* and serialized.
|
|
45
|
-
* - This function cannot be called from the [UI
|
|
46
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime)
|
|
47
|
-
* or a [Worker
|
|
48
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime),
|
|
49
|
-
* unless you have the [Bundle Mode](/docs/bundleMode/) enabled.
|
|
50
|
-
*
|
|
51
|
-
* @param fun - A reference to a function you want to schedule on the [UI
|
|
52
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
53
|
-
* @param args - Arguments to pass to the function.
|
|
54
|
-
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnUI
|
|
55
|
-
*/
|
|
56
|
-
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
57
|
-
// before it's transformed by Worklets Babel plugin.
|
|
58
|
-
|
|
59
|
-
export function scheduleOnUI(worklet, ...args) {
|
|
60
|
-
if (__DEV__ && !isWorkletFunction(worklet) && !worklet.__bundleData) {
|
|
61
|
-
throw new WorkletsError('`scheduleOnUI` can only be used with worklets.');
|
|
62
|
-
}
|
|
63
|
-
if (__DEV__) {
|
|
64
|
-
// in DEV mode we call serializable conversion here because in case the object
|
|
65
|
-
// can't be converted, we will get a meaningful stack-trace as opposed to the
|
|
66
|
-
// situation when conversion is only done via microtask queue. This does not
|
|
67
|
-
// make the app particularily less efficient as converted objects are cached
|
|
68
|
-
// and for a given worklet the conversion only happens once.
|
|
69
|
-
createSerializable(worklet);
|
|
70
|
-
createSerializable(args);
|
|
71
|
-
}
|
|
72
|
-
enqueueUI(worklet, args);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Lets you asynchronously run
|
|
77
|
-
* [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
78
|
-
* functions on the [UI
|
|
79
|
-
* thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/).
|
|
80
|
-
*
|
|
81
|
-
* This method does not schedule the work immediately but instead waits for
|
|
82
|
-
* other worklets to be scheduled within the same JS loop. It uses
|
|
83
|
-
* queueMicrotask to schedule all the worklets at once making sure they will run
|
|
84
|
-
* within the same frame boundaries on the UI thread.
|
|
85
|
-
*
|
|
86
|
-
* @param fun - A reference to a function you want to execute on the [UI
|
|
87
|
-
* thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/)
|
|
88
|
-
* from the [JavaScript
|
|
89
|
-
* thread](https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI/).
|
|
90
|
-
* @returns A function that accepts arguments for the function passed as the
|
|
91
|
-
* first argument.
|
|
92
|
-
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUI @deprecated Use `scheduleOnUI` instead.
|
|
93
|
-
*/
|
|
94
|
-
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
95
|
-
// before it's transformed by Worklets Babel plugin.
|
|
96
|
-
|
|
97
|
-
export function runOnUI(worklet) {
|
|
98
|
-
if (__DEV__ && !isWorkletFunction(worklet) && !worklet.__bundleData) {
|
|
99
|
-
throw new WorkletsError('`runOnUI` can only be used with worklets.');
|
|
100
|
-
}
|
|
101
|
-
return (...args) => {
|
|
102
|
-
scheduleOnUI(worklet, ...args);
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Lets you run a function synchronously on the [UI
|
|
108
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime)
|
|
109
|
-
* from the [RN
|
|
110
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#rn-runtime).
|
|
111
|
-
* Passed function and args are automatically
|
|
112
|
-
* [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
113
|
-
* and serialized.
|
|
114
|
-
*
|
|
115
|
-
* - This function cannot be called from the [UI
|
|
116
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
117
|
-
* - This function cannot be called from a [Worker
|
|
118
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime).
|
|
119
|
-
*
|
|
120
|
-
* @param fun - A reference to a function you want to execute on the [UI
|
|
121
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
122
|
-
* @param args - Arguments to pass to the function.
|
|
123
|
-
* @returns The return value of the function passed as the first argument.
|
|
124
|
-
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUISync
|
|
125
|
-
*/
|
|
126
|
-
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
127
|
-
// before it's transformed by Worklets Babel plugin.
|
|
128
|
-
|
|
129
|
-
export function runOnUISync(worklet, ...args) {
|
|
130
|
-
return WorkletsModule.runOnUISync(createSerializable(() => {
|
|
131
|
-
'worklet';
|
|
132
|
-
|
|
133
|
-
const result = worklet(...args);
|
|
134
|
-
return makeShareableCloneOnUIRecursive(result);
|
|
135
|
-
}));
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
139
|
-
// before it's transformed by Worklets Babel plugin.
|
|
140
|
-
|
|
141
|
-
export function executeOnUIRuntimeSync(worklet) {
|
|
142
|
-
return (...args) => {
|
|
143
|
-
return runOnUISync(worklet, ...args);
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function runWorkletOnJS(worklet, ...args) {
|
|
147
|
-
// remote function that calls a worklet synchronously on the JS runtime
|
|
148
|
-
worklet(...args);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Lets you schedule a function to be executed on the RN runtime from any
|
|
153
|
-
* runtime. Check
|
|
154
|
-
* {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds}
|
|
155
|
-
* for more information about the different runtime kinds.
|
|
156
|
-
*
|
|
157
|
-
* Scheduling function from the RN Runtime (we are already on RN Runtime) simply
|
|
158
|
-
* uses `queueMicrotask`.
|
|
159
|
-
*
|
|
160
|
-
* When functions need to be scheduled from the UI Runtime, first function and
|
|
161
|
-
* args are serialized and then the system passes the scheduling responsibility
|
|
162
|
-
* to the JSScheduler. The JSScheduler then uses the RN CallInvoker to schedule
|
|
163
|
-
* the function asynchronously on the JavaScript thread by calling
|
|
164
|
-
* `jsCallInvoker_->invokeAsync()`.
|
|
165
|
-
*
|
|
166
|
-
* When called from a Worker Runtime, it uses the same JSScheduler mechanism.
|
|
167
|
-
*
|
|
168
|
-
* @param fun - A function you want to schedule on the RN runtime. A function
|
|
169
|
-
* can be a worklet, a remote function or a regular function.
|
|
170
|
-
* @param args - Arguments to pass to the function.
|
|
171
|
-
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/scheduleOnRN
|
|
172
|
-
*/
|
|
173
|
-
export function scheduleOnRN(fun, ...args) {
|
|
174
|
-
'worklet';
|
|
175
|
-
|
|
176
|
-
if (globalThis.__RUNTIME_KIND === RuntimeKind.ReactNative) {
|
|
177
|
-
// if we are already on the JS thread, we just schedule the worklet on the JS queue
|
|
178
|
-
queueMicrotask(args.length ? () => fun(...args) : fun);
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (isWorkletFunction(fun)) {
|
|
182
|
-
// If `fun` is a worklet, we schedule a call of a remote function `runWorkletOnJS`
|
|
183
|
-
// and pass the worklet as a first argument followed by original arguments.
|
|
184
|
-
scheduleOnRN(runWorkletOnJS, fun, ...args);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (fun.__remoteFunction) {
|
|
188
|
-
// In development mode the function provided as `fun` throws an error message
|
|
189
|
-
// such that when someone accidentally calls it directly on the UI runtime, they
|
|
190
|
-
// see that they should use `runOnJS` instead. To facilitate that we put the
|
|
191
|
-
// reference to the original remote function in the `__remoteFunction` property.
|
|
192
|
-
fun = fun.__remoteFunction;
|
|
193
|
-
}
|
|
194
|
-
const scheduleOnRNImpl = typeof fun === 'function' ? globalThis._scheduleHostFunctionOnJS : globalThis._scheduleRemoteFunctionOnJS;
|
|
195
|
-
scheduleOnRNImpl(fun, args.length > 0 ? makeShareableCloneOnUIRecursive(args) : undefined);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
/**
|
|
199
|
-
* Lets you asynchronously run
|
|
200
|
-
* non-[workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
201
|
-
* functions that couldn't otherwise run on the [UI
|
|
202
|
-
* thread](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-thread).
|
|
203
|
-
* This applies to most external libraries as they don't have their functions
|
|
204
|
-
* marked with "worklet"; directive.
|
|
205
|
-
*
|
|
206
|
-
* @param fun - A reference to a function you want to execute on the JavaScript
|
|
207
|
-
* thread from the UI thread.
|
|
208
|
-
* @returns A function that accepts arguments for the function passed as the
|
|
209
|
-
* first argument.
|
|
210
|
-
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnJS
|
|
211
|
-
*/
|
|
212
|
-
/** @deprecated Use `scheduleOnRN` instead. */
|
|
213
|
-
export function runOnJS(fun) {
|
|
214
|
-
'worklet';
|
|
215
|
-
|
|
216
|
-
return (...args) => {
|
|
217
|
-
scheduleOnRN(fun, ...args);
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Lets you asynchronously run
|
|
223
|
-
* [workletized](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#to-workletize)
|
|
224
|
-
* functions on the [UI
|
|
225
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
226
|
-
*
|
|
227
|
-
* This method does not schedule the work immediately but instead waits for
|
|
228
|
-
* other worklets to be scheduled within the same JS loop. It uses
|
|
229
|
-
* queueMicrotask to schedule all the worklets at once making sure they will run
|
|
230
|
-
* within the same frame boundaries on the UI thread.
|
|
231
|
-
*
|
|
232
|
-
* @param fun - A reference to a function you want to execute on the [UI
|
|
233
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
234
|
-
* from the [JavaScript
|
|
235
|
-
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#javascript-runtime).
|
|
236
|
-
* @returns A promise that resolves to the return value of the function passed
|
|
237
|
-
* as the first argument.
|
|
238
|
-
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnUIAsync
|
|
239
|
-
*/
|
|
240
|
-
export function runOnUIAsync(worklet, ...args) {
|
|
241
|
-
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
242
|
-
throw new WorkletsError('`runOnUIAsync` can only be used with worklets.');
|
|
243
|
-
}
|
|
244
|
-
return new Promise(resolve => {
|
|
245
|
-
if (__DEV__) {
|
|
246
|
-
// in DEV mode we call serializable conversion here because in case the object
|
|
247
|
-
// can't be converted, we will get a meaningful stack-trace as opposed to the
|
|
248
|
-
// situation when conversion is only done via microtask queue. This does not
|
|
249
|
-
// make the app particularily less efficient as converted objects are cached
|
|
250
|
-
// and for a given worklet the conversion only happens once.
|
|
251
|
-
createSerializable(worklet);
|
|
252
|
-
createSerializable(args);
|
|
253
|
-
}
|
|
254
|
-
enqueueUI(worklet, args, resolve);
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
function enqueueUI(worklet, args, resolve) {
|
|
258
|
-
const job = [worklet, args, resolve];
|
|
259
|
-
runOnUIQueue.push(job);
|
|
260
|
-
if (runOnUIQueue.length === 1) {
|
|
261
|
-
flushUIQueue();
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
function flushUIQueue() {
|
|
265
|
-
queueMicrotask(() => {
|
|
266
|
-
const queue = runOnUIQueue;
|
|
267
|
-
runOnUIQueue = [];
|
|
268
|
-
WorkletsModule.scheduleOnUI(createSerializable(() => {
|
|
269
|
-
'worklet';
|
|
270
|
-
|
|
271
|
-
queue.forEach(([workletFunction, workletArgs, jobResolve]) => {
|
|
272
|
-
const result = workletFunction(...workletArgs);
|
|
273
|
-
if (jobResolve) {
|
|
274
|
-
scheduleOnRN(jobResolve, result);
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
globalThis.__callMicrotasks();
|
|
278
|
-
}));
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
if (__DEV__ && !globalThis._WORKLETS_BUNDLE_MODE_ENABLED) {
|
|
282
|
-
/**
|
|
283
|
-
* QoL guards to give a meaningful error message when the user tries to call
|
|
284
|
-
* these functions on Worklet Runtimes outside of the Bundle Mode.
|
|
285
|
-
*/
|
|
286
|
-
addGuardImplementation(runOnUIAsync);
|
|
287
|
-
addGuardImplementation(runOnUISync);
|
|
288
|
-
addGuardImplementation(scheduleOnUI);
|
|
289
|
-
}
|
|
290
|
-
//# sourceMappingURL=threads.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["WorkletsError","addGuardImplementation","createSerializable","makeShareableCloneOnUIRecursive","RuntimeKind","isWorkletFunction","WorkletsModule","runOnUIQueue","setupMicrotasks","microtasksQueue","isExecutingMicrotasksQueue","globalThis","queueMicrotask","callback","push","_microtaskQueueFinalizers","__callMicrotasks","index","length","forEach","finalizer","scheduleOnUI","worklet","args","__DEV__","__bundleData","enqueueUI","runOnUI","runOnUISync","result","executeOnUIRuntimeSync","runWorkletOnJS","scheduleOnRN","fun","__RUNTIME_KIND","ReactNative","__remoteFunction","scheduleOnRNImpl","_scheduleHostFunctionOnJS","_scheduleRemoteFunctionOnJS","undefined","runOnJS","runOnUIAsync","Promise","resolve","job","flushUIQueue","queue","workletFunction","workletArgs","jobResolve","_WORKLETS_BUNDLE_MODE_ENABLED"],"sourceRoot":"../../src","sources":["threads.native.ts"],"mappings":"AAAA,YAAY;;AAEZ,SAASA,aAAa,QAAQ,uBAAuB;AACrD,SAASC,sBAAsB,QAAQ,uBAAuB;AAC9D,SACEC,kBAAkB,EAClBC,+BAA+B,QAC1B,uBAAuB;AAC9B,SAASC,WAAW,QAAQ,eAAe;AAE3C,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SAASC,cAAc,QAAQ,iCAAiC;AAQhE,IAAIC,YAAqB,GAAG,EAAE;AAE9B,OAAO,SAASC,eAAeA,CAAA,EAAG;EAChC,SAAS;;EAET,IAAIC,eAAkC,GAAG,EAAE;EAC3C,IAAIC,0BAA0B,GAAG,KAAK;EACtCC,UAAU,CAACC,cAAc,GAAIC,QAAoB,IAAK;IACpDJ,eAAe,CAACK,IAAI,CAACD,QAAQ,CAAC;EAChC,CAAC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;AACJ;AAEA,SAASlB,SAASA,CAChBJ,OAA2C,EAC3CC,IAAU,EACVqB,OAAsC,EAChC;EACN,MAAMC,GAAG,GAAG,CAACvB,OAAO,EAAEC,IAAI,EAAEqB,OAAO,CAA6B;EAChErC,YAAY,CAACO,IAAI,CAAC+B,GAAuB,CAAC;EAC1C,IAAItC,YAAY,CAACW,MAAM,KAAK,CAAC,EAAE;IAC7B4B,YAAY,CAAC,CAAC;EAChB;AACF;AAEA,SAASA,YAAYA,CAAA,EAAS;EAC5BlC,cAAc,CAAC,MAAM;IACnB,MAAMmC,KAAK,GAAGxC,YAAY;IAC1BA,YAAY,GAAG,EAAE;IACjBD,cAAc,CAACe,YAAY,CACzBnB,kBAAkB,CAAC,MAAM;MACvB,SAAS;;MACT6C,KAAK,CAAC5B,OAAO,CAAC,CAAC,CAAC6B,eAAe,EAAEC,WAAW,EAAEC,UAAU,CAAC,KAAK;QAC5D,MAAMrB,MAAM,GAAGmB,eAAe,CAAC,GAAGC,WAAW,CAAC;QAC9C,IAAIC,UAAU,EAAE;UACdlB,YAAY,CAACkB,UAAU,EAAErB,MAAM,CAAC;QAClC;MACF,CAAC,CAAC;MACFlB,UAAU,CAACK,gBAAgB,CAAC,CAAC;IAC/B,CAAC,CACH,CAAC;EACH,CAAC,CAAC;AACJ;AAEA,IAAIQ,OAAO,IAAI,CAACb,UAAU,CAACwC,6BAA6B,EAAE;EACxD;AACF;AACA;AACA;EACElD,sBAAsB,CAACyC,YAAY,CAAC;EACpCzC,sBAAsB,CAAC2B,WAAW,CAAC;EACnC3B,sBAAsB,CAACoB,YAAY,CAAC;AACtC","ignoreList":[]}
|
package/lib/module/types.js
DELETED
package/lib/module/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["types.ts"],"mappings":"AAAA;AACA,YAAY;;AAAC","ignoreList":[]}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This function allows you to determine if a given function is a worklet. It
|
|
5
|
-
* only works with Worklets Babel plugin enabled. Unless you are doing something
|
|
6
|
-
* with internals of Worklets you shouldn't need to use this function.
|
|
7
|
-
*
|
|
8
|
-
* ### Note
|
|
9
|
-
*
|
|
10
|
-
* Do not call it before the worklet is declared, as it will always return false
|
|
11
|
-
* then. E.g.:
|
|
12
|
-
*
|
|
13
|
-
* ```ts
|
|
14
|
-
* isWorkletFunction(myWorklet); // Will always return false.
|
|
15
|
-
*
|
|
16
|
-
* function myWorklet() {
|
|
17
|
-
* 'worklet';
|
|
18
|
-
* }
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* ### Maintainer note
|
|
22
|
-
*
|
|
23
|
-
* This function is supposed to be used only in the React Runtime. It always
|
|
24
|
-
* returns `false` in Worklet Runtimes.
|
|
25
|
-
*/
|
|
26
|
-
export function isWorkletFunction(value) {
|
|
27
|
-
'worklet';
|
|
28
|
-
|
|
29
|
-
// Since host objects always return true for `in` operator, we have to use dot notation to check if the property exists.
|
|
30
|
-
// See https://github.com/facebook/hermes/blob/340726ef8cf666a7cce75bc60b02fa56b3e54560/lib/VM/JSObject.cpp#L1276.
|
|
31
|
-
return (
|
|
32
|
-
// `__workletHash` isn't extracted in Worklet Runtimes.
|
|
33
|
-
typeof value === 'function' && !!value.__workletHash
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=workletFunction.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isWorkletFunction","value","__workletHash"],"sourceRoot":"../../src","sources":["workletFunction.ts"],"mappings":"AAAA,YAAY;;AAIZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASA,iBAAiBA,CAG/BC,KAAc,EAA+C;EAC7D,SAAS;;EACT;EACA;EAEA;IACE;IACA,OAAOA,KAAK,KAAK,UAAU,IAC3B,CAAC,CAAEA,KAAK,CAAwCC;EAAa;AAEjE","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeWorklets.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/NativeWorklets.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,YAAY,EACV,eAAe,EACf,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,cAAc,EAAE,eAAuB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NativeWorklets.native.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/NativeWorklets.native.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EACV,eAAe,EAEhB,MAAM,uBAAuB,CAAC;AA0T/B,eAAO,MAAM,cAAc,EAAE,eAAsC,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { SerializableRef, SynchronizableRef } from '../memory/types';
|
|
2
|
-
import type { WorkletRuntime } from '../types';
|
|
3
|
-
/** Type of `__workletsModuleProxy` injected with JSI. */
|
|
4
|
-
export interface WorkletsModuleProxy {
|
|
5
|
-
createSerializable<TValue>(value: TValue, shouldPersistRemote: boolean, nativeStateSource?: object): SerializableRef<TValue>;
|
|
6
|
-
createSerializableImport<TValue>(source: string, imported: string): SerializableRef<TValue>;
|
|
7
|
-
createSerializableString(str: string): SerializableRef<string>;
|
|
8
|
-
createSerializableNumber(num: number): SerializableRef<number>;
|
|
9
|
-
createSerializableBoolean(bool: boolean): SerializableRef<boolean>;
|
|
10
|
-
createSerializableBigInt(bigInt: bigint): SerializableRef<bigint>;
|
|
11
|
-
createSerializableUndefined(): SerializableRef<undefined>;
|
|
12
|
-
createSerializableNull(): SerializableRef<null>;
|
|
13
|
-
createSerializableTurboModuleLike<TProps extends object, TProto extends object>(props: TProps, proto: TProto): SerializableRef<TProps>;
|
|
14
|
-
createSerializableObject<T extends object>(obj: T, shouldRetainRemote: boolean, nativeStateSource?: object): SerializableRef<T>;
|
|
15
|
-
createSerializableHostObject<T extends object>(obj: T): SerializableRef<T>;
|
|
16
|
-
createSerializableArray(array: unknown[], shouldRetainRemote: boolean): SerializableRef<unknown[]>;
|
|
17
|
-
createSerializableMap<TKey, TValue>(keys: TKey[], values: TValue[]): SerializableRef<Map<TKey, TValue>>;
|
|
18
|
-
createSerializableSet<TValues>(values: TValues[]): SerializableRef<Set<TValues>>;
|
|
19
|
-
createSerializableInitializer(obj: object): SerializableRef<object>;
|
|
20
|
-
createSerializableFunction<TArgs extends unknown[], TReturn>(func: (...args: TArgs) => TReturn): SerializableRef<TReturn>;
|
|
21
|
-
createSerializableWorklet(worklet: object, shouldPersistRemote: boolean): SerializableRef<object>;
|
|
22
|
-
createCustomSerializable(data: SerializableRef<unknown>, typeId: number): SerializableRef<unknown>;
|
|
23
|
-
registerCustomSerializable(determine: SerializableRef<object>, pack: SerializableRef<object>, unpack: SerializableRef<object>, typeId: number): void;
|
|
24
|
-
createShareable<TValue = unknown>(hostRuntimeId: number, initial: SerializableRef<TValue>, initSynchronously: boolean, decorateHost: SerializableRef, decorateGuest: SerializableRef): SerializableRef<TValue>;
|
|
25
|
-
scheduleOnUI<TValue>(serializable: SerializableRef<TValue>): void;
|
|
26
|
-
runOnUISync<TValue, TReturn>(serializable: SerializableRef<TValue>): TReturn;
|
|
27
|
-
createWorkletRuntime(name: string, initializer: SerializableRef<() => void>, useDefaultQueue: boolean, customQueue: object | undefined, enableEventLoop: boolean): WorkletRuntime;
|
|
28
|
-
scheduleOnRuntime<TValue>(workletRuntime: WorkletRuntime, worklet: SerializableRef<TValue>): void;
|
|
29
|
-
scheduleOnRuntimeWithId<TValue>(runtimeId: number, worklet: SerializableRef<TValue>): void;
|
|
30
|
-
runOnRuntimeSync<TValue, TReturn>(workletRuntime: WorkletRuntime, worklet: SerializableRef<TValue>): TReturn;
|
|
31
|
-
runOnRuntimeSyncWithId<TValue, TReturn>(runtimeId: number, worklet: SerializableRef<TValue>): TReturn;
|
|
32
|
-
reportFatalErrorOnJS(message: string, stack: string, name: string, jsEngine: string): void;
|
|
33
|
-
createSynchronizable<TValue>(value: TValue): SynchronizableRef<TValue>;
|
|
34
|
-
synchronizableGetDirty<TValue>(synchronizableRef: SynchronizableRef<TValue>): TValue;
|
|
35
|
-
synchronizableGetBlocking<TValue>(synchronizableRef: SynchronizableRef<TValue>): TValue;
|
|
36
|
-
synchronizableSetBlocking<TValue>(synchronizableRef: SynchronizableRef<TValue>, value: SerializableRef<TValue>): void;
|
|
37
|
-
synchronizableLock<TValue>(synchronizableRef: SynchronizableRef<TValue>): void;
|
|
38
|
-
synchronizableUnlock<TValue>(synchronizableRef: SynchronizableRef<TValue>): void;
|
|
39
|
-
getStaticFeatureFlag(name: string): boolean;
|
|
40
|
-
setDynamicFeatureFlag(name: string, value: boolean): void;
|
|
41
|
-
getUIRuntimeHolder(): object;
|
|
42
|
-
getUISchedulerHolder(): object;
|
|
43
|
-
}
|
|
44
|
-
export type IWorkletsModule = WorkletsModuleProxy;
|
|
45
|
-
//# sourceMappingURL=workletsModuleProxy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"workletsModuleProxy.d.ts","sourceRoot":"","sources":["../../../src/WorkletsModule/workletsModuleProxy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,yDAAyD;AACzD,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,CAAC,MAAM,EACvB,KAAK,EAAE,MAAM,EACb,mBAAmB,EAAE,OAAO,EAC5B,iBAAiB,CAAC,EAAE,MAAM,GACzB,eAAe,CAAC,MAAM,CAAC,CAAC;IAE3B,wBAAw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AAM,CAAC,GAC3C,IAAI,CAAC;IAER,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAE5C,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAE1D,kBAAkB,IAAI,MAAM,CAAC;IAE7B,oBAAoB,IAAI,MAAM,CAAC;CAChC;AAED,MAAM,MAAM,eAAe,GAAG,mBAAmB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"network.native.d.ts","sourceRoot":"","sources":["../../../src/bundleMode/network.native.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,oBAAoB,SAuBnC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** Used only with debug builds. */
|
|
2
|
-
export declare function callGuardDEV<Args extends unknown[], ReturnValue>(fn: (...args: Args) => ReturnValue, ...args: Args): ReturnValue | void;
|
|
3
|
-
export declare function setupCallGuard(): void;
|
|
4
|
-
//# sourceMappingURL=callGuard.native.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"callGuard.native.d.ts","sourceRoot":"","sources":["../../src/callGuard.native.ts"],"names":[],"mappings":"AAIA,mCAAmC;AACnC,wBAAgB,YAAY,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,WAAW,EAC9D,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,WAAW,EAClC,GAAG,IAAI,EAAE,IAAI,GACZ,WAAW,GAAG,IAAI,CAiBpB;AAED,wBAAgB,cAAc,SAK7B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkletsError.d.ts","sourceRoot":"","sources":["../../../src/debug/WorkletsError.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAWjB,eAAO,MAAM,aAAa,EACI,yBAAyB,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { IWorkletsErrorConstructor } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Registers WorkletsError in the global scope. Register only for Worklet
|
|
4
|
-
* runtimes.
|
|
5
|
-
*/
|
|
6
|
-
export declare function registerWorkletsError(): void;
|
|
7
|
-
export declare const WorkletsError: IWorkletsErrorConstructor;
|
|
8
|
-
//# sourceMappingURL=WorkletsError.native.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WorkletsError.native.d.ts","sourceRoot":"","sources":["../../../src/debug/WorkletsError.native.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EAE1B,MAAM,SAAS,CAAC;AAYjB;;;GAGG;AACH,wBAAgB,qBAAqB,SAMpC;AAED,eAAO,MAAM,aAAa,EACI,yBAAyB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkCppVersion.d.ts","sourceRoot":"","sources":["../../../src/debug/checkCppVersion.ts"],"names":[],"mappings":"AAMA,wBAAgB,eAAe,SAgB9B;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,WAU9D"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { WorkletStackDetails } from '../types';
|
|
2
|
-
export declare function registerWorkletStackDetails(hash: number, stackDetails: WorkletStackDetails): void;
|
|
3
|
-
export interface RNError extends Error {
|
|
4
|
-
jsEngine: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Remote error is an error coming from a Worklet Runtime that we bubble up to
|
|
8
|
-
* the RN Runtime.
|
|
9
|
-
*/
|
|
10
|
-
export declare function reportFatalRemoteError({ message, stack, name, jsEngine }: RNError, force: boolean): void;
|
|
11
|
-
/**
|
|
12
|
-
* Registers `reportFatalRemoteError` function in global scope to allow to
|
|
13
|
-
* invoke it from C++.
|
|
14
|
-
*/
|
|
15
|
-
export declare function registerReportFatalRemoteError(): void;
|
|
16
|
-
//# sourceMappingURL=errors.native.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.native.d.ts","sourceRoot":"","sources":["../../../src/debug/errors.native.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAKpD,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,mBAAmB,QAGlC;AAoCD,MAAM,WAAW,OAAQ,SAAQ,KAAK;IACpC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,OAAO,EAC3C,KAAK,EAAE,OAAO,GACb,IAAI,CAYN;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,SAE7C"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We hardcode the version of Worklets here in order to compare it with the
|
|
3
|
-
* version used to build the native part of the library in runtime. Remember to
|
|
4
|
-
* keep this in sync with the version declared in `package.json`
|
|
5
|
-
*/
|
|
6
|
-
export declare const jsVersion = "0.8.0";
|
|
7
|
-
//# sourceMappingURL=jsVersion.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsVersion.d.ts","sourceRoot":"","sources":["../../../src/debug/jsVersion.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,UAAU,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../../src/debug/logger.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM;kBACH,MAAM;mBAGL,MAAM;CAGtB,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export type WorkletsError = Error & {
|
|
2
|
-
name: 'Worklets';
|
|
3
|
-
};
|
|
4
|
-
export interface IWorkletsErrorConstructor extends Error {
|
|
5
|
-
new (message?: string): WorkletsError;
|
|
6
|
-
(message?: string): WorkletsError;
|
|
7
|
-
readonly prototype: WorkletsError;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/debug/types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAEzD,MAAM,WAAW,yBAA0B,SAAQ,KAAK;IACtD,KAAK,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IACtC,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,aAAa,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CACnC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { isSerializableRef, makeShareable, makeShareableCloneOnUIRecursive } from './memory/serializable';
|
|
2
|
-
import type { SerializableRef } from './memory/types';
|
|
3
|
-
/** @deprecated Use {@link SerializableRef} instead. */
|
|
4
|
-
export type ShareableRef<T> = SerializableRef<T>;
|
|
5
|
-
export { makeShareable, makeShareableCloneOnUIRecursive };
|
|
6
|
-
/** @deprecated It will be removed in the next major version. */
|
|
7
|
-
export type MakeShareableClone = <T>(value: T, shouldPersistRemote?: boolean, depth?: number) => ShareableRef<T>;
|
|
8
|
-
/** @deprecated Use {@link createSerializable} instead. */
|
|
9
|
-
export declare const makeShareableCloneRecursive: MakeShareableClone;
|
|
10
|
-
/** @deprecated Use {@link isSerializableRef} instead. */
|
|
11
|
-
export declare const isShareableRef: typeof isSerializableRef;
|
|
12
|
-
/** @deprecated Use {@link serializableMappingCache} instead. */
|
|
13
|
-
export declare const shareableMappingCache: {
|
|
14
|
-
set(serializable: object, serializableRef?: SerializableRef): void;
|
|
15
|
-
get: (key: object) => symbol | SerializableRef | undefined;
|
|
16
|
-
};
|
|
17
|
-
/** @deprecated NOOP, don't use. */
|
|
18
|
-
export declare function callMicrotasks(): void;
|
|
19
|
-
//# sourceMappingURL=deprecated.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated.d.ts","sourceRoot":"","sources":["../../src/deprecated.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,iBAAiB,EACjB,aAAa,EACb,+BAA+B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEtD,uDAAuD;AACvD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,+BAA+B,EAAE,CAAC;AAE1D,gEAAgE;AAChE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,EACjC,KAAK,EAAE,CAAC,EACR,mBAAmB,CAAC,EAAE,OAAO,EAC7B,KAAK,CAAC,EAAE,MAAM,KACX,YAAY,CAAC,CAAC,CAAC,CAAC;AAErB,0DAA0D;AAC1D,eAAO,MAAM,2BAA2B,EAAE,kBACtB,CAAC;AAErB,yDAAyD;AACzD,eAAO,MAAM,cAAc,0BAAoB,CAAC;AAEhD,gEAAgE;AAChE,eAAO,MAAM,qBAAqB;;;CAA2B,CAAC;AAE9D,mCAAmC;AACnC,wBAAgB,cAAc,IAAI,IAAI,CAGrC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DynamicFlagName, StaticFeatureFlagsSchema } from './types';
|
|
2
|
-
export declare function getStaticFeatureFlag(_name: keyof StaticFeatureFlagsSchema): boolean;
|
|
3
|
-
export declare function setDynamicFeatureFlag(_name: DynamicFlagName, _value: boolean): void;
|
|
4
|
-
export declare function getDynamicFeatureFlag(_name: DynamicFlagName): boolean;
|
|
5
|
-
//# sourceMappingURL=featureFlags.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"featureFlags.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/featureFlags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEzE,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,wBAAwB,GACpC,OAAO,CAET;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,eAAe,EACtB,MAAM,EAAE,OAAO,GACd,IAAI,CAEN;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAErE"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DynamicFlagName, DynamicFlagsType, StaticFeatureFlagsSchema } from './types';
|
|
2
|
-
export declare const DynamicFlags: DynamicFlagsType;
|
|
3
|
-
export declare function setDynamicFeatureFlag(name: DynamicFlagName, value: boolean): void;
|
|
4
|
-
export declare function getDynamicFeatureFlag(name: DynamicFlagName): boolean;
|
|
5
|
-
export declare function getStaticFeatureFlag(name: keyof StaticFeatureFlagsSchema): boolean;
|
|
6
|
-
//# sourceMappingURL=featureFlags.native.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"featureFlags.native.d.ts","sourceRoot":"","sources":["../../../src/featureFlags/featureFlags.native.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,YAAY,EAAE,gBAiC1B,CAAC;AAIF,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,eAAe,EACrB,KAAK,EAAE,OAAO,GACb,IAAI,CAEN;AAGD,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAEpE;AAID,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,wBAAwB,GACnC,OAAO,CAOT"}
|