react-native-windows/vnext/Scripts
Jon Thysell 6faf5685d4
Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture (#14042)
## 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
2024-11-07 12:04:12 -08:00
..
Tfs Integrate RN Nightly 6/13 (#13346) 2024-07-10 01:31:05 +00:00
Tracing Make Hermes consume the ICU.dll in Windows 10 for i18n (#8657) 2021-09-28 12:08:47 -07:00
Analyze-Crash.ps1 Add Analyze-crash.ps1 (#8911) 2021-10-24 15:09:16 +00:00
EnableInternalWinAppSDKFeed.ps1 Add Playground Composition CI Builds with UseExperimentalWinUI3 enabled (#12696) 2024-02-12 13:18:49 -08:00
Install-WindowsSDKISO.ps1 Remove ARM32 Support (#7645) 2021-04-28 15:22:53 +00:00
IntegrationTests.ps1 Enable integration test web application (#12714) 2024-03-20 22:42:33 +00:00
JustMyXaml.ps1 Upgrade to VS 2022 (#9916) 2022-10-31 11:00:09 -07:00
Microsoft.ReactNative.Cxx.nuspec Add verification to ensure nuget and npm version match. (#5836) 2020-08-27 20:19:11 +00:00
Microsoft.ReactNative.Cxx.targets Add verification to ensure nuget and npm version match. (#5836) 2020-08-27 20:19:11 +00:00
Microsoft.ReactNative.Managed.CodeGen.nuspec Add verification to ensure nuget and npm version match. (#5836) 2020-08-27 20:19:11 +00:00
Microsoft.ReactNative.Managed.CodeGen.targets Add verification to ensure nuget and npm version match. (#5836) 2020-08-27 20:19:11 +00:00
Microsoft.ReactNative.Managed.nuspec Bump WinUI to v2.8 (#11493) 2023-04-24 11:36:22 -07:00
Microsoft.ReactNative.Managed.targets Add verification to ensure nuget and npm version match. (#5836) 2020-08-27 20:19:11 +00:00
Microsoft.ReactNative.VersionCheck.targets Switch New Architecture templates to use prebuilt NuGets (#13338) 2024-08-26 21:34:07 +00:00
Microsoft.ReactNative.nuspec Include import lib in the M.RN nuget package to export CoreApp APIs (#10342) 2022-07-28 18:14:57 -07:00
Microsoft.ReactNative.targets Deprecate and remove the experimental CoreApp APIs and prototype app (#12730) 2024-02-14 11:55:13 -08:00
NuGetRestoreForceEvaluateAllSolutions.ps1 Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture (#14042) 2024-11-07 12:04:12 -08:00
OfficeReact.Win32.nuspec Update Desktop NUSPEC to use ARM64EC (#13335) 2024-07-10 00:48:48 +00:00
OpenSSL.nuspec Upgrade to OpenSSL 1.0.2p_5 (#5787) 2020-08-20 03:00:00 -07:00
OpenSSL.targets Set ToolsVersion to "Current" (#8212) 2021-07-13 16:19:08 -07:00
PublishNugetPackagesLocally.cmd Revert creation of symbol packages, main codesign (#8690) 2021-09-22 16:33:09 -07:00
StripAdditionalPlatformsFromNuspec.ps1 Add ARM64EC to StripAdditionalPlatformsFromNuspec.ps1 2024-06-12 13:20:25 -07:00
TestServers.ps1 Enable integration test web application (#12714) 2024-03-20 22:42:33 +00:00
UnitTest.ps1 Upgrade to VS 2022 (#9916) 2022-10-31 11:00:09 -07:00
VSProjectUtils.ps1 Auto-linking for native modules (source-based) (#5044) 2020-06-19 16:49:08 -07:00
cli.js CELA open source policy no longer recommends all right reserved in license header (#5083) 2020-06-01 15:17:26 -07:00
just.js Adjust Prettier Config to Match react-native (#9819) 2022-04-11 17:34:40 -07:00
rnw-dependencies.ps1 Bump minimum VS version to 17.11.0 (#13455) 2024-08-15 15:52:58 -07:00
run-desktop-integration-tests.js Adjust Prettier Config to Match react-native (#9819) 2022-04-11 17:34:40 -07:00
utils.js Integrate RN Nightly Build 11/11 (#9214) 2021-12-02 12:15:57 -08:00