-
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
@rnw/codegen generates GetStructInfo instead of REACT_STRUCT #11982
Merged
Conversation
This file contains 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
Contributor
vmoroz
approved these changes
Aug 4, 2023
ZihanChen-MSFT
added a commit
to ZihanChen-MSFT/react-native-windows
that referenced
this pull request
Aug 15, 2023
…ft#11982) * #include <NativeModules.h> * Separate custom types and reflection in template * Generate GetStructInfo function instead of REACT_STRUCT * ... * Update generated files * Change files * ...
ZihanChen-MSFT
added a commit
to ZihanChen-MSFT/react-native-windows
that referenced
this pull request
Aug 15, 2023
…ft#11982) * #include <NativeModules.h> * Separate custom types and reflection in template * Generate GetStructInfo function instead of REACT_STRUCT * ... * Update generated files * Change files * ...
This was referenced Aug 15, 2023
ZihanChen-MSFT
added a commit
that referenced
this pull request
Aug 15, 2023
* @rnw/codegen generates GetStructInfo instead of REACT_STRUCT (#11982) * #include <NativeModules.h> * Separate custom types and reflection in template * Generate GetStructInfo function instead of REACT_STRUCT * ... * Update generated files * Change files * ... * Generate types and spec in two files for turbo module (#11990) * Add `allInOne` to `createNM2Generator` * Add `allInOne` to @rnw/cli and @rnw/codegen * ... * ... * ... * Update sample-apps * Change files * Fix code review comment * Remove `allInOne` option and make it always happen * Update generated files * Update #include * Fix build break * Suppress clang-format on some include order * ... * Change files * Update packages.lock.json
ZihanChen-MSFT
added a commit
that referenced
this pull request
Aug 15, 2023
* @rnw/codegen generates GetStructInfo instead of REACT_STRUCT (#11982) * #include <NativeModules.h> * Separate custom types and reflection in template * Generate GetStructInfo function instead of REACT_STRUCT * ... * Update generated files * Change files * ... * Generate types and spec in two files for turbo module (#11990) * Add `allInOne` to `createNM2Generator` * Add `allInOne` to @rnw/cli and @rnw/codegen * ... * ... * ... * Update sample-apps * Change files * Fix code review comment * Remove `allInOne` option and make it always happen * Update generated files * Update #include * Fix build break * Suppress clang-format on some include order * ... * Change files * Update packages.lock.json
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.
Description
Type of Change
Why
Sometimes we need generated types be part of the public API (already the case in devmain). In order to achieve that, we need to keep our generated types clean, which means they can't depend on
NativeModules.h
.In my next pull request, I will add a new option to
@rnw/cli
to generate types and reflection+spec in different files. People can than use the types header as part of their API, keeping the reflection+spec in their cpp files where C++ turbo module implementations are in.What
GetStructInfo
functions are generated for each custom types instead ofREACT_STRUCT
.Changelog
Should this change be included in the release notes: indicate yes or no
Add a brief summary of the change to use in the release notes for the next release.
Microsoft Reviewers: codeflow:open?pullrequest=https://github.com/microsoft/react-native-windows/pull/11982&drop=dogfoodAlpha