Skip to content

Enforce void return type for void return type in JS C++ TM spec - #53214

Closed
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D79980538
Closed

Enforce void return type for void return type in JS C++ TM spec#53214
christophpurrer wants to merge 1 commit into
react:mainfrom
christophpurrer:export-D79980538

Conversation

@christophpurrer

Copy link
Copy Markdown
Contributor

Summary:
Changelog: [Fixed] [General] Enforce void return type for void return type in JS C++ TM spec

Example if you have this spec

export interface Spec extends TurboModule {
  +foo: (bar: string) => void;
}

We must enforce in C++ that the return type is void as e.g.

  void foo(jsi::Runtime& rt, const std::string& bar);

Right now you can return any type in C++ such as std::string which does not make sense

Differential Revision: D79980538

@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 Aug 11, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D79980538

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D79980538

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D79980538

@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D79980538

…t#53214)

Summary:
Pull Request resolved: react#53214

Changelog: [Fixed] [General] Enforce void return type for void return type in JS C++ TM spec

Example if you have this spec
```
export interface Spec extends TurboModule {
  +foo: (bar: string) => void;
}
```
We must enforce in C++ that the return type is `void` as e.g.
```
  void foo(jsi::Runtime& rt, const std::string& bar);
```
Right now you can return any type in C++ such as `std::string` which does not make sense

Differential Revision: D79980538
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request was exported from Phabricator. Differential Revision: D79980538

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Aug 13, 2025
@facebook-github-bot

Copy link
Copy Markdown
Contributor

This pull request has been merged in 9f0d24b.

@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @christophpurrer in 9f0d24b

When will my fix make it into a release? | How to file a pick request?

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 Merged This PR has been merged. p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants