@depup/react-native-worklets 0.11.3-depup.0
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/AnimationFrameQueue/AnimationFrameBatchinator.cpp +64 -0
- package/Common/cpp/worklets/AnimationFrameQueue/AnimationFrameBatchinator.h +38 -0
- package/Common/cpp/worklets/Compat/Holders.h +25 -0
- package/Common/cpp/worklets/Compat/StableApi.cpp +145 -0
- package/Common/cpp/worklets/Compat/StableApi.h +128 -0
- package/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.cpp +729 -0
- package/Common/cpp/worklets/NativeModules/JSIWorkletsModuleProxy.h +126 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.cpp +81 -0
- package/Common/cpp/worklets/NativeModules/WorkletsModuleProxy.h +76 -0
- package/Common/cpp/worklets/Registries/EventHandlerRegistry.cpp +95 -0
- package/Common/cpp/worklets/Registries/EventHandlerRegistry.h +44 -0
- package/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.cpp +10 -0
- package/Common/cpp/worklets/Registries/WorkletRuntimeRegistry.h +43 -0
- package/Common/cpp/worklets/RunLoop/AsyncQueue.h +14 -0
- package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.cpp +69 -0
- package/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h +48 -0
- package/Common/cpp/worklets/RunLoop/EventLoop.cpp +103 -0
- package/Common/cpp/worklets/RunLoop/EventLoop.h +52 -0
- package/Common/cpp/worklets/SharedItems/MemoryManager.cpp +60 -0
- package/Common/cpp/worklets/SharedItems/MemoryManager.h +29 -0
- package/Common/cpp/worklets/SharedItems/Serializable.cpp +373 -0
- package/Common/cpp/worklets/SharedItems/Serializable.h +413 -0
- package/Common/cpp/worklets/SharedItems/SerializableFactory.cpp +172 -0
- package/Common/cpp/worklets/SharedItems/SerializableFactory.h +85 -0
- package/Common/cpp/worklets/SharedItems/SerializableRemoteFunction.cpp +71 -0
- package/Common/cpp/worklets/SharedItems/SerializableRemoteFunction.h +75 -0
- package/Common/cpp/worklets/SharedItems/Shareable.cpp +84 -0
- package/Common/cpp/worklets/SharedItems/Shareable.h +43 -0
- package/Common/cpp/worklets/SharedItems/Synchronizable.cpp +59 -0
- package/Common/cpp/worklets/SharedItems/Synchronizable.h +57 -0
- package/Common/cpp/worklets/SharedItems/SynchronizableAccess.cpp +78 -0
- package/Common/cpp/worklets/SharedItems/SynchronizableAccess.h +45 -0
- package/Common/cpp/worklets/SharedItems/UnpackerLoader.h +78 -0
- package/Common/cpp/worklets/Tools/FeatureFlags.cpp +18 -0
- package/Common/cpp/worklets/Tools/FeatureFlags.h +44 -0
- package/Common/cpp/worklets/Tools/JSISerializer.cpp +312 -0
- package/Common/cpp/worklets/Tools/JSISerializer.h +42 -0
- package/Common/cpp/worklets/Tools/JSLogger.cpp +92 -0
- package/Common/cpp/worklets/Tools/JSLogger.h +48 -0
- package/Common/cpp/worklets/Tools/JSScheduler.cpp +21 -0
- package/Common/cpp/worklets/Tools/JSScheduler.h +35 -0
- package/Common/cpp/worklets/Tools/PlatformLogger.h +16 -0
- package/Common/cpp/worklets/Tools/RNRuntimeStatus.h +27 -0
- package/Common/cpp/worklets/Tools/ScriptBuffer.h +56 -0
- package/Common/cpp/worklets/Tools/SingleInstanceChecker.h +75 -0
- package/Common/cpp/worklets/Tools/ThreadSafeQueue.h +49 -0
- package/Common/cpp/worklets/Tools/UIScheduler.cpp +19 -0
- package/Common/cpp/worklets/Tools/UIScheduler.h +22 -0
- package/Common/cpp/worklets/Tools/VersionUtils.cpp +61 -0
- package/Common/cpp/worklets/Tools/VersionUtils.h +24 -0
- package/Common/cpp/worklets/Tools/WorkletEventHandler.cpp +34 -0
- package/Common/cpp/worklets/Tools/WorkletEventHandler.h +44 -0
- package/Common/cpp/worklets/Tools/WorkletsJSIUtils.cpp +30 -0
- package/Common/cpp/worklets/Tools/WorkletsJSIUtils.h +222 -0
- package/Common/cpp/worklets/Tools/WorkletsSystraceSection.h +116 -0
- package/Common/cpp/worklets/Tools/WorkletsVersion.cpp +46 -0
- package/Common/cpp/worklets/Tools/WorkletsVersion.h +18 -0
- package/Common/cpp/worklets/WorkletRuntime/BundleModeConfig.h +17 -0
- package/Common/cpp/worklets/WorkletRuntime/HermesProfiling.cpp +45 -0
- package/Common/cpp/worklets/WorkletRuntime/HermesProfiling.h +12 -0
- package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.cpp +68 -0
- package/Common/cpp/worklets/WorkletRuntime/RNRuntimeWorkletDecorator.h +24 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeBindings.h +59 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeData.h +38 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeHolder.h +19 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeManager.cpp +122 -0
- package/Common/cpp/worklets/WorkletRuntime/RuntimeManager.h +75 -0
- package/Common/cpp/worklets/WorkletRuntime/ScriptLoader.h +116 -0
- package/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.cpp +14 -0
- package/Common/cpp/worklets/WorkletRuntime/UIRuntimeDecorator.h +15 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.cpp +58 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletHermesRuntime.h +100 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.cpp +327 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +256 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeCollector.h +36 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp +320 -0
- package/Common/cpp/worklets/WorkletRuntime/WorkletRuntimeDecorator.h +36 -0
- package/LICENSE +20 -0
- package/README.md +43 -0
- package/RNWorklets.podspec +94 -0
- package/android/CMakeLists.txt +108 -0
- package/android/build.gradle.kts +369 -0
- package/android/fix-prefab.gradle.kts +56 -0
- package/android/generate-stub-pch.gradle.kts +84 -0
- package/android/gradle.properties +25 -0
- package/android/proguard-rules.pro +3 -0
- package/android/settings.gradle.kts +21 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/cpp/WorkletsPCH.h +26 -0
- package/android/src/main/cpp/worklets/android/AndroidUIScheduler.cpp +66 -0
- package/android/src/main/cpp/worklets/android/AndroidUIScheduler.h +38 -0
- package/android/src/main/cpp/worklets/android/AnimationFrameCallback.h +30 -0
- package/android/src/main/cpp/worklets/android/JScriptBufferWrapper.cpp +66 -0
- package/android/src/main/cpp/worklets/android/JScriptBufferWrapper.h +48 -0
- package/android/src/main/cpp/worklets/android/JWorkletRuntimeWrapper.cpp +51 -0
- package/android/src/main/cpp/worklets/android/JWorkletRuntimeWrapper.h +43 -0
- package/android/src/main/cpp/worklets/android/PlatformLogger.cpp +31 -0
- package/android/src/main/cpp/worklets/android/WorkletsModule.cpp +203 -0
- package/android/src/main/cpp/worklets/android/WorkletsModule.h +75 -0
- package/android/src/main/cpp/worklets/android/WorkletsOnLoad.cpp +19 -0
- package/android/src/main/java/com/swmansion/worklets/AndroidUIScheduler.kt +56 -0
- package/android/src/main/java/com/swmansion/worklets/ScriptBufferWrapper.kt +103 -0
- package/android/src/main/java/com/swmansion/worklets/WorkletsPackage.kt +42 -0
- package/android/src/main/java/com/swmansion/worklets/runloop/AnimationFrameCallback.kt +14 -0
- package/android/src/main/java/com/swmansion/worklets/runloop/AnimationFrameQueue.kt +112 -0
- package/android/src/networking/com/swmansion/worklets/WorkletRuntimeWrapper.kt +27 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsHeaderUtil.kt +30 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsModule.kt +187 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsNetworkEventUtil.kt +272 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsNetworking.kt +1124 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsOkHttpCallUtil.kt +40 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressListener.kt +13 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressRequestBody.kt +98 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressResponseBody.kt +60 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsProgressiveStringDecoder.kt +87 -0
- package/android/src/networking/com/swmansion/worklets/WorkletsRequestBodyUtil.kt +181 -0
- package/android/src/no-networking/com/swmansion/worklets/WorkletsModule.kt +143 -0
- package/apple/worklets/apple/AnimationFrameQueue.h +15 -0
- package/apple/worklets/apple/AnimationFrameQueue.mm +145 -0
- package/apple/worklets/apple/AssertJavaScriptQueue.h +14 -0
- package/apple/worklets/apple/AssertTurboModuleManagerQueue.h +12 -0
- package/apple/worklets/apple/IOSUIScheduler.h +14 -0
- package/apple/worklets/apple/IOSUIScheduler.mm +29 -0
- package/apple/worklets/apple/Networking/WorkletsNetworking.h +25 -0
- package/apple/worklets/apple/Networking/WorkletsNetworking.mm +707 -0
- package/apple/worklets/apple/PlatformLogger.mm +31 -0
- package/apple/worklets/apple/SlowAnimations.h +8 -0
- package/apple/worklets/apple/SlowAnimations.mm +45 -0
- package/apple/worklets/apple/WorkletsDisplayLink.h +21 -0
- package/apple/worklets/apple/WorkletsModule.h +28 -0
- package/apple/worklets/apple/WorkletsModule.mm +177 -0
- package/bundleMode/index.d.ts +6 -0
- package/bundleMode/index.js +182 -0
- package/bundleMode/shims/reactNativeShim.js +21 -0
- package/bundleMode/shims/turboModuleRegistryShim.js +47 -0
- package/changes.json +58 -0
- package/compatibility.json +29 -0
- package/jest/pluginTestUtils.ts +16 -0
- package/jest/resolver.js +18 -0
- package/lib/module/WorkletsModule/NativeWorklets.js +4 -0
- package/lib/module/WorkletsModule/NativeWorklets.js.map +1 -0
- package/lib/module/WorkletsModule/NativeWorklets.native.js +199 -0
- package/lib/module/WorkletsModule/NativeWorklets.native.js.map +1 -0
- package/lib/module/WorkletsModule/workletsModuleProxy.js +4 -0
- package/lib/module/WorkletsModule/workletsModuleProxy.js.map +1 -0
- package/lib/module/bundleMode/metroOverrides.native.js +26 -0
- package/lib/module/bundleMode/metroOverrides.native.js.map +1 -0
- package/lib/module/bundleMode/network.native.js +44 -0
- package/lib/module/bundleMode/network.native.js.map +1 -0
- package/lib/module/debug/bundleMode.js +6 -0
- package/lib/module/debug/bundleMode.js.map +1 -0
- package/lib/module/debug/bundleMode.native.js +11 -0
- package/lib/module/debug/bundleMode.native.js.map +1 -0
- package/lib/module/debug/checkCppVersion.js +29 -0
- package/lib/module/debug/checkCppVersion.js.map +1 -0
- package/lib/module/debug/errors.native.js +67 -0
- package/lib/module/debug/errors.native.js.map +1 -0
- package/lib/module/debug/jsVersion.js +9 -0
- package/lib/module/debug/jsVersion.js.map +1 -0
- package/lib/module/debug/logger.js +15 -0
- package/lib/module/debug/logger.js.map +1 -0
- package/lib/module/debug/slowAnimations.js +7 -0
- package/lib/module/debug/slowAnimations.js.map +1 -0
- package/lib/module/debug/slowAnimations.native.js +17 -0
- package/lib/module/debug/slowAnimations.native.js.map +1 -0
- package/lib/module/deprecated.js +27 -0
- package/lib/module/deprecated.js.map +1 -0
- package/lib/module/featureFlags/featureFlags.js +12 -0
- package/lib/module/featureFlags/featureFlags.js.map +1 -0
- package/lib/module/featureFlags/featureFlags.native.js +51 -0
- package/lib/module/featureFlags/featureFlags.native.js.map +1 -0
- package/lib/module/featureFlags/staticFlags.json +6 -0
- package/lib/module/featureFlags/types.js +16 -0
- package/lib/module/featureFlags/types.js.map +1 -0
- package/lib/module/guardImplementation.native.js +17 -0
- package/lib/module/guardImplementation.native.js.map +1 -0
- package/lib/module/index.js +26 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/initializers/initializers.js +24 -0
- package/lib/module/initializers/initializers.js.map +1 -0
- package/lib/module/initializers/initializers.native.js +195 -0
- package/lib/module/initializers/initializers.native.js.map +1 -0
- package/lib/module/memory/bundleUnpacker.native.js +38 -0
- package/lib/module/memory/bundleUnpacker.native.js.map +1 -0
- package/lib/module/memory/customSerializableUnpacker.native.js +20 -0
- package/lib/module/memory/customSerializableUnpacker.native.js.map +1 -0
- package/lib/module/memory/isShareable.js +8 -0
- package/lib/module/memory/isShareable.js.map +1 -0
- package/lib/module/memory/isSynchronizable.js +8 -0
- package/lib/module/memory/isSynchronizable.js.map +1 -0
- package/lib/module/memory/remoteFunctionUnpacker.native.js +18 -0
- package/lib/module/memory/remoteFunctionUnpacker.native.js.map +1 -0
- package/lib/module/memory/serializable.js +18 -0
- package/lib/module/memory/serializable.js.map +1 -0
- package/lib/module/memory/serializable.native.js +619 -0
- package/lib/module/memory/serializable.native.js.map +1 -0
- package/lib/module/memory/serializableMappingCache.js +11 -0
- package/lib/module/memory/serializableMappingCache.js.map +1 -0
- package/lib/module/memory/serializableMappingCache.native.js +29 -0
- package/lib/module/memory/serializableMappingCache.native.js.map +1 -0
- package/lib/module/memory/shareable.js +18 -0
- package/lib/module/memory/shareable.js.map +1 -0
- package/lib/module/memory/shareable.native.js +42 -0
- package/lib/module/memory/shareable.native.js.map +1 -0
- package/lib/module/memory/shareableGuestUnpacker.native.js +105 -0
- package/lib/module/memory/shareableGuestUnpacker.native.js.map +1 -0
- package/lib/module/memory/shareableHostUnpacker.native.js +20 -0
- package/lib/module/memory/shareableHostUnpacker.native.js.map +1 -0
- package/lib/module/memory/synchronizable.js +6 -0
- package/lib/module/memory/synchronizable.js.map +1 -0
- package/lib/module/memory/synchronizable.native.js +9 -0
- package/lib/module/memory/synchronizable.native.js.map +1 -0
- package/lib/module/memory/synchronizableUnpacker.native.js +47 -0
- package/lib/module/memory/synchronizableUnpacker.native.js.map +1 -0
- package/lib/module/memory/types.js +12 -0
- package/lib/module/memory/types.js.map +1 -0
- package/lib/module/memory/valueUnpacker.native.js +52 -0
- package/lib/module/memory/valueUnpacker.native.js.map +1 -0
- package/lib/module/mock.js +85 -0
- package/lib/module/mock.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/platformChecker.js +4 -0
- package/lib/module/platformChecker.js.map +1 -0
- package/lib/module/platformChecker.native.js +4 -0
- package/lib/module/platformChecker.native.js.map +1 -0
- package/lib/module/privateGlobals.d.js +7 -0
- package/lib/module/privateGlobals.d.js.map +1 -0
- package/lib/module/runLoop/common/setImmediatePolyfill.js +15 -0
- package/lib/module/runLoop/common/setImmediatePolyfill.js.map +1 -0
- package/lib/module/runLoop/common/setIntervalPolyfill.js +26 -0
- package/lib/module/runLoop/common/setIntervalPolyfill.js.map +1 -0
- package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js +10 -0
- package/lib/module/runLoop/uiRuntime/mockedRequestAnimationFrame.js.map +1 -0
- package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js +71 -0
- package/lib/module/runLoop/uiRuntime/requestAnimationFrame.js.map +1 -0
- package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js +32 -0
- package/lib/module/runLoop/uiRuntime/setTimeoutPolyfill.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/index.js +19 -0
- package/lib/module/runLoop/workletRuntime/index.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/queueMicrotask.js +11 -0
- package/lib/module/runLoop/workletRuntime/queueMicrotask.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js +48 -0
- package/lib/module/runLoop/workletRuntime/requestAnimationFramePolyfill.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/setTimeout.js +28 -0
- package/lib/module/runLoop/workletRuntime/setTimeout.js.map +1 -0
- package/lib/module/runLoop/workletRuntime/taskQueue.js +37 -0
- package/lib/module/runLoop/workletRuntime/taskQueue.js.map +1 -0
- package/lib/module/runtimeKind.js +92 -0
- package/lib/module/runtimeKind.js.map +1 -0
- package/lib/module/runtimes.js +36 -0
- package/lib/module/runtimes.js.map +1 -0
- package/lib/module/runtimes.native.js +379 -0
- package/lib/module/runtimes.native.js.map +1 -0
- package/lib/module/specs/NativeWorkletsModule.js +5 -0
- package/lib/module/specs/NativeWorkletsModule.js.map +1 -0
- package/lib/module/specs/index.js +10 -0
- package/lib/module/specs/index.js.map +1 -0
- package/lib/module/threads.js +60 -0
- package/lib/module/threads.js.map +1 -0
- package/lib/module/threads.native.js +295 -0
- package/lib/module/threads.native.js.map +1 -0
- package/lib/module/types.js +5 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/workletFunction.js +36 -0
- package/lib/module/workletFunction.js.map +1 -0
- package/lib/typescript/WorkletsModule/NativeWorklets.d.ts +3 -0
- package/lib/typescript/WorkletsModule/NativeWorklets.d.ts.map +1 -0
- package/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts +3 -0
- package/lib/typescript/WorkletsModule/NativeWorklets.native.d.ts.map +1 -0
- package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts +59 -0
- package/lib/typescript/WorkletsModule/workletsModuleProxy.d.ts.map +1 -0
- package/lib/typescript/bundleMode/metroOverrides.native.d.ts +9 -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/bundleMode.d.ts +2 -0
- package/lib/typescript/debug/bundleMode.d.ts.map +1 -0
- package/lib/typescript/debug/bundleMode.native.d.ts +2 -0
- package/lib/typescript/debug/bundleMode.native.d.ts.map +1 -0
- package/lib/typescript/debug/checkCppVersion.d.ts +3 -0
- package/lib/typescript/debug/checkCppVersion.d.ts.map +1 -0
- package/lib/typescript/debug/errors.native.d.ts +13 -0
- package/lib/typescript/debug/errors.native.d.ts.map +1 -0
- package/lib/typescript/debug/jsVersion.d.ts +7 -0
- package/lib/typescript/debug/jsVersion.d.ts.map +1 -0
- package/lib/typescript/debug/logger.d.ts +5 -0
- package/lib/typescript/debug/logger.d.ts.map +1 -0
- package/lib/typescript/debug/slowAnimations.d.ts +2 -0
- package/lib/typescript/debug/slowAnimations.d.ts.map +1 -0
- package/lib/typescript/debug/slowAnimations.native.d.ts +11 -0
- package/lib/typescript/debug/slowAnimations.native.d.ts.map +1 -0
- package/lib/typescript/deprecated.d.ts +19 -0
- package/lib/typescript/deprecated.d.ts.map +1 -0
- package/lib/typescript/featureFlags/featureFlags.d.ts +5 -0
- package/lib/typescript/featureFlags/featureFlags.d.ts.map +1 -0
- package/lib/typescript/featureFlags/featureFlags.native.d.ts +6 -0
- package/lib/typescript/featureFlags/featureFlags.native.d.ts.map +1 -0
- package/lib/typescript/featureFlags/types.d.ts +23 -0
- package/lib/typescript/featureFlags/types.d.ts.map +1 -0
- package/lib/typescript/guardImplementation.native.d.ts +3 -0
- package/lib/typescript/guardImplementation.native.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +19 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/initializers/initializers.d.ts +2 -0
- package/lib/typescript/initializers/initializers.d.ts.map +1 -0
- package/lib/typescript/initializers/initializers.native.d.ts +19 -0
- package/lib/typescript/initializers/initializers.native.d.ts.map +1 -0
- package/lib/typescript/memory/bundleUnpacker.native.d.ts +7 -0
- package/lib/typescript/memory/bundleUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/customSerializableUnpacker.native.d.ts +3 -0
- package/lib/typescript/memory/customSerializableUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/isShareable.d.ts +3 -0
- package/lib/typescript/memory/isShareable.d.ts.map +1 -0
- package/lib/typescript/memory/isSynchronizable.d.ts +3 -0
- package/lib/typescript/memory/isSynchronizable.d.ts.map +1 -0
- package/lib/typescript/memory/remoteFunctionUnpacker.native.d.ts +3 -0
- package/lib/typescript/memory/remoteFunctionUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/serializable.d.ts +7 -0
- package/lib/typescript/memory/serializable.d.ts.map +1 -0
- package/lib/typescript/memory/serializable.native.d.ts +37 -0
- package/lib/typescript/memory/serializable.native.d.ts.map +1 -0
- package/lib/typescript/memory/serializableMappingCache.d.ts +6 -0
- package/lib/typescript/memory/serializableMappingCache.d.ts.map +1 -0
- package/lib/typescript/memory/serializableMappingCache.native.d.ts +13 -0
- package/lib/typescript/memory/serializableMappingCache.native.d.ts.map +1 -0
- package/lib/typescript/memory/shareable.d.ts +15 -0
- package/lib/typescript/memory/shareable.d.ts.map +1 -0
- package/lib/typescript/memory/shareable.native.d.ts +15 -0
- package/lib/typescript/memory/shareable.native.d.ts.map +1 -0
- package/lib/typescript/memory/shareableGuestUnpacker.native.d.ts +4 -0
- package/lib/typescript/memory/shareableGuestUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/shareableHostUnpacker.native.d.ts +4 -0
- package/lib/typescript/memory/shareableHostUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/synchronizable.d.ts +3 -0
- package/lib/typescript/memory/synchronizable.d.ts.map +1 -0
- package/lib/typescript/memory/synchronizable.native.d.ts +3 -0
- package/lib/typescript/memory/synchronizable.native.d.ts.map +1 -0
- package/lib/typescript/memory/synchronizableUnpacker.native.d.ts +4 -0
- package/lib/typescript/memory/synchronizableUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/memory/types.d.ts +136 -0
- package/lib/typescript/memory/types.d.ts.map +1 -0
- package/lib/typescript/memory/valueUnpacker.native.d.ts +7 -0
- package/lib/typescript/memory/valueUnpacker.native.d.ts.map +1 -0
- package/lib/typescript/mock.d.ts +2 -0
- package/lib/typescript/mock.d.ts.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/platformChecker.d.ts +2 -0
- package/lib/typescript/platformChecker.d.ts.map +1 -0
- package/lib/typescript/platformChecker.native.d.ts +2 -0
- package/lib/typescript/platformChecker.native.d.ts.map +1 -0
- package/lib/typescript/runLoop/common/setImmediatePolyfill.d.ts +2 -0
- package/lib/typescript/runLoop/common/setImmediatePolyfill.d.ts.map +1 -0
- package/lib/typescript/runLoop/common/setIntervalPolyfill.d.ts +2 -0
- package/lib/typescript/runLoop/common/setIntervalPolyfill.d.ts.map +1 -0
- package/lib/typescript/runLoop/uiRuntime/mockedRequestAnimationFrame.d.ts +6 -0
- package/lib/typescript/runLoop/uiRuntime/mockedRequestAnimationFrame.d.ts.map +1 -0
- package/lib/typescript/runLoop/uiRuntime/requestAnimationFrame.d.ts +2 -0
- package/lib/typescript/runLoop/uiRuntime/requestAnimationFrame.d.ts.map +1 -0
- package/lib/typescript/runLoop/uiRuntime/setTimeoutPolyfill.d.ts +2 -0
- package/lib/typescript/runLoop/uiRuntime/setTimeoutPolyfill.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/index.d.ts +2 -0
- package/lib/typescript/runLoop/workletRuntime/index.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/queueMicrotask.d.ts +2 -0
- package/lib/typescript/runLoop/workletRuntime/queueMicrotask.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/requestAnimationFramePolyfill.d.ts +2 -0
- package/lib/typescript/runLoop/workletRuntime/requestAnimationFramePolyfill.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/setTimeout.d.ts +2 -0
- package/lib/typescript/runLoop/workletRuntime/setTimeout.d.ts.map +1 -0
- package/lib/typescript/runLoop/workletRuntime/taskQueue.d.ts +10 -0
- package/lib/typescript/runLoop/workletRuntime/taskQueue.d.ts.map +1 -0
- package/lib/typescript/runtimeKind.d.ts +56 -0
- package/lib/typescript/runtimeKind.d.ts.map +1 -0
- package/lib/typescript/runtimes.d.ts +15 -0
- package/lib/typescript/runtimes.d.ts.map +1 -0
- package/lib/typescript/runtimes.native.d.ts +155 -0
- package/lib/typescript/runtimes.native.d.ts.map +1 -0
- package/lib/typescript/specs/NativeWorkletsModule.d.ts +9 -0
- package/lib/typescript/specs/NativeWorkletsModule.d.ts.map +1 -0
- package/lib/typescript/specs/index.d.ts +3 -0
- package/lib/typescript/specs/index.d.ts.map +1 -0
- package/lib/typescript/threads.d.ts +8 -0
- package/lib/typescript/threads.d.ts.map +1 -0
- package/lib/typescript/threads.native.d.ts +125 -0
- package/lib/typescript/threads.native.d.ts.map +1 -0
- package/lib/typescript/types.d.ts +136 -0
- package/lib/typescript/types.d.ts.map +1 -0
- package/lib/typescript/workletFunction.d.ts +26 -0
- package/lib/typescript/workletFunction.d.ts.map +1 -0
- package/package.json +220 -0
- package/plugin/index.d.ts +168 -0
- package/plugin/index.js +2188 -0
- package/scripts/validate-react-native-version.js +43 -0
- package/scripts/worklets_utils.rb +94 -0
- package/src/WorkletsModule/NativeWorklets.native.ts +461 -0
- package/src/WorkletsModule/NativeWorklets.ts +5 -0
- package/src/WorkletsModule/workletsModuleProxy.ts +247 -0
- package/src/bundleMode/metroOverrides.native.ts +33 -0
- package/src/bundleMode/network.native.ts +63 -0
- package/src/debug/bundleMode.native.ts +18 -0
- package/src/debug/bundleMode.ts +5 -0
- package/src/debug/checkCppVersion.ts +34 -0
- package/src/debug/errors.native.ts +74 -0
- package/src/debug/jsVersion.ts +8 -0
- package/src/debug/logger.ts +16 -0
- package/src/debug/slowAnimations.native.ts +15 -0
- package/src/debug/slowAnimations.ts +6 -0
- package/src/deprecated.ts +38 -0
- package/src/featureFlags/featureFlags.native.ts +70 -0
- package/src/featureFlags/featureFlags.ts +20 -0
- package/src/featureFlags/staticFlags.json +6 -0
- package/src/featureFlags/types.ts +32 -0
- package/src/guardImplementation.native.ts +26 -0
- package/src/index.ts +95 -0
- package/src/initializers/initializers.native.ts +218 -0
- package/src/initializers/initializers.ts +24 -0
- package/src/memory/bundleUnpacker.native.ts +59 -0
- package/src/memory/customSerializableUnpacker.native.ts +30 -0
- package/src/memory/isShareable.ts +16 -0
- package/src/memory/isSynchronizable.ts +14 -0
- package/src/memory/remoteFunctionUnpacker.native.ts +27 -0
- package/src/memory/serializable.native.ts +889 -0
- package/src/memory/serializable.ts +36 -0
- package/src/memory/serializableMappingCache.native.ts +37 -0
- package/src/memory/serializableMappingCache.ts +12 -0
- package/src/memory/shareable.native.ts +68 -0
- package/src/memory/shareable.ts +27 -0
- package/src/memory/shareableGuestUnpacker.native.ts +168 -0
- package/src/memory/shareableHostUnpacker.native.ts +31 -0
- package/src/memory/synchronizable.native.ts +17 -0
- package/src/memory/synchronizable.ts +9 -0
- package/src/memory/synchronizableUnpacker.native.ts +65 -0
- package/src/memory/types.ts +191 -0
- package/src/memory/valueUnpacker.native.ts +79 -0
- package/src/mock.ts +111 -0
- package/src/platformChecker.native.ts +3 -0
- package/src/platformChecker.ts +4 -0
- package/src/privateGlobals.d.ts +127 -0
- package/src/runLoop/common/setImmediatePolyfill.ts +20 -0
- package/src/runLoop/common/setIntervalPolyfill.ts +38 -0
- package/src/runLoop/uiRuntime/mockedRequestAnimationFrame.ts +11 -0
- package/src/runLoop/uiRuntime/requestAnimationFrame.ts +87 -0
- package/src/runLoop/uiRuntime/setTimeoutPolyfill.ts +40 -0
- package/src/runLoop/workletRuntime/index.ts +18 -0
- package/src/runLoop/workletRuntime/queueMicrotask.ts +13 -0
- package/src/runLoop/workletRuntime/requestAnimationFramePolyfill.ts +61 -0
- package/src/runLoop/workletRuntime/setTimeout.ts +37 -0
- package/src/runLoop/workletRuntime/taskQueue.ts +44 -0
- package/src/runtimeKind.ts +85 -0
- package/src/runtimes.native.ts +572 -0
- package/src/runtimes.ts +107 -0
- package/src/specs/NativeWorkletsModule.ts +11 -0
- package/src/specs/index.ts +13 -0
- package/src/threads.native.ts +408 -0
- package/src/threads.ts +110 -0
- package/src/types.ts +164 -0
- package/src/workletFunction.ts +41 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
type Callback = () => void;
|
|
4
|
+
|
|
5
|
+
export type Queue = {
|
|
6
|
+
microtasks: Array<Callback>;
|
|
7
|
+
timeoutCallbacks: Map<number, Callback>;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export function setupTaskQueue() {
|
|
11
|
+
'worklet';
|
|
12
|
+
const queue: Queue = {
|
|
13
|
+
microtasks: [],
|
|
14
|
+
timeoutCallbacks: new Map(),
|
|
15
|
+
};
|
|
16
|
+
globalThis._taskQueue = queue;
|
|
17
|
+
|
|
18
|
+
globalThis.__runTimeoutCallback = function (handlerId: number) {
|
|
19
|
+
const task = queue.timeoutCallbacks.get(handlerId);
|
|
20
|
+
task?.();
|
|
21
|
+
queue.timeoutCallbacks.delete(handlerId);
|
|
22
|
+
globalThis.__callMicrotasks();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
globalThis.__callMicrotasks = function callMicrotasks() {
|
|
26
|
+
for (let i = 0; i < queue.microtasks.length; i++) {
|
|
27
|
+
queue.microtasks[i]();
|
|
28
|
+
}
|
|
29
|
+
queue.microtasks = [];
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function pushMicrotask(callback: Callback) {
|
|
34
|
+
'worklet';
|
|
35
|
+
const queue = globalThis._taskQueue;
|
|
36
|
+
queue.microtasks.push(callback);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function pushTask(callback: Callback, handlerId: number, delay: number) {
|
|
40
|
+
'worklet';
|
|
41
|
+
const queue = globalThis._taskQueue;
|
|
42
|
+
queue.timeoutCallbacks.set(handlerId, callback);
|
|
43
|
+
globalThis._scheduleTimeoutCallback(delay, handlerId);
|
|
44
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
export enum RuntimeKind {
|
|
4
|
+
/**
|
|
5
|
+
* The React Native runtime, which is the main runtime for React Native where
|
|
6
|
+
* React exists and where components are rendered.
|
|
7
|
+
*/
|
|
8
|
+
ReactNative = 1,
|
|
9
|
+
/**
|
|
10
|
+
* The UI runtime, which is a special runtime that executes on the UI thread,
|
|
11
|
+
* mostly used for animations and gestures.
|
|
12
|
+
*/
|
|
13
|
+
UI = 2,
|
|
14
|
+
/** Additional runtime created on-demand by the user. */
|
|
15
|
+
Worker = 3,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Programmatic way to check the current runtime kind. It's useful when you need
|
|
20
|
+
* specific implementations for different runtimes created by Worklets.
|
|
21
|
+
*
|
|
22
|
+
* For more optimized calls you can check the value of
|
|
23
|
+
* `globalThis.__RUNTIME_KIND` directly.
|
|
24
|
+
*
|
|
25
|
+
* @returns The kind of the current runtime.
|
|
26
|
+
*/
|
|
27
|
+
export function getRuntimeKind(): RuntimeKind {
|
|
28
|
+
'worklet';
|
|
29
|
+
return globalThis.__RUNTIME_KIND;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Checks if the current runtime is the [React Native
|
|
34
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds/#rn-runtime).
|
|
35
|
+
*
|
|
36
|
+
* @returns `true` if the current runtime is the React Native Runtime, `false`
|
|
37
|
+
* otherwise.
|
|
38
|
+
*/
|
|
39
|
+
export function isRNRuntime(): boolean {
|
|
40
|
+
'worklet';
|
|
41
|
+
return globalThis.__RUNTIME_KIND === 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Checks if the current runtime is a [Worklet
|
|
46
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds/#worklet-runtime).
|
|
47
|
+
*
|
|
48
|
+
* @returns `true` if the current runtime is a Worklet Runtime, `false`
|
|
49
|
+
* otherwise.
|
|
50
|
+
*/
|
|
51
|
+
export function isWorkletRuntime(): boolean {
|
|
52
|
+
'worklet';
|
|
53
|
+
return globalThis.__RUNTIME_KIND !== 1;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Checks if the current runtime is the [UI
|
|
58
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds/#ui-runtime).
|
|
59
|
+
*
|
|
60
|
+
* @returns `true` if the current runtime is the UI Runtime, `false` otherwise.
|
|
61
|
+
*/
|
|
62
|
+
export function isUIRuntime(): boolean {
|
|
63
|
+
'worklet';
|
|
64
|
+
return globalThis.__RUNTIME_KIND === 2;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Checks if the current runtime is a [Worker
|
|
69
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds/#worker-runtime).
|
|
70
|
+
*
|
|
71
|
+
* @returns `true` if the current runtime is a Worker Runtime, `false`
|
|
72
|
+
* otherwise.
|
|
73
|
+
*/
|
|
74
|
+
export function isWorkerRuntime(): boolean {
|
|
75
|
+
'worklet';
|
|
76
|
+
return globalThis.__RUNTIME_KIND === 3;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// is-tree-shakable-suppress
|
|
80
|
+
if (globalThis.__RUNTIME_KIND === undefined) {
|
|
81
|
+
// In Jest environments eager imports make this file to evaluate before
|
|
82
|
+
// `initializers.ts` file, therefore we have to set the RuntimeKind here,
|
|
83
|
+
// just to be safe.
|
|
84
|
+
globalThis.__RUNTIME_KIND = RuntimeKind.ReactNative;
|
|
85
|
+
}
|
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
import { isBundleModeEnabled } from './debug/bundleMode';
|
|
4
|
+
import { getStaticFeatureFlag } from './featureFlags/featureFlags';
|
|
5
|
+
import { addNoBundleModeGuardImplementation } from './guardImplementation';
|
|
6
|
+
import {
|
|
7
|
+
getMemorySafeCapturableConsole,
|
|
8
|
+
setupConsole,
|
|
9
|
+
setupConsoleForwarding,
|
|
10
|
+
setupSerializer,
|
|
11
|
+
} from './initializers/initializers';
|
|
12
|
+
import {
|
|
13
|
+
createSerializable,
|
|
14
|
+
makeShareableCloneOnUIRecursive,
|
|
15
|
+
} from './memory/serializable';
|
|
16
|
+
import { serializableMappingCache } from './memory/serializableMappingCache';
|
|
17
|
+
import type { SerializableRef } from './memory/types';
|
|
18
|
+
import { setupRunLoop } from './runLoop/workletRuntime';
|
|
19
|
+
import { RuntimeKind } from './runtimeKind';
|
|
20
|
+
import type {
|
|
21
|
+
WorkletFunction,
|
|
22
|
+
WorkletRuntime,
|
|
23
|
+
WorkletRuntimeConfig,
|
|
24
|
+
} from './types';
|
|
25
|
+
import { isWorkletFunction } from './workletFunction';
|
|
26
|
+
import { WorkletsModule } from './WorkletsModule/NativeWorklets';
|
|
27
|
+
|
|
28
|
+
const SHOULD_CAPTURE_SCHEDULE_STACK =
|
|
29
|
+
__DEV__ && getStaticFeatureFlag('ENABLE_CROSS_RUNTIME_STACK_TRACES');
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The ID of the [UI Worklet
|
|
33
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
34
|
+
*/
|
|
35
|
+
export const UIRuntimeId = RuntimeKind.UI as 2;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Lets you create a new JS runtime which can be used to run worklets possibly
|
|
39
|
+
* on different threads than JS or UI thread.
|
|
40
|
+
*
|
|
41
|
+
* @param config - Runtime configuration object - {@link WorkletRuntimeConfig}.
|
|
42
|
+
* @returns WorkletRuntime which is a
|
|
43
|
+
* `jsi::HostObject<worklets::WorkletRuntime>` - {@link WorkletRuntime}
|
|
44
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/
|
|
45
|
+
*/
|
|
46
|
+
// @ts-expect-error Public API overload.
|
|
47
|
+
export function createWorkletRuntime(
|
|
48
|
+
config?: WorkletRuntimeConfig
|
|
49
|
+
): WorkletRuntime;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* @deprecated Please use the new config object signature instead:
|
|
53
|
+
* `createWorkletRuntime({ name, initializer })`
|
|
54
|
+
*
|
|
55
|
+
* Lets you create a new JS runtime which can be used to run worklets possibly
|
|
56
|
+
* on different threads than JS or UI thread.
|
|
57
|
+
* @param name - A name used to identify the runtime which will appear in
|
|
58
|
+
* devices list in Chrome DevTools.
|
|
59
|
+
* @param initializer - An optional worklet that will be run synchronously on
|
|
60
|
+
* the same thread immediately after the runtime is created.
|
|
61
|
+
* @returns WorkletRuntime which is a
|
|
62
|
+
* `jsi::HostObject<worklets::WorkletRuntime>` - {@link WorkletRuntime}
|
|
63
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/createWorkletRuntime/
|
|
64
|
+
*/
|
|
65
|
+
export function createWorkletRuntime(
|
|
66
|
+
name?: string,
|
|
67
|
+
initializer?: () => void
|
|
68
|
+
): WorkletRuntime;
|
|
69
|
+
|
|
70
|
+
export function createWorkletRuntime(
|
|
71
|
+
nameOrConfig?: string | WorkletRuntimeConfigInternal,
|
|
72
|
+
initializer?: WorkletFunction<[], void>
|
|
73
|
+
): WorkletRuntime {
|
|
74
|
+
const runtimeBoundCapturableConsole =
|
|
75
|
+
globalThis._WORKLETS_BUNDLE_MODE_ENABLED && !__DEV__
|
|
76
|
+
? null
|
|
77
|
+
: getMemorySafeCapturableConsole();
|
|
78
|
+
|
|
79
|
+
let name: string;
|
|
80
|
+
let initializerFn: (() => void) | undefined;
|
|
81
|
+
let queue: 'default' | object | null = 'default';
|
|
82
|
+
let animationQueuePollingRate: number;
|
|
83
|
+
let enableEventLoop = true;
|
|
84
|
+
if (typeof nameOrConfig === 'string') {
|
|
85
|
+
name = nameOrConfig;
|
|
86
|
+
initializerFn = initializer;
|
|
87
|
+
} else {
|
|
88
|
+
// TODO: Make anonymous name globally unique.
|
|
89
|
+
name = nameOrConfig?.name ?? 'anonymous';
|
|
90
|
+
initializerFn = nameOrConfig?.initializer;
|
|
91
|
+
if (nameOrConfig?.queue !== undefined) {
|
|
92
|
+
queue = nameOrConfig.queue;
|
|
93
|
+
} else if (nameOrConfig?.useDefaultQueue === false) {
|
|
94
|
+
queue = nameOrConfig.customQueue ?? null;
|
|
95
|
+
}
|
|
96
|
+
animationQueuePollingRate = Math.round(
|
|
97
|
+
nameOrConfig?.animationQueuePollingRate ?? 16
|
|
98
|
+
);
|
|
99
|
+
enableEventLoop = nameOrConfig?.enableEventLoop ?? true;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
const useDefaultQueue = queue === 'default';
|
|
103
|
+
const customQueue =
|
|
104
|
+
typeof queue === 'object' && queue !== null ? queue : undefined;
|
|
105
|
+
|
|
106
|
+
if (initializerFn && !isWorkletFunction(initializerFn)) {
|
|
107
|
+
throw new Error(
|
|
108
|
+
'[Worklets] The initializer passed to `createWorkletRuntime` is not a worklet.'
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return WorkletsModule.createWorkletRuntime(
|
|
113
|
+
name,
|
|
114
|
+
createSerializable(() => {
|
|
115
|
+
'worklet';
|
|
116
|
+
setupSerializer();
|
|
117
|
+
if (!globalThis._WORKLETS_BUNDLE_MODE_ENABLED) {
|
|
118
|
+
setupConsole(runtimeBoundCapturableConsole!);
|
|
119
|
+
} else if (__DEV__) {
|
|
120
|
+
setupConsoleForwarding(runtimeBoundCapturableConsole!);
|
|
121
|
+
}
|
|
122
|
+
if (enableEventLoop) {
|
|
123
|
+
setupRunLoop(animationQueuePollingRate);
|
|
124
|
+
}
|
|
125
|
+
initializerFn?.();
|
|
126
|
+
}),
|
|
127
|
+
useDefaultQueue,
|
|
128
|
+
customQueue,
|
|
129
|
+
enableEventLoop
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Lets you asynchronously run a
|
|
135
|
+
* [worklet](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worklet)
|
|
136
|
+
* on a [Worker
|
|
137
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime).
|
|
138
|
+
*
|
|
139
|
+
* Check
|
|
140
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds}
|
|
141
|
+
* for more information about the different runtime kinds.
|
|
142
|
+
*
|
|
143
|
+
* - The worklet is scheduled on the Worker Runtime's [Async
|
|
144
|
+
* Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h)
|
|
145
|
+
*
|
|
146
|
+
* @param workletRuntime - The runtime to schedule the worklet on.
|
|
147
|
+
* @param worklet - The worklet to schedule.
|
|
148
|
+
* @param args - The arguments to pass to the worklet.
|
|
149
|
+
* @returns The return value of the worklet.
|
|
150
|
+
*/
|
|
151
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
152
|
+
// before it's transformed by Worklets Babel plugin.
|
|
153
|
+
export function scheduleOnRuntime<Args extends unknown[], ReturnValue>(
|
|
154
|
+
workletRuntime: WorkletRuntime,
|
|
155
|
+
worklet: (...args: Args) => ReturnValue,
|
|
156
|
+
...args: Args
|
|
157
|
+
): void;
|
|
158
|
+
|
|
159
|
+
export function scheduleOnRuntime<Args extends unknown[], ReturnValue>(
|
|
160
|
+
workletRuntime: WorkletRuntime,
|
|
161
|
+
worklet: WorkletFunction<Args, ReturnValue>,
|
|
162
|
+
...args: Args
|
|
163
|
+
): void {
|
|
164
|
+
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
165
|
+
throw new Error(
|
|
166
|
+
'[Worklets] The function passed to `scheduleOnRuntime` is not a worklet.'
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
WorkletsModule.scheduleOnRuntime(
|
|
171
|
+
workletRuntime,
|
|
172
|
+
createSerializable(() => {
|
|
173
|
+
'worklet';
|
|
174
|
+
worklet(...args);
|
|
175
|
+
globalThis.__callMicrotasks?.();
|
|
176
|
+
}),
|
|
177
|
+
SHOULD_CAPTURE_SCHEDULE_STACK ? new Error().stack : undefined
|
|
178
|
+
);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if (!isBundleModeEnabled()) {
|
|
182
|
+
function scheduleOnRuntimeWorklet<Args extends unknown[], ReturnValue>(
|
|
183
|
+
workletRuntime: WorkletRuntime,
|
|
184
|
+
worklet: WorkletFunction<Args, ReturnValue>,
|
|
185
|
+
...args: Args
|
|
186
|
+
): void {
|
|
187
|
+
'worklet';
|
|
188
|
+
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
189
|
+
throw new Error(
|
|
190
|
+
'[Worklets] The function passed to `scheduleOnRuntime` is not a worklet.'
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
globalThis.__workletsModuleProxy.scheduleOnRuntime(
|
|
195
|
+
workletRuntime,
|
|
196
|
+
globalThis.__serializer(() => {
|
|
197
|
+
'worklet';
|
|
198
|
+
worklet(...args);
|
|
199
|
+
globalThis.__callMicrotasks?.();
|
|
200
|
+
})
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
serializableMappingCache.set(
|
|
205
|
+
scheduleOnRuntime,
|
|
206
|
+
createSerializable(scheduleOnRuntimeWorklet)
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Lets you asynchronously run a
|
|
212
|
+
* [worklet](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worklet)
|
|
213
|
+
* on a [Worker
|
|
214
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime)
|
|
215
|
+
* identified by the runtime's id.
|
|
216
|
+
*
|
|
217
|
+
* Check
|
|
218
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds}
|
|
219
|
+
* for more information about the different runtime kinds.
|
|
220
|
+
*
|
|
221
|
+
* - The worklet is scheduled on the Worker Runtime's [Async
|
|
222
|
+
* Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h)
|
|
223
|
+
*
|
|
224
|
+
* @param runtimeId - The id of the runtime to schedule the worklet on.
|
|
225
|
+
* @param worklet - The worklet to schedule.
|
|
226
|
+
* @param args - The arguments to pass to the worklet.
|
|
227
|
+
* @returns The return value of the worklet.
|
|
228
|
+
*/
|
|
229
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
230
|
+
// before it's transformed by Worklets Babel plugin.
|
|
231
|
+
export function scheduleOnRuntimeWithId<Args extends unknown[], ReturnValue>(
|
|
232
|
+
runtimeId: number,
|
|
233
|
+
worklet: (...args: Args) => ReturnValue,
|
|
234
|
+
...args: Args
|
|
235
|
+
): void;
|
|
236
|
+
|
|
237
|
+
export function scheduleOnRuntimeWithId<Args extends unknown[], ReturnValue>(
|
|
238
|
+
runtimeId: number,
|
|
239
|
+
worklet: WorkletFunction<Args, ReturnValue>,
|
|
240
|
+
...args: Args
|
|
241
|
+
): void {
|
|
242
|
+
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
243
|
+
throw new Error(
|
|
244
|
+
'[Worklets] The function passed to `scheduleOnRuntimeWithId` is not a worklet.'
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
WorkletsModule.scheduleOnRuntimeWithId(
|
|
249
|
+
runtimeId,
|
|
250
|
+
createSerializable(() => {
|
|
251
|
+
'worklet';
|
|
252
|
+
worklet(...args);
|
|
253
|
+
globalThis.__callMicrotasks?.();
|
|
254
|
+
}),
|
|
255
|
+
SHOULD_CAPTURE_SCHEDULE_STACK ? new Error().stack : undefined
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (!isBundleModeEnabled()) {
|
|
260
|
+
function scheduleOnRuntimeWithIdWorklet<Args extends unknown[], ReturnValue>(
|
|
261
|
+
runtimeId: number,
|
|
262
|
+
worklet: WorkletFunction<Args, ReturnValue>,
|
|
263
|
+
...args: Args
|
|
264
|
+
): void {
|
|
265
|
+
'worklet';
|
|
266
|
+
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
267
|
+
throw new Error(
|
|
268
|
+
'[Worklets] The function passed to `scheduleOnRuntimeWithId` is not a worklet.'
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
globalThis.__workletsModuleProxy.scheduleOnRuntimeWithId(
|
|
273
|
+
runtimeId,
|
|
274
|
+
globalThis.__serializer(() => {
|
|
275
|
+
'worklet';
|
|
276
|
+
worklet(...args);
|
|
277
|
+
globalThis.__callMicrotasks?.();
|
|
278
|
+
})
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
serializableMappingCache.set(
|
|
283
|
+
scheduleOnRuntimeWithId,
|
|
284
|
+
createSerializable(scheduleOnRuntimeWithIdWorklet)
|
|
285
|
+
);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* @deprecated Use `scheduleOnRuntime` instead.
|
|
290
|
+
*
|
|
291
|
+
* Schedule a worklet to execute on the background queue.
|
|
292
|
+
*/
|
|
293
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
294
|
+
// before it's transformed by Worklets Babel plugin.
|
|
295
|
+
export function runOnRuntime<Args extends unknown[], ReturnValue>(
|
|
296
|
+
workletRuntime: WorkletRuntime,
|
|
297
|
+
worklet: (...args: Args) => ReturnValue
|
|
298
|
+
): WorkletFunction<Args, ReturnValue>;
|
|
299
|
+
|
|
300
|
+
export function runOnRuntime<Args extends unknown[], ReturnValue>(
|
|
301
|
+
workletRuntime: WorkletRuntime,
|
|
302
|
+
worklet: WorkletFunction<Args, ReturnValue>
|
|
303
|
+
): (...args: Args) => void {
|
|
304
|
+
'worklet';
|
|
305
|
+
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
306
|
+
throw new Error(
|
|
307
|
+
'[Worklets] The function passed to `runOnRuntime` is not a worklet.'
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
return (...args) => scheduleOnRuntime(workletRuntime, worklet, ...args);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
type WorkletRuntimeConfigInternal = WorkletRuntimeConfig & {
|
|
314
|
+
initializer?: WorkletFunction<[], void>;
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Lets you run a function synchronously on a [Worker
|
|
319
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime).
|
|
320
|
+
*
|
|
321
|
+
* - This function cannot be called from the [UI
|
|
322
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime).
|
|
323
|
+
* or another [Worker
|
|
324
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime),
|
|
325
|
+
* unless the [Bundle
|
|
326
|
+
* Mode](https://docs.swmansion.com/react-native-worklets/docs/bundleMode/) is
|
|
327
|
+
* enabled.
|
|
328
|
+
*
|
|
329
|
+
* @param workletRuntime - The runtime to run the worklet on.
|
|
330
|
+
* @param worklet - The worklet to run.
|
|
331
|
+
* @param args - The arguments to pass to the worklet.
|
|
332
|
+
* @returns The return value of the worklet.
|
|
333
|
+
*/
|
|
334
|
+
export function runOnRuntimeSync<Args extends unknown[], ReturnValue>(
|
|
335
|
+
workletRuntime: WorkletRuntime,
|
|
336
|
+
worklet: (...args: Args) => ReturnValue,
|
|
337
|
+
...args: Args
|
|
338
|
+
): ReturnValue {
|
|
339
|
+
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
340
|
+
throw new Error(
|
|
341
|
+
'[Worklets] The function passed to `runOnRuntimeSync` is not a worklet.'
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
return WorkletsModule.runOnRuntimeSync(
|
|
346
|
+
workletRuntime,
|
|
347
|
+
createSerializable(() => {
|
|
348
|
+
'worklet';
|
|
349
|
+
const result = worklet(...args);
|
|
350
|
+
return makeShareableCloneOnUIRecursive(result);
|
|
351
|
+
}),
|
|
352
|
+
SHOULD_CAPTURE_SCHEDULE_STACK ? new Error().stack : undefined
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Lets you run a function synchronously on a [Worklet
|
|
358
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worklet-runtime)
|
|
359
|
+
* identified by the runtime's id.
|
|
360
|
+
*
|
|
361
|
+
* - This function cannot be called from the [UI
|
|
362
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime)
|
|
363
|
+
* or a [Worker
|
|
364
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime),
|
|
365
|
+
* unless the [Bundle
|
|
366
|
+
* Mode](https://docs.swmansion.com/react-native-worklets/docs/bundleMode/) is
|
|
367
|
+
* enabled.
|
|
368
|
+
* - You can target the UI Runtime with this function by passing
|
|
369
|
+
* {@link UIRuntimeId} as the `runtimeId` argument.
|
|
370
|
+
*
|
|
371
|
+
* @param runtimeId - The id of the runtime to run the worklet on.
|
|
372
|
+
* @param worklet - The worklet to run.
|
|
373
|
+
* @param args - The arguments to pass to the worklet.
|
|
374
|
+
* @returns The return value of the worklet.
|
|
375
|
+
*/
|
|
376
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
377
|
+
// before it's transformed by Worklets Babel plugin.
|
|
378
|
+
export function runOnRuntimeSyncWithId<Args extends unknown[], ReturnValue>(
|
|
379
|
+
runtimeId: number,
|
|
380
|
+
worklet: (...args: Args) => ReturnValue,
|
|
381
|
+
...args: Args
|
|
382
|
+
): ReturnValue;
|
|
383
|
+
|
|
384
|
+
export function runOnRuntimeSyncWithId<Args extends unknown[], ReturnValue>(
|
|
385
|
+
runtimeId: number,
|
|
386
|
+
worklet: WorkletFunction<Args, ReturnValue>,
|
|
387
|
+
...args: Args
|
|
388
|
+
): ReturnValue {
|
|
389
|
+
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
390
|
+
throw new Error(
|
|
391
|
+
'[Worklets] The function passed to `runOnRuntimeSyncWithId` is not a worklet.'
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return WorkletsModule.runOnRuntimeSyncWithId(
|
|
396
|
+
runtimeId,
|
|
397
|
+
createSerializable(() => {
|
|
398
|
+
'worklet';
|
|
399
|
+
const result = worklet(...args);
|
|
400
|
+
return makeShareableCloneOnUIRecursive(result);
|
|
401
|
+
}),
|
|
402
|
+
SHOULD_CAPTURE_SCHEDULE_STACK ? new Error().stack : undefined
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* Lets you asynchronously run a
|
|
408
|
+
* [worklet](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worklet)
|
|
409
|
+
* on a [Worker
|
|
410
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime)
|
|
411
|
+
* and get the result via a Promise.
|
|
412
|
+
*
|
|
413
|
+
* - The worklet is scheduled on the Worker Runtime's Async Queue
|
|
414
|
+
* - Returns a Promise that resolves with the worklet's return value
|
|
415
|
+
*
|
|
416
|
+
* @param workletRuntime - The runtime to run the worklet on.
|
|
417
|
+
* @param worklet - The worklet to run.
|
|
418
|
+
* @param args - The arguments to pass to the worklet.
|
|
419
|
+
* @returns A Promise that resolves to the return value of the worklet.
|
|
420
|
+
* @see https://docs.swmansion.com/react-native-worklets/docs/threading/runOnRuntimeAsync
|
|
421
|
+
*/
|
|
422
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
423
|
+
// before it's transformed by Worklets Babel plugin.
|
|
424
|
+
export function runOnRuntimeAsync<Args extends unknown[], ReturnValue>(
|
|
425
|
+
workletRuntime: WorkletRuntime,
|
|
426
|
+
worklet: (...args: Args) => ReturnValue,
|
|
427
|
+
...args: Args
|
|
428
|
+
): Promise<ReturnValue>;
|
|
429
|
+
|
|
430
|
+
export function runOnRuntimeAsync<Args extends unknown[], ReturnValue>(
|
|
431
|
+
workletRuntime: WorkletRuntime,
|
|
432
|
+
worklet: WorkletFunction<Args, ReturnValue>,
|
|
433
|
+
...args: Args
|
|
434
|
+
): Promise<ReturnValue> {
|
|
435
|
+
if (__DEV__) {
|
|
436
|
+
if (!isWorkletFunction(worklet)) {
|
|
437
|
+
throw new Error(
|
|
438
|
+
'[Worklets] The function passed to `runOnRuntimeAsync` is not a worklet.'
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
return new Promise<ReturnValue>((resolve, reject) => {
|
|
444
|
+
if (__DEV__) {
|
|
445
|
+
createSerializable(worklet);
|
|
446
|
+
createSerializable(args);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const scheduleStack = SHOULD_CAPTURE_SCHEDULE_STACK
|
|
450
|
+
? new Error().stack
|
|
451
|
+
: undefined;
|
|
452
|
+
|
|
453
|
+
WorkletsModule.scheduleOnRuntime(
|
|
454
|
+
workletRuntime,
|
|
455
|
+
createSerializable(() => {
|
|
456
|
+
'worklet';
|
|
457
|
+
try {
|
|
458
|
+
const result = worklet(...args);
|
|
459
|
+
const serializedResult = globalThis.__serializer(
|
|
460
|
+
result
|
|
461
|
+
) as SerializableRef<ReturnValue>;
|
|
462
|
+
globalThis.__workletsModuleProxy.handlePromise(
|
|
463
|
+
resolve,
|
|
464
|
+
serializedResult
|
|
465
|
+
);
|
|
466
|
+
} catch (error) {
|
|
467
|
+
const serializedError = globalThis.__serializer(error);
|
|
468
|
+
globalThis.__workletsModuleProxy.handlePromise(
|
|
469
|
+
reject,
|
|
470
|
+
serializedError
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
globalThis.__callMicrotasks?.();
|
|
474
|
+
}),
|
|
475
|
+
scheduleStack
|
|
476
|
+
);
|
|
477
|
+
});
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Lets you asynchronously run a
|
|
482
|
+
* [worklet](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#worklet)
|
|
483
|
+
* on a [Worker
|
|
484
|
+
* Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#worker-runtime)
|
|
485
|
+
* identified by the runtime's id.
|
|
486
|
+
*
|
|
487
|
+
* Check
|
|
488
|
+
* {@link https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds}
|
|
489
|
+
* for more information about the different runtime kinds.
|
|
490
|
+
*
|
|
491
|
+
* - The worklet is scheduled on the Worker Runtime's [Async
|
|
492
|
+
* Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h)
|
|
493
|
+
*
|
|
494
|
+
* @param runtimeId - The id of the runtime to schedule the worklet on.
|
|
495
|
+
* @param worklet - The worklet to schedule.
|
|
496
|
+
* @param args - The arguments to pass to the worklet.
|
|
497
|
+
* @returns The return value of the worklet.
|
|
498
|
+
*/
|
|
499
|
+
// @ts-expect-error This overload is correct since it's what user sees in their code
|
|
500
|
+
// before it's transformed by Worklets Babel plugin.
|
|
501
|
+
export function runOnRuntimeAsyncWithId<Args extends unknown[], ReturnValue>(
|
|
502
|
+
runtimeId: number,
|
|
503
|
+
worklet: (...args: Args) => ReturnValue,
|
|
504
|
+
...args: Args
|
|
505
|
+
): Promise<ReturnValue>;
|
|
506
|
+
|
|
507
|
+
export function runOnRuntimeAsyncWithId<Args extends unknown[], ReturnValue>(
|
|
508
|
+
runtimeId: number,
|
|
509
|
+
worklet: WorkletFunction<Args, ReturnValue>,
|
|
510
|
+
...args: Args
|
|
511
|
+
): Promise<ReturnValue> {
|
|
512
|
+
if (__DEV__ && !isWorkletFunction(worklet)) {
|
|
513
|
+
throw new Error(
|
|
514
|
+
'[Worklets] The function passed to `runOnRuntimeAsyncWithId` is not a worklet.'
|
|
515
|
+
);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return new Promise<ReturnValue>((resolve, reject) => {
|
|
519
|
+
if (__DEV__) {
|
|
520
|
+
createSerializable(worklet);
|
|
521
|
+
createSerializable(args);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
const scheduleStack = SHOULD_CAPTURE_SCHEDULE_STACK
|
|
525
|
+
? new Error().stack
|
|
526
|
+
: undefined;
|
|
527
|
+
|
|
528
|
+
WorkletsModule.scheduleOnRuntimeWithId(
|
|
529
|
+
runtimeId,
|
|
530
|
+
createSerializable(() => {
|
|
531
|
+
'worklet';
|
|
532
|
+
try {
|
|
533
|
+
const result = worklet(...args);
|
|
534
|
+
const serializedResult = globalThis.__serializer(
|
|
535
|
+
result
|
|
536
|
+
) as SerializableRef<ReturnValue>;
|
|
537
|
+
globalThis.__workletsModuleProxy.handlePromise(
|
|
538
|
+
resolve,
|
|
539
|
+
serializedResult
|
|
540
|
+
);
|
|
541
|
+
} catch (error) {
|
|
542
|
+
const serializedError = globalThis.__serializer(error);
|
|
543
|
+
globalThis.__workletsModuleProxy.handlePromise(
|
|
544
|
+
reject,
|
|
545
|
+
serializedError
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
globalThis.__callMicrotasks?.();
|
|
549
|
+
}),
|
|
550
|
+
scheduleStack
|
|
551
|
+
);
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
if (__DEV__ && !isBundleModeEnabled()) {
|
|
556
|
+
/**
|
|
557
|
+
* QoL guards to give a meaningful error message when the user tries to call
|
|
558
|
+
* these functions on Worklet Runtimes outside of the Bundle Mode.
|
|
559
|
+
*/
|
|
560
|
+
addNoBundleModeGuardImplementation(runOnRuntimeAsync);
|
|
561
|
+
addNoBundleModeGuardImplementation(runOnRuntimeAsyncWithId);
|
|
562
|
+
addNoBundleModeGuardImplementation(runOnRuntimeSync);
|
|
563
|
+
addNoBundleModeGuardImplementation(runOnRuntimeSyncWithId);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
export function getUIRuntimeHolder(): object {
|
|
567
|
+
return WorkletsModule.getUIRuntimeHolder();
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
export function getUISchedulerHolder(): object {
|
|
571
|
+
return WorkletsModule.getUISchedulerHolder();
|
|
572
|
+
}
|