Skip to content

Implement callFunctionOnModule on BridgelessCatalystInstance#56804

Open
javache wants to merge 1 commit into
facebook:mainfrom
javache:export-D104901132
Open

Implement callFunctionOnModule on BridgelessCatalystInstance#56804
javache wants to merge 1 commit into
facebook:mainfrom
javache:export-D104901132

Conversation

@javache
Copy link
Copy Markdown
Member

@javache javache commented May 12, 2026

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

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
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 12, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented May 12, 2026

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D104901132.

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant