-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[0.76] Add RnwNewArch property and RNW_NEW_ARCH constants when buildi…
…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
- Loading branch information
1 parent
2bb47d5
commit 28e050f
Showing
72 changed files
with
654 additions
and
184 deletions.
There are no files selected for viewing
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
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
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
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
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
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
7 changes: 7 additions & 0 deletions
7
change/@react-native-windows-automation-channel-4c7447b5-805b-4261-a652-820c2d3ed0cc.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "[0.76] Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture", | ||
"packageName": "@react-native-windows/automation-channel", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@react-native-windows-codegen-386a49a7-d732-4d58-b692-37841cecd8b9.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "[0.76] Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture", | ||
"packageName": "@react-native-windows/codegen", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/react-native-windows-44e5d751-697d-41eb-806c-037f525ef1de.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "prerelease", | ||
"comment": "[0.76] Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture", | ||
"packageName": "react-native-windows", | ||
"email": "[email protected]", | ||
"dependentChangeType": "patch" | ||
} |
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
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
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
11 changes: 11 additions & 0 deletions
11
packages/@react-native-windows/automation-channel/windows/ExperimentalFeatures.props
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
|
||
<PropertyGroup Label="Microsoft.ReactNative Experimental Features"> | ||
<RnwNewArch>false</RnwNewArch> | ||
<UseExperimentalNuget>false</UseExperimentalNuget> | ||
|
||
<ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet> | ||
</PropertyGroup> | ||
|
||
</Project> |
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
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
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
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
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
Oops, something went wrong.