Repository navigation
Worklets - 0.14.0
Immutable
release. Only release title and notes can be modified.
Key changes
- Networking:
WebSocketis now available on Worklet Runtimes. - Runtime lifecycle: Worker Runtimes can be stopped with
abortWorkletRuntimeand the newabortableruntime option. - Cross-runtime execution:
runOnRNSynccan synchronously call the React Native Runtime, including from UI and Worker Runtimes in Bundle Mode; development builds can also attach cross-runtime stack traces. - Serialization: New typed
createSerializablevariants and explicit serializable-mapping APIs provide tighter control over values shared between runtimes. - Bundle Mode: Added lazy Metro chunk imports, Metro 0.87 patches, safer import forwarding, and improved development-bundle handling.
- Runtime correctness and performance: Frames are requested on demand, synchronous-call microtasks drain at the outermost boundary, and runtime identity fixes prevent stale-runtime crashes and use-after-free errors.
- Compatibility: Worklets 0.14 supports React Native 0.87–0.89 and pairs with Reanimated 4.8.x.
Changelog
🎉 New features
- Warn when an
importForwarding.relativePathsentry has only common folder names such assrc, and add thesilenceDangerousPathsWarningplugin option to turn the warning off. (#11415 by @tjzel) - Add
WebSocketon Worklet Runtimes. (#11157 by @tjzel) - Add
abortWorkletRuntimeand theabortableruntime option to stop a Worker Runtime, dropping its pending work and rejecting the matching promises. (#11063 by @tshmieldev) - Add cross-runtime stack traces in development builds, when
ENABLE_CROSS_RUNTIME_STACK_TRACESis enabled, to errors thrown by functions run withscheduleOnRNandrunOnRNSync. (#10798 by @tshmieldev) - Add typed
createSerializablevariants, for examplecreateSerializableArrayandcreateSerializableMap, that accept only one type of value. (#10770 by @tshmieldev) - Add
runOnRNSyncto run a function synchronously on the RN Runtime, including from UI and Worker Runtimes when Bundle Mode is enabled. (#10767 by @tshmieldev) - Add
setSerializableMapping,getSerializableMapping,hasSerializableMappingandremoveSerializableMappingto control the value that other runtimes receive in place of an object, and deprecateserializableMappingCache. (#10758 by @tshmieldev) - Support
import()of lazy Metro chunks on Worklet Runtimes in Bundle Mode. (#10711 by @tjzel) - Add the Bundle Mode patches for
metroandmetro-runtime0.87.0. (#10455 by @jslok) - Read the iOS dev bundle in Bundle Mode from the file that React Native 0.88 and newer persists, instead of downloading it again. (#10181 by @tjzel)
🐛 Bug fixes
- Run the remaining frame finalizers in the next frame when one of them throws. (#11431 by @tjzel)
- Report an error thrown by a microtask at the checkpoint of a scheduled worklet the same way as an error thrown by the worklet, instead of crashing the app in debug builds. (#11421 by @tjzel)
- Run the microtasks queued by a synchronous call into a Worklet Runtime (
runOnUISync,runOnRuntimeSync, and the calls Reanimated makes for events) when the outermost call into that runtime returns, instead of leaving them for a later task. (#11410 by @tjzel) - Make
importForwarding.moduleNamesmatch only exact module names, somy-libraryno longer forwards imports frommy-library/utilsunless that subpath is also in the list. (#11402 by @tjzel) - Fix the UI runtime frame loop running on every vsync on Android when React starts without an Activity and no headless JS task is active. (#11400 by @tjzel)
- Fix the iOS, tvOS and macOS builds failing on Xcode 27 because of the deployment target of the privacy manifest bundle. (#11374 by @tjzel)
- Request UI Runtime animation frames only when callbacks or finalizers are pending instead of on every frame. (#11372 by @tjzel)
- Autoworkletize the inline
withCallback,customandprogressAnimationfunctions ofSharedTransitionbuilder chains, and layout animation callbacks afterreduceMotion,dampingRatioorwithTargetValues, in the Babel and Oxc plugins. (#11283 by @pawicao) - Stop the Android dev bundle download in Bundle Mode from blocking forever when the development server stops sending data. (#11167 by @tjzel)
- Fix
performance.now()on Worklet Runtimes on iOS to use the same clock as the React Native Runtime. (#11156 by @tjzel) - Fix a Shareable treating a new Worker Runtime as its host when the new runtime reuses the memory address of the destroyed host runtime. (#11140 by @tjzel)
- Autoworkletize worklet callbacks of
runOnRuntimeAsyncWithId,createWorkletRuntime,createShareable,registerCustomSerializable, thewithTimingeasingoption anduseHandlerin the Babel and Oxc plugins. (#11083 by @tjzel) - Fix crashes and use-after-free errors when a Worklet Runtime is created at the memory address of a destroyed one: Worklets now identify runtimes by their React Native instance and runtime id instead of their address, so values cached for a destroyed runtime, Remote Functions hosted on it and Networking callbacks are never read or released through another runtime. (#11073 by @tjzel)
- Rebase relative
require()calls inside worklet bodies in Bundle Mode also in files that are not inimportForwarding.relativePaths. (#10935 by @tjzel) - Fix a worklet that assigns to a captured variable failing with
invalid assignment left-hand sideon Hermes when Bundle Mode is disabled. (#10889 by @tshmieldev) - Bundle Mode works with Metro
inlineRequiresdisabled, andgetBundleModeMetroConfigno longer forces it. (#10862 by @tjzel) - Keep the library prefix in the names the Oxc plugin gives worklets under
node_moduleswhen the path uses Windows separators. (#10856 by @YevheniiKotyrlo) - Fix a memory leak in which a worklet and a JS function it calls kept each other alive, with everything they captured, when the closure of the function reached the worklet (for example a
runOnJScallback in a scroll or gesture handler). (#10854 by @knappam) - Fix the Jest resolver resolving web implementations for every module of packages that peer-depend on Worklets, such as Reanimated, when installed with pnpm. (#10821 by @ryanlntn)
- Fix a crash in release builds when the initializer passed to
createWorkletRuntimethrows. (#10774 by @tshmieldev) - Fix RegExp, Error and typed array Serializables being serialized again when passed to
createSerializable. (#10771 by @tshmieldev) - Stop a Worklets
XMLHttpRequestthat was aborted or reopened aftersendto a non-HTTP URL from later firing a staleerrorand failing the next request. (#10731 by @ahmdshrif) - Point the Worklets plugin option docs links to the renamed
worklets-plugindocs pages. (#10709 by @tshmieldev) - Fall back to a timer in web
scheduleOnUIandrunOnUIAsyncwhenrequestAnimationFrameis unavailable, such as during server-side rendering in Node.js. (#10667 by @robhogan) - Initialize
__DEV__in JavaScript and remove the native development flag plumbing. (#10632 by @tshmieldev) - Accept Groovy
GStringvalues forndkVersionandndkPathfrom the root Gradle project instead of ignoring them. (#10544 by @piaskowyk) - Stop the Babel plugin reading every worklet's sources off disk to fill
sourcesContent, a field it deletes again before returning the map, so a source that is not on disk no longer aborts the whole transform. (#10510 by @YevheniiKotyrlo)
💡 Others
- Remove the
__flushAnimationFramecompatibility entry that Reanimated 4.3 used. (#11419 by @tjzel) - Document that
importForwarding.relativePathsalso matches folders inside packages innode_modules. (#11403 by @tjzel) - Added support for React Native 0.89 and dropped support for React Native 0.86. (#11298 by @pawicao)
- Add a privacy manifest that declares the system boot time API for the clock of
performance.now()on Apple. (#11206 by @tjzel) - Check in Debug builds that the runtime ids which JS passes to native Worklets methods are valid integers. (#11170 by @tjzel)
- Replaced the test-only
getAliveRuntimeCount()binding withisRuntimeAlive(runtimeId), which checks if one Worklet Runtime is destroyed. (#11163 by @tjzel) - Fix the
bundleModedocumentation link in the Babel plugin option types. (#11155 by @tjzel) - Fold the duplicated Debug and Release versions of the native
runOnUISyncandrunOnRuntimeSynchelpers. (#11119 by @tshmieldev) - Mark
AsyncQueueImplasfinal. (#11118 by @tshmieldev) - Only the outermost task on a Worklet Runtime decides whether to drain microtasks, so a task nested inside a running worklet no longer drains the microtask queue in the middle of the calling JS. (#11103 by @tshmieldev)
- Add runtime-test-only bindings that keep Serializables alive across a React Native reload. (#11085 by @tjzel)
- Renamed the
RuntimeManagerregistration step toonRuntimeReadyand asserted that it runs afteronRuntimeCreated. (#11077 by @tjzel) - Merged the two
SerializableRemoteFunctionconstructors into one that asserts aJSScheduleris given only for Remote Functions hosted on the RN Runtime. (#11075 by @tjzel) - Removed
WorkletRuntimeRegistry,WorkletRuntimeCollectorand the__workletRuntimeCollectorglobal, whichRuntimeIdentityreplaced. (#11074 by @tjzel) - Added a
RuntimeIdentitythat identifies every runtime by its owner and runtime id, and tracked alive Worklet Runtimes inRuntimeManager, without any reader yet. (#11072 by @tjzel) - Let ccache share the Android C++ compile results that use the precompiled header between checkouts at different paths. (#11047 by @bartlomiejbloniarz)
- Fixed a typo in the
unpackJSDoc ofregisterCustomSerializable. (#10990 by @tjzel) - Pointed the
runOnRNSyncdocumentation link to the unreleased docs until the page is released. (#10970 by @tjzel) - Bump the React Native dev dependencies to 0.88.0. (#10952 by @pawicao)
- Configure the Android library with
LibraryExtensioninstead of the deprecatedandroid {}Gradle DSL. (#10865 by @tjzel) - Fail the example app build on use of deprecated APIs in native code. (#10864 by @tjzel)
- Bump the dev dependency on React Native to 0.88.0-rc.4. (#10846 by @pawicao)
- Write Oxc instead of OXC in the Oxc plugin messages and docs. (#10766 by @tshmieldev)
- Bump the dev dependency on React Native to 0.88.0-rc.3. (#10738 by @pawicao)
- Bump the dev dependency on React Native to 0.88.0-rc.2 and add Bundle Mode patches for Metro 0.87.1. (#10650 by @pawicao)
- Replace ESLint with oxlint for JavaScript and TypeScript linting. (#10584 by @tshmieldev)
Full comparison: worklets-0.13.1...worklets-0.14.0