Skip to content

Conversation

@tjzel
Copy link
Collaborator

@tjzel tjzel commented Oct 22, 2025

Summary

Adding a handy APIs of obtaining a (weak) pointer to the Worklet Runtime from its underlying jsi::Runtime.

It uses setRuntimeData and getRuntimeData that allows to map an arbitrary shared_ptr to a given jsi::Runtime. With a handy static getter function we can obtain the Worklet Runtime and access its event loop and its methods without going through Worklets module etc.

getRuntimeData, setRuntimeData and jsi::UUID are available from RN 0.81.

Test plan

Tested in

Base automatically changed from @tjzel/worklets/remove-string-runtime-association to main October 24, 2025 09:14
@tjzel tjzel requested a review from piaskowyk October 24, 2025 16:52
@tjzel tjzel marked this pull request as ready for review October 24, 2025 17:02
@tjzel tjzel added this pull request to the merge queue Oct 31, 2025
Merged via the queue into main with commit 5bced2e Oct 31, 2025
18 checks passed
@tjzel tjzel deleted the @tjzel/worklets/runtime-from-uuid branch October 31, 2025 16:14
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.

3 participants