-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
chore(Worklets): patches for experimental bundling #7585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tjzel
merged 111 commits into
main
from
@tjzel/worklets/patches-for-experimental-bundling
Jun 6, 2025
Merged
chore(Worklets): patches for experimental bundling #7585
tjzel
merged 111 commits into
main
from
@tjzel/worklets/patches-for-experimental-bundling
Jun 6, 2025
Conversation
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
refactor(Worklets): jsiWorkletsModuleProxy + ios feat(Worklets): runOnUIAsync (#7469) This PR adds a `runOnUIAsync` function. A function that schedules a worklet on the UI Runtime, to be executed on the UI thread. It returns a Promise of the worklet's return value. The Promise is resolved asynchronously, not immediately after the callback execution. Example usage : ```js import { runOnUIAsync } from 'react-native-worklets'; // RN Runtime, JS thread const result: Promise<number> = runOnUIAsync((): number => { return 42; }); await result; // 42 ``` `runOnUIAsync` example : <video src="https://github.com/user-attachments/assets/8c72548d-6d41-43d6-809c-3f27f13d664f" /> fix: ensure last[propName] is defined in style updater (#7485) <!-- Thanks for submitting a pull request! We appreciate you spending the time to work on these changes. Please follow the template so that the reviewers can easily understand what the code changes affect. --> Ensure that `last[propName]` is initialised to fix an exception on web. This bug was introduced by changes in #6749. I noticed this issue after upgrading to the latest version of react-native-reanimated. In my case, the library was trying to index `last['transform']` which didn't exist for whatever reason. <img width="573" alt="Screenshot 2025-05-08 at 16 23 04" src="https://github.com/user-attachments/assets/1262b09a-600d-4ffb-8aa2-a02d8bc9e97e" /> <img width="676" alt="Screenshot 2025-05-08 at 16 24 29" src="https://github.com/user-attachments/assets/d17ccde5-744f-4e57-b6cd-4100a88acdae" /> feat(CI): monorepo static checks (#7484) QoL CI since now we keep some scripts etc. in the root. I also fixed problems found by `yarn lint` and `yarn format` and added necessary configs. 🪨 refactor(Worklets)(makeShareableClone): add makeShareableString (#7481) The first in a series of PRs that are intended to refactor the logic of the `makeShareableClone` function. The current implementation does not have a single source of truth, as we have two type checking logics for the passed value, one on the `JS` side and one on the `Cpp` side. The idea of the refactor is to implement one source of truth on the `JS` side and call the corresponding method on the `Cpp` side e.g: ```js if (typeof value === ‘string’) { return global._makeShareableString(value); } ``` In addition, in this PR I have rewritten the `Shareables` example to make it more readable and easier to use. `Shareables` example <video src="https://github.com/user-attachments/assets/5d61009d-e31b-44fc-b4fd-c21a8c417612" /> chore: fix linting
…lets/inject-worklets-module-proxy
…el/worklets/shareable-import
…generate-worklets
…l/worklets/experimental-bundling-abis
…l/worklets/experimental-bundling-abis
…l/worklets/experimental-bundling-abis
…l/worklets/experimental-bundling-abis
…/worklets/locals-and-globals
…s/workletizable-modules
…/worklets/locals-and-globals
…s/workletizable-modules
…lets/patches-for-experimental-bundling
…lets/patches-for-experimental-bundling
piaskowyk
approved these changes
Jun 6, 2025
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
To execute the bundle on Worklet Runtimes we need to somehow access it. Unfortunately, currently there are no APIs for that and we need to patch React Native to expose them.
Once we settle for a good API both internally and externally I will upstream these changes to facebook/react-native#50788 (review)
Test plan
Fabric example works on: