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

@rnw/codegen generates GetStructInfo instead of REACT_STRUCT #11982

Merged
merged 8 commits into from
Aug 7, 2023

Conversation

ZihanChen-MSFT
Copy link
Contributor

@ZihanChen-MSFT ZihanChen-MSFT commented Aug 4, 2023

Description

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

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 of REACT_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

@ZihanChen-MSFT ZihanChen-MSFT requested a review from a team as a code owner August 4, 2023 16:06
@ZihanChen-MSFT ZihanChen-MSFT assigned vmoroz and unassigned vmoroz Aug 4, 2023
@ZihanChen-MSFT ZihanChen-MSFT enabled auto-merge (squash) August 7, 2023 19:18
@ZihanChen-MSFT ZihanChen-MSFT merged commit a5eb34c into microsoft:main Aug 7, 2023
42 checks passed
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

* ...
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
@ZihanChen-MSFT ZihanChen-MSFT deleted the rm-nomacro branch August 16, 2023 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants