docs: compare UI runtime scheduling functions and fix stale call tables#9895
Open
0xyy wants to merge 1 commit into
Open
docs: compare UI runtime scheduling functions and fix stale call tables#98950xyy wants to merge 1 commit into
0xyy wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-runtimecomparesscheduleOnUI,runOnUIAsyncandrunOnUISyncacross 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,runOnRuntimeAsyncandrunOnRuntimeAsyncWithIdlisted the UI and Worker runtimes as unsupported in Bundle Mode. All three receive the sameaddNoBundleModeGuardImplementationguard as their*SyncandscheduleOn*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 buildpasses; broken link and anchor checks are configured tothrow. The new guide, the Threading section link and the corrected Call tables were also verified locally withyarn workspace docs-worklets start.