Skip to content

chore(🐎): move off worklets' deprecated runOnUI and runOnRuntime - #546

Merged
wcandillon merged 4 commits into
wcandillon:mainfrom
YevheniiKotyrlo:chore/worklets-schedule-api
Oct 16, 2026
Merged

wcandillon merged 4 commits into
wcandillon:mainfrom
YevheniiKotyrlo:chore/worklets-schedule-api

Conversation

@YevheniiKotyrlo

Copy link
Copy Markdown
Contributor

Problem

react-native-worklets deprecates runOnUI for scheduleOnUI and runOnRuntime for scheduleOnRuntime from 0.7.2, the lowest version this package's peerDependencies accept. The example's screens and helpers, the docs and two JSDoc comments still use the deprecated functions; the library itself calls neither.

Solution

runOnUI(fn)(...args) becomes scheduleOnUI(fn, ...args) and runOnRuntime(runtime, fn)(...args) becomes scheduleOnRuntime(runtime, fn, ...args) everywhere. The deprecated functions return a closure that makes exactly that call, so nothing behaves differently, and the examples keep running once worklets removes them. This is wcandillon/react-native-skia#4213 for this repo.

Verification

yarn lint · yarn tsc · yarn turbo run build --filter='./packages/*' · the Expo template's web build · yarn test:plugin · yarn check-dawn · yarn build:docs (twoslash type-checks the changed samples). CI's Android e2e step (debug build, Metro with CI=true) on a Galaxy S23 (Android 14): 43 suites and 215 tests passed, WorkletSerialization and ImplicitDeviceSync among them. On the same device, the Worklet requestAdapter diagnostic gets an adapter on the UI runtime, with and without installWebGPU(), and the Reanimated example's Dedicated Thread and Async Buffer (Dedicated) screens render on their worklet runtimes. Not run here: the iOS e2e job, which needs a simulator, and the semantic-release dry run, which needs the repository's token.

YevheniiKotyrlo and others added 3 commits October 15, 2026 03:31
react-native-worklets deprecates runOnUI for scheduleOnUI and runOnRuntime
for scheduleOnRuntime from 0.7.2, the lowest version the peer range accepts.
The example screens and helpers, the docs and two JSDoc comments use the
scheduling functions now. Both deprecated functions only forward to them, so
nothing changes today; once worklets drops them, the examples keep running.
@wcandillon
wcandillon self-requested a review October 16, 2026 12:02
@wcandillon
wcandillon merged commit 3c8a8e3 into wcandillon:main Oct 16, 2026
5 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.16.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants