Worklets 0.12.0

v0.​12.​0Minor Release
In this article

What's changed

Worklet Runtimes now support WeakRef. This required enabling Hermes' own microtask queue when the runtime is created, and draining it from C++.

Bundle Mode used to load the script through in-memory copies. On iOS the whole bundle stayed resident in a std::string for the app's lifetime, and on Android a dev-server bundle passed through a Java String and two more copies over JNI. Local bundles are now mmapped and Android dev-server downloads stream to a cache file, the same way React Native's own loaders work. Dev-server fetches now also check the HTTP status and surface the error message Metro returns. In development on Android, initialization reuses the bundle React Native has already downloaded.

createWorkletRuntime accepts a new enableLocking option, which creates a Worklet Runtime without mutex guards. It is meant for advanced use cases, where you can guarantee thread-safety of the runtime.

The release also fixes a race condition when two runtimes initialized a RetainingSerializable at the same time, the UI loop continuing to run while the app is backgrounded, a missing autorelease drain on detached worklet threads, missing APIs in the Jest mocks, and the web scheduleOnUI implementation on errors.

Full changelog: worklets-0.11.3...worklets-0.12.0

Release card
Worklets 0.12.0 release card