-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture #14042
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
Merged
Conversation
This file contains hidden or 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
|
Once this is live, will it make the use of |
131fff1 to
21c2631
Compare
…ects for the new architecture
…p sheet to be loaded
4632cd4 to
b5ab461
Compare
Yajur-Grover
approved these changes
Nov 7, 2024
Contributor
Author
|
@microsoft-github-policy-service rerun |
jonthysell
added a commit
to jonthysell/react-native-windows
that referenced
this pull request
Nov 7, 2024
…ng projects for the new architecture THis PR backports microsoft#14042 to 0.76. ## Description This PR adds a `RnwNewArch` MSBuild property and `RNW_NEW_ARCH` build-time constant / pre-processor directive for use by external (module) devs. This PR also updates `@react-native-windows/codegen` to use the directive when appropriate, and also applies those changes to `sample-custom-component`. The expectation is that external devs now use these new properties and directives instead of the previously exposed `UseFabric`, `UseHermes` and/or `UseWinUI3` props. All logic expecting external developers to manually set those props has been removed and replaced with more robust checking that keys off `RnwNewArch` and throws warnings or errors if the other props aren't set correctly. In addition, this PR adds further checks to make sure external projects load the WindowsSDK props sheet, followed by the appropriate RNW props and then the RNW targets. Failure to load these import properly would always risk putting the project in a broken state, now we at least tell people what they're missing. Note: Old arch devs will still be able to toggle `UseHermes`. ### Type of Change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - This change requires a documentation update ### Why We don't want end-users to have access to conditionally build their code for the new or old architectures, without having to use/replicate the current complicated un-scoped directives we use internally. Closes microsoft#13929 ### What See above. ## Screenshots N/A ## Testing Verified the flag exists and builds for the sample-custom-component. Also verified that new projects build properly. ## Changelog Should this change be included in the release notes: _yes_ Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture
jonthysell
added a commit
that referenced
this pull request
Nov 7, 2024
…ng projects for the new architecture (#14096) * [0.76] Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture THis PR backports #14042 to 0.76. ## Description This PR adds a `RnwNewArch` MSBuild property and `RNW_NEW_ARCH` build-time constant / pre-processor directive for use by external (module) devs. This PR also updates `@react-native-windows/codegen` to use the directive when appropriate, and also applies those changes to `sample-custom-component`. The expectation is that external devs now use these new properties and directives instead of the previously exposed `UseFabric`, `UseHermes` and/or `UseWinUI3` props. All logic expecting external developers to manually set those props has been removed and replaced with more robust checking that keys off `RnwNewArch` and throws warnings or errors if the other props aren't set correctly. In addition, this PR adds further checks to make sure external projects load the WindowsSDK props sheet, followed by the appropriate RNW props and then the RNW targets. Failure to load these import properly would always risk putting the project in a broken state, now we at least tell people what they're missing. Note: Old arch devs will still be able to toggle `UseHermes`. ### Type of Change - Bug fix (non-breaking change which fixes an issue) - New feature (non-breaking change which adds functionality) - This change requires a documentation update ### Why We don't want end-users to have access to conditionally build their code for the new or old architectures, without having to use/replicate the current complicated un-scoped directives we use internally. Closes #13929 ### What See above. ## Screenshots N/A ## Testing Verified the flag exists and builds for the sample-custom-component. Also verified that new projects build properly. ## Changelog Should this change be included in the release notes: _yes_ Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Area: Library Template
New Architecture
Broad category for issues that apply to the RN "new" architecture of Turbo Modules + Fabric
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
This PR adds a
RnwNewArchMSBuild property andRNW_NEW_ARCHbuild-time constant / pre-processor directive for use by external (module) devs. This PR also updates@react-native-windows/codegento use the directive when appropriate, and also applies those changes tosample-custom-component.The expectation is that external devs now use these new properties and directives instead of the previously exposed
UseFabric,UseHermesand/orUseWinUI3props. All logic expecting external developers to manually set those props has been removed and replaced with more robust checking that keys offRnwNewArchand throws warnings or errors if the other props aren't set correctly.In addition, this PR adds further checks to make sure external projects load the WindowsSDK props sheet, followed by the appropriate RNW props and then the RNW targets. Failure to load these import properly would always risk putting the project in a broken state, now we at least tell people what they're missing.
Note: Old arch devs will still be able to toggle
UseHermes.Type of Change
Why
We don't want end-users to have access to conditionally build their code for the new or old architectures, without having to use/replicate the current complicated un-scoped directives we use internally.
Closes #13929
What
See above.
Screenshots
N/A
Testing
Verified the flag exists and builds for the sample-custom-component. Also verified that new projects build properly.
Changelog
Should this change be included in the release notes: yes
Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture
Microsoft Reviewers: Open in CodeFlow