Skip to content
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

TurboModule spec checking should accept hstring for string arguments #14322

Merged
merged 3 commits into from
Jan 31, 2025

Conversation

acoates-ms
Copy link
Contributor

@acoates-ms acoates-ms commented Jan 30, 2025

Description

If you have a turbo module spec that defines a method as taking a string parameter, then you should be able to use an hstring on the native side.

Currently the module works correctly when using an hstring, but if you use the codegen'd spec to validate that the native TurboModule correctly implements the methods from JS, the build will fail because it does not correctly identify hstring as being a valid argument type for a JS string.

As an example the built in Clipboard module is currently using std::wstring. Changing it to hstring without this change will cause the build to fail.

Microsoft Reviewers: Open in CodeFlow

@acoates-ms acoates-ms requested a review from a team as a code owner January 30, 2025 19:31
Copy link
Contributor

@TatianaKapos TatianaKapos left a comment

Choose a reason for hiding this comment

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

LGTM!

@acoates-ms acoates-ms merged commit 4315cad into microsoft:main Jan 31, 2025
63 checks passed
@acoates-ms acoates-ms deleted the hstringspec branch January 31, 2025 23:29
acoates-ms added a commit to acoates-ms/react-native-windows that referenced this pull request Jan 31, 2025
…icrosoft#14322)

* TurboModule spec checking should accept hstring for string arguments

* Change files

* example
acoates-ms added a commit that referenced this pull request Feb 1, 2025
* [Fabric] Fix PlatformColor (#14325)

* Fix platform color

* Change files

* Add missing theme colors

* snapshots

* TurboModule spec checking should accept hstring for string arguments (#14322)

* TurboModule spec checking should accept hstring for string arguments

* Change files

* example

* change files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants