Skip to content

Conversation

@tjzel
Copy link
Collaborator

@tjzel tjzel commented Nov 26, 2024

Summary

This pull requests moves JSScheduler, a class responsible for scheduling operations back to the JavaScript thread, to Worklets.

  • JSScheduler is now available from WorkletsModuleProxy in cpp and that's how ReanimatedModuleProxy obtains it when it needs it. More sophisticated APIs will be made in the future.
  • Both ReanimatedModule and WorkletsModule are now responsible to forward jsCallInvoker to their own Proxy modules. jsCallInvoker is no longer available in JSScheduler.

Test plan

CI

@tjzel tjzel force-pushed the @tjzel/worklets/move-js-scheduler branch from a24c83c to e7eb4a2 Compare December 3, 2024 15:59
@tjzel tjzel added the Check compatibility Trigger a time-consuming compatibility check action label Dec 3, 2024
@tjzel tjzel changed the base branch from main to @tjzel/restore-jscallinvoker December 3, 2024 16:03
@tjzel tjzel marked this pull request as ready for review December 4, 2024 15:17
Copy link
Member

@piaskowyk piaskowyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the additional explanation that every turbo module has its own reference to the JS call invoker, and that this change is to leverage their own reference instead of cross-passing, this change makes sense to me. However, before we proceed with the merge, let's consider Tomek's comments.

Base automatically changed from @tjzel/restore-jscallinvoker to main December 9, 2024 09:51
@tjzel tjzel added this pull request to the merge queue Dec 9, 2024
Merged via the queue into main with commit 2a947a8 Dec 9, 2024
39 of 40 checks passed
@tjzel tjzel deleted the @tjzel/worklets/move-js-scheduler branch December 9, 2024 10:35
tjzel added a commit that referenced this pull request Dec 13, 2024
## Summary

This pull requests moves `JSScheduler`, a class responsible for
scheduling operations back to the JavaScript thread, to Worklets.

- `JSScheduler` is now available from `WorkletsModuleProxy` in cpp and
that's how `ReanimatedModuleProxy` obtains it when it needs it. More
sophisticated APIs will be made in the future.
- Both `ReanimatedModule` and `WorkletsModule` are now responsible to
forward `jsCallInvoker` to their own Proxy modules. `jsCallInvoker` is
no longer available in `JSScheduler`.

## Test plan

CI
tjzel added a commit that referenced this pull request Dec 13, 2024
## Summary

This pull requests moves `JSScheduler`, a class responsible for
scheduling operations back to the JavaScript thread, to Worklets.

- `JSScheduler` is now available from `WorkletsModuleProxy` in cpp and
that's how `ReanimatedModuleProxy` obtains it when it needs it. More
sophisticated APIs will be made in the future.
- Both `ReanimatedModule` and `WorkletsModule` are now responsible to
forward `jsCallInvoker` to their own Proxy modules. `jsCallInvoker` is
no longer available in `JSScheduler`.

## Test plan

CI
tjzel added a commit that referenced this pull request Dec 13, 2024
## Summary

This pull requests moves `JSScheduler`, a class responsible for
scheduling operations back to the JavaScript thread, to Worklets.

- `JSScheduler` is now available from `WorkletsModuleProxy` in cpp and
that's how `ReanimatedModuleProxy` obtains it when it needs it. More
sophisticated APIs will be made in the future.
- Both `ReanimatedModule` and `WorkletsModule` are now responsible to
forward `jsCallInvoker` to their own Proxy modules. `jsCallInvoker` is
no longer available in `JSScheduler`.

## Test plan

CI
r0h0gg6 pushed a commit to r0h0gg6/react-native-reanimated that referenced this pull request Jul 28, 2025
## Summary

This pull requests moves `JSScheduler`, a class responsible for
scheduling operations back to the JavaScript thread, to Worklets.

- `JSScheduler` is now available from `WorkletsModuleProxy` in cpp and
that's how `ReanimatedModuleProxy` obtains it when it needs it. More
sophisticated APIs will be made in the future.
- Both `ReanimatedModule` and `WorkletsModule` are now responsible to
forward `jsCallInvoker` to their own Proxy modules. `jsCallInvoker` is
no longer available in `JSScheduler`.

## Test plan

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

Labels

Check compatibility Trigger a time-consuming compatibility check action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants