-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Pass RuntimeSchedulerCallInvoker to C++ TurboModule initialization #12826
base: main
Are you sure you want to change the base?
Conversation
Rather than creating a CallInvoker that posts to the JSDispatcher, this passes the same CallInvoker used for core TurboModules to 3rd party TurboModules and dispatches actions using the RuntimeScheduler if enabled.
This breaks our ABI. CallInvoker by itself is not ABI safe. The implementation internal to the MS.RN.dll accesses all kinds of non-abi methods. The implementation used in TurboModules is provided outside the DLL and is a separate implementation which only calls ABI safe methods that are exported from the dll. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this breaks the ABI, I doubt we can take this change.
@acoates-ms Out of curiosity, what is your plan for passing the runtime to C++ TurboModules? I expect core React Native modules to start using this runtime argument in CallInvoker to invoke I suppose you'll have to put the JsiRuntimeHolder somewhere accessible to the TurboModuleProvider, and pull the runtime off the JsiRuntimeHolder. For non-ABI JSI use cases like we have in our apps at Meta, perhaps we could fallback on the RuntimeSchedulerCallInvoker (if the JsiRuntimeHolder is null or whatever)? |
@acoates-ms Any update on this? Can we just close it? |
Description
Type of Change
Erase all that don't apply.
Why
Rather than creating a CallInvoker that posts to the JSDispatcher, this passes the same CallInvoker used for core TurboModules to 3rd party TurboModules and dispatches actions using the RuntimeScheduler if enabled.
Changelog
Should this change be included in the release notes: no
Microsoft Reviewers: Open in CodeFlow