Implement callFunctionOnModule on BridgelessCatalystInstance#56804
Open
javache wants to merge 1 commit into
Open
Implement callFunctionOnModule on BridgelessCatalystInstance#56804javache wants to merge 1 commit into
javache wants to merge 1 commit into
Conversation
Summary: Implement `BridgelessCatalystInstance.callFunction` using the existing `ReactHostImpl.callFunctionOnModule` so callers that go through `CatalystInstance` (rather than directly through `JavaScriptModule` proxies) work in bridgeless mode. While here, propagate nullability of `args` through the call chain. `InvocationHandler.invoke` is documented to pass `null` when the proxied method has no parameters, and the existing `Arguments.fromJavaArgs(args)` would NPE in that case. The JNI layer substitutes an empty `folly::dynamic::array()` when `args` is null, so the JS call still has a well-formed argument list. Changelog: [Android][Fixed] JSModule method without args are correctly dispatched Differential Revision: D104901132
|
@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104901132. |
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:
Implement
BridgelessCatalystInstance.callFunctionusing the existingReactHostImpl.callFunctionOnModuleso callers that go throughCatalystInstance(rather than directly throughJavaScriptModuleproxies) work in bridgeless mode.While here, propagate nullability of
argsthrough the call chain.InvocationHandler.invokeis documented to passnullwhen the proxied method has no parameters, and the existingArguments.fromJavaArgs(args)would NPE in that case. The JNI layer substitutes an emptyfolly::dynamic::array()whenargsis null, so the JS call still has a well-formed argument list.Changelog: [Android][Fixed] JSModule method without args are correctly dispatched
Differential Revision: D104901132