Skip to content

docs: compare UI runtime scheduling functions and fix stale call tables#9895

Open
0xyy wants to merge 1 commit into
software-mansion:mainfrom
0xyy:docs/ui-runtime-scheduling-comparison
Open

docs: compare UI runtime scheduling functions and fix stale call tables#9895
0xyy wants to merge 1 commit into
software-mansion:mainfrom
0xyy:docs/ui-runtime-scheduling-comparison

Conversation

@0xyy

@0xyy 0xyy commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a guide comparing the three functions for running a worklet on the UI runtime, and fixes stale Call tables found while writing it.

New guide. guides/running-on-the-ui-runtime compares scheduleOnUI, runOnUIAsync and runOnUISync across execution (asynchronous vs synchronous), return value, web support and when to use each. It is linked from the Threading section index and cross-linked from the three reference pages.

Call table fixes. runOnUIAsync, runOnRuntimeAsync and runOnRuntimeAsyncWithId listed the UI and Worker runtimes as unsupported in Bundle Mode. All three receive the same addNoBundleModeGuardImplementation guard as their *Sync and scheduleOn* siblings (threads.native.ts, runtimes.native.ts), and that guard only blocks calls from Worklet Runtimes when Bundle Mode is disabled. In Bundle Mode they are callable from every runtime, so the tables now match their siblings.

Test plan

yarn workspace docs-worklets docusaurus build passes; broken link and anchor checks are configured to throw. The new guide, the Threading section link and the corrected Call tables were also verified locally with yarn workspace docs-worklets start.

Add a Worklets guide comparing scheduleOnUI, runOnUIAsync and runOnUISync
(execution, return value, web support, when to use), linked from the
Threading section and the three reference pages.

Fix the Bundle Mode call tables for runOnUIAsync, runOnRuntimeAsync and
runOnRuntimeAsyncWithId. All three receive the same
addNoBundleModeGuardImplementation guard as their sync and scheduleOn
siblings, which only blocks calls from Worklet Runtimes when Bundle Mode
is disabled. The tables incorrectly listed the UI and Worker runtimes as
unsupported in Bundle Mode.
@tomekzaw tomekzaw requested a review from tjzel July 7, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant