react-native-windows 0.76.0-preview.5 → 0.76.0-preview.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +0 -1
  2. package/PropertySheets/Autolink.props +1 -1
  3. package/PropertySheets/Codegen.props +1 -1
  4. package/PropertySheets/CppAppConsumeCSharpModule.props +2 -0
  5. package/PropertySheets/External/Microsoft.ReactNative.CSharp.Dependencies.props +1 -1
  6. package/PropertySheets/External/Microsoft.ReactNative.Composition.Common.props +2 -15
  7. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppApp.props +12 -0
  8. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppApp.targets +9 -0
  9. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.props +14 -1
  10. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.targets +10 -0
  11. package/PropertySheets/External/Microsoft.ReactNative.Cpp.PackageReferences.props +1 -1
  12. package/PropertySheets/External/Microsoft.ReactNative.CppLib.props +8 -2
  13. package/PropertySheets/External/Microsoft.ReactNative.CppLib.targets +2 -2
  14. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.props +13 -1
  15. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.targets +7 -1
  16. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.props +13 -1
  17. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.targets +6 -0
  18. package/PropertySheets/External/Microsoft.ReactNative.Uwp.Common.props +3 -0
  19. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.props +12 -0
  20. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets +6 -0
  21. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.props +15 -1
  22. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.targets +6 -0
  23. package/PropertySheets/External/Microsoft.ReactNative.WindowsSdk.Default.props +17 -8
  24. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  25. package/PropertySheets/ReactNativeArchitecture.props +69 -0
  26. package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +1 -1
  27. package/package.json +3 -3
  28. package/template/shared-app/proj/ExperimentalFeatures.props +0 -8
  29. package/template/shared-lib/proj/ExperimentalFeatures.props +0 -8
  30. package/templates/cpp-app/template.config.js +7 -0
  31. package/templates/cpp-app/windows/ExperimentalFeatures.props +17 -2
  32. package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.props +6 -0
  33. package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.targets +6 -0
  34. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +0 -5
  35. package/templates/cpp-lib/windows/ExperimentalFeatures.props +23 -2
  36. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +0 -5
  37. package/templates/old/generateWrapper.js +2 -0
  38. package/templates/templateUtils.js +16 -1
@@ -18,7 +18,6 @@
18
18
  <CppWinRTLibs>true</CppWinRTLibs>
19
19
  <BuildMSRNCxxModule>false</BuildMSRNCxxModule>
20
20
  <BuildMSRNCxxReactCommon>false</BuildMSRNCxxReactCommon>
21
- <DesktopCompatible Condition="'$(UseWinUI3)'=='true'">true</DesktopCompatible>
22
21
  </PropertyGroup>
23
22
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
24
23
  <Import Project="$(ReactNativeWindowsDir)PropertySheets\React.Cpp.props" />
@@ -7,7 +7,7 @@
7
7
 
8
8
  <PropertyGroup>
9
9
  <RunAutolinkCheck Condition="'$(RunAutolinkCheck)' == ''">true</RunAutolinkCheck>
10
- <AutolinkCommand Condition="'$(AutolinkCommand)' == ''">npx @react-native-community/cli autolink-windows</AutolinkCommand>
10
+ <AutolinkCommand Condition="'$(AutolinkCommand)' == ''">npx --yes @react-native-community/cli autolink-windows</AutolinkCommand>
11
11
  <AutolinkCommandWorkingDir Condition="'$(AutolinkCommandWorkingDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(ProjectDir), 'package.json'))</AutolinkCommandWorkingDir>
12
12
  <AutolinkCommandArgs Condition="'$(AutolinkCommandArgs)' == '' And '$(SolutionPath)' != '' And '$(SolutionPath)' != '*Undefined*' And '$(ProjectPath)' != ''">--check --sln "$([MSBuild]::MakeRelative($(AutolinkCommandWorkingDir), $(SolutionPath)))" --proj "$([MSBuild]::MakeRelative($(AutolinkCommandWorkingDir), $(ProjectPath)))"</AutolinkCommandArgs>
13
13
  <AutolinkCommandArgs Condition="'$(AutolinkCommandArgs)' == ''">--check</AutolinkCommandArgs>
@@ -7,7 +7,7 @@
7
7
 
8
8
  <PropertyGroup>
9
9
  <RunCodegenWindows Condition="'$(RunCodegenWindows)' == ''">true</RunCodegenWindows>
10
- <CodegenCommand Condition="'$(CodegenCommand)' == ''">npx @react-native-community/cli codegen-windows</CodegenCommand>
10
+ <CodegenCommand Condition="'$(CodegenCommand)' == ''">npx --yes @react-native-community/cli codegen-windows</CodegenCommand>
11
11
  <CodegenCommandWorkingDir Condition="'$(CodegenCommandWorkingDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(ProjectDir), 'package.json'))</CodegenCommandWorkingDir>
12
12
  <CodegenCommandArgs Condition="'$(CodegenCommandArgs)' == ''">--logging</CodegenCommandArgs>
13
13
  </PropertyGroup>
@@ -20,6 +20,7 @@
20
20
  <DotNetNativeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\Microsoft.Net.Native.Compiler\2.2.10-rel-29722-00\build\Microsoft.Net.Native.Compiler.props')">2.2.10-rel-29722-00</DotNetNativeVersion>
21
21
  <DotNetNativeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\Microsoft.Net.Native.Compiler\2.2.11-rel-30601-02\build\Microsoft.Net.Native.Compiler.props')">2.2.11-rel-30601-02</DotNetNativeVersion>
22
22
  <DotNetNativeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\Microsoft.Net.Native.Compiler\2.2.12-rel-31116-00\build\Microsoft.Net.Native.Compiler.props')">2.2.12-rel-31116-00</DotNetNativeVersion>
23
+ <DotNetNativeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\Microsoft.Net.Native.Compiler\2.2.12-rel-33220-00\build\Microsoft.Net.Native.Compiler.props')">2.2.12-rel-33220-00</DotNetNativeVersion>
23
24
 
24
25
  <DotNetNativeRuntimeVersion>DOTNET_NATIVE_RUNTIME_VERSION_NOT_SET</DotNetNativeRuntimeVersion>
25
26
  <DotNetNativeRuntimeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary\2.2.7-rel-27913-00\build\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary.props')">2.2.7-rel-27913-00</DotNetNativeRuntimeVersion>
@@ -28,6 +29,7 @@
28
29
  <DotNetNativeRuntimeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary\2.2.8-rel-29722-00\build\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary.props')">2.2.8-rel-29722-00</DotNetNativeRuntimeVersion>
29
30
  <DotNetNativeRuntimeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary\2.2.8-rel-30601-02\build\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary.props')">2.2.8-rel-30601-02</DotNetNativeRuntimeVersion>
30
31
  <DotNetNativeRuntimeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary\2.2.8-rel-31116-00\build\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary.props')">2.2.8-rel-31116-00</DotNetNativeRuntimeVersion>
32
+ <DotNetNativeRuntimeVersion Condition="Exists('$(MSBuildProgramFiles32)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary\2.2.8-rel-33220-00\build\runtime.win10-x86.Microsoft.Net.Native.SharedLibrary.props')">2.2.8-rel-33220-00</DotNetNativeRuntimeVersion>
31
33
 
32
34
  <!-- The name 'DotNetNativeVersion' is critical for restoring the right .NET framework libraries -->
33
35
  <UWPCoreRuntimeSdkVersion>UWP_CORE_RUNTIME_SDK_VERSION_NOT_SET</UWPCoreRuntimeSdkVersion>
@@ -11,7 +11,7 @@
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
 
13
13
  <PropertyGroup Label="NetCoreUniversalWindowsPlatform">
14
- <NETCoreUWPVersion Condition="'$(NETCoreUWPVersion)' == '' Or $([MSBuild]::VersionLessThan('$(NETCoreUWPVersion)', '6.2.9'))">6.2.9</NETCoreUWPVersion>
14
+ <NETCoreUWPVersion Condition="'$(NETCoreUWPVersion)' == '' Or $([MSBuild]::VersionLessThan('$(NETCoreUWPVersion)', '6.2.14'))">6.2.14</NETCoreUWPVersion>
15
15
  </PropertyGroup>
16
16
 
17
17
  </Project>
@@ -8,21 +8,8 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
- <Target Name="EnsureUseHermes" BeforeTargets="PrepareForBuild" Condition="'$(UseHermes)' == 'false'">
12
- <Warning Text="Property 'UseHermes' was set to 'false'. Projects built against Microsoft.ReactNative.Composition require Hermes and it will be set to true." />
11
+ <Target Name="EnsureRnwNewArch" BeforeTargets="PrepareForBuild" Condition="'$(RnwNewArch)'!='true'">
12
+ <Error Text="Property 'RnwNewArch' was not set to 'true'. Projects built against Microsoft.ReactNative.Composition require 'RnwNewArch' to be 'true'." />
13
13
  </Target>
14
-
15
- <PropertyGroup>
16
- <UseHermes>true</UseHermes>
17
- </PropertyGroup>
18
-
19
- <Target Name="EnsureUseWinUI3" BeforeTargets="PrepareForBuild" Condition="'$(UseWinUI3)' == 'false'">
20
- <Warning Text="Property 'UseWinUI3' was set to 'false'. Projects built against Microsoft.ReactNative.Composition require UseWinUI3 and it will be set to true." />
21
- </Target>
22
-
23
- <PropertyGroup>
24
- <UseWinUI3>true</UseWinUI3>
25
- </PropertyGroup>
26
-
27
14
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Common.props" />
28
15
  </Project>
@@ -13,7 +13,15 @@
13
13
  <Import Project="$(ProjectDir)\AutolinkedNativeModules.g.props"
14
14
  Condition="Exists('$(ProjectDir)\AutolinkedNativeModules.g.props')" />
15
15
 
16
+ <!-- Check that Microsoft.ReactNative.WindowsSdk.Default.props has already been imported. -->
17
+ <Target Name="EnsureRnwSdkDefaultsSetTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwSdkDefaultsSet)'!='true'">
18
+ <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
19
+ </Target>
20
+
21
+ <!-- Import common props sheets common to all Composition projects. -->
16
22
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Composition.Common.props" />
23
+
24
+ <!-- Set props and import specific prop sheets for this kind of project. -->
17
25
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Appx.props" />
18
26
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Autolink.props" />
19
27
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Codegen.props" />
@@ -22,4 +30,8 @@
22
30
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\WinUI.props" />
23
31
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\CppAppConsumeCSharpModule.props" />
24
32
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\PackageVersionDefinitions.props" />
33
+
34
+ <PropertyGroup>
35
+ <RnwExternalPropsLoaded>$(MSBuildThisFile)</RnwExternalPropsLoaded>
36
+ </PropertyGroup>
25
37
  </Project>
@@ -8,7 +8,16 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <!-- Check that the correct props have already been imported. -->
12
+ <Target Name="EnsureRnwExternalPropsLoadedTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwExternalPropsLoaded)'!='Microsoft.ReactNative.Composition.CppApp.props'">
13
+ <Warning Text="Property `RnwExternalPropsLoaded` was incorrectly set to '$(RnwExternalPropsLoaded)'. Please ensure your project imports 'Microsoft.ReactNative.Composition.CppApp.props' before importing this prop sheet." />
14
+ </Target>
15
+
11
16
  <!-- Starting with the base of the UWP Cpp targets for now (until we need to start differentiating). -->
17
+ <PropertyGroup>
18
+ <!-- Set this to avoid the warning about loading the wrong target file. -->
19
+ <RnwExternalPropsLoaded>Microsoft.ReactNative.Uwp.CppApp.props</RnwExternalPropsLoaded>
20
+ </PropertyGroup>
12
21
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppApp.targets" />
13
22
 
14
23
  <ItemGroup>
@@ -8,6 +8,15 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <!-- Check that Microsoft.ReactNative.WindowsSdk.Default.props has already been imported. -->
12
+ <Target Name="EnsureRnwSdkDefaultsSetTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwSdkDefaultsSet)'!='true'">
13
+ <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
14
+ </Target>
15
+
16
+ <!-- Import common props sheets common to all Composition projects. -->
17
+ <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Composition.Common.props" />
18
+
19
+ <!-- Set props and import specific prop sheets for this kind of project. -->
11
20
  <PropertyGroup>
12
21
  <!--
13
22
  Define SkipAddPriPayloadFilesToCopyToOutputDirectoryItems=true and GenerateLibraryLayout=false to avoid
@@ -16,9 +25,13 @@
16
25
  <SkipAddPriPayloadFilesToCopyToOutputDirectoryItems>true</SkipAddPriPayloadFilesToCopyToOutputDirectoryItems>
17
26
  <GenerateLibraryLayout>false</GenerateLibraryLayout>
18
27
  </PropertyGroup>
19
- <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Composition.Common.props" />
28
+
20
29
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Codegen.props" />
21
30
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\NuGet.Cpp.props" />
22
31
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\WinUI.props" />
23
32
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\PackageVersionDefinitions.props" />
33
+
34
+ <PropertyGroup>
35
+ <RnwExternalPropsLoaded>$(MSBuildThisFile)</RnwExternalPropsLoaded>
36
+ </PropertyGroup>
24
37
  </Project>
@@ -8,8 +8,18 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <!-- Check that the correct props have already been imported. -->
12
+ <Target Name="EnsureRnwExternalPropsLoadedTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwExternalPropsLoaded)'!='Microsoft.ReactNative.Composition.CppLib.props'">
13
+ <Warning Text="Property `RnwExternalPropsLoaded` was incorrectly set to '$(RnwExternalPropsLoaded)'. Please ensure your project imports 'Microsoft.ReactNative.Composition.CppLib.props' before importing this prop sheet." />
14
+ </Target>
15
+
11
16
  <!-- Starting with the base of the UWP Cpp targets for now (until we need to start differentiating). -->
17
+ <PropertyGroup>
18
+ <!-- Set this to avoid the warning about loading the wrong target file. -->
19
+ <RnwExternalPropsLoaded>Microsoft.ReactNative.Uwp.CppLib.props</RnwExternalPropsLoaded>
20
+ </PropertyGroup>
12
21
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets" />
22
+
13
23
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Codegen.targets" />
14
24
 
15
25
  <ItemGroup>
@@ -6,7 +6,7 @@
6
6
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
7
7
  <!-- Only include Microsoft.ReactNative.* NuGet packages that C++ (app and lib) projects need when using UseExperimentalNuget. -->
8
8
  <Choose>
9
- <When Condition="'$(UseFabric)' == 'true'">
9
+ <When Condition="'$(RnwNewArch)' == 'true'">
10
10
  <ItemGroup>
11
11
  <PackageReference Include="Microsoft.ReactNative" Version="$(ReactNativeWindowsVersion)-Fabric" />
12
12
  <PackageReference Include="Microsoft.ReactNative.Cxx" Version="$(ReactNativeWindowsVersion)-Fabric" />
@@ -8,10 +8,16 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
- <ImportGroup Condition="'$(UseFabric)' == 'true'">
11
+
12
+ <!-- Check that Microsoft.ReactNative.WindowsSdk.Default.props has already been imported. -->
13
+ <Target Name="EnsureRnwSdkDefaultsSetTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwSdkDefaultsSet)' != 'true'">
14
+ <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
15
+ </Target>
16
+
17
+ <ImportGroup Condition="'$(RnwNewArch)'=='true'">
12
18
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Composition.CppLib.props" />
13
19
  </ImportGroup>
14
- <ImportGroup Condition="'$(UseFabric)' != 'true'">
20
+ <ImportGroup Condition="'$(RnwNewArch)'!='true'">
15
21
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.CppLib.props" />
16
22
  </ImportGroup>
17
23
  </Project>
@@ -8,10 +8,10 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
- <ImportGroup Condition="'$(UseFabric)' == 'true'">
11
+ <ImportGroup Condition="'$(RnwNewArch)'=='true'">
12
12
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Composition.CppLib.targets" />
13
13
  </ImportGroup>
14
- <ImportGroup Condition="'$(UseFabric)' != 'true'">
14
+ <ImportGroup Condition="'$(RnwNewArch)'!='true'">
15
15
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.CppLib.targets" />
16
16
  </ImportGroup>
17
17
  </Project>
@@ -13,14 +13,26 @@
13
13
  <Import Project="$(ProjectDir)\AutolinkedNativeModules.g.props"
14
14
  Condition="Exists('$(ProjectDir)\AutolinkedNativeModules.g.props')" />
15
15
 
16
+ <!-- Check that Microsoft.ReactNative.WindowsSdk.Default.props has already been imported. -->
17
+ <Target Name="EnsureRnwSdkDefaultsSetTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwSdkDefaultsSet)'!='true'">
18
+ <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
19
+ </Target>
20
+
21
+ <!-- Import common props sheets common to all UWP projects. -->
22
+ <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.Common.props" />
23
+
24
+ <!-- Set props and import specific prop sheets for this kind of project. -->
16
25
  <PropertyGroup>
17
26
  <ReactNativeCodeGenEnabled Condition="'$(ReactNativeCodeGenEnabled)' == ''">true</ReactNativeCodeGenEnabled>
18
27
  </PropertyGroup>
19
28
 
20
- <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.Common.props" />
21
29
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Appx.props" />
22
30
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Autolink.props" />
23
31
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Codegen.props" />
24
32
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\NuGet.CSharp.props" />
25
33
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\WinUI.props" />
34
+
35
+ <PropertyGroup>
36
+ <RnwExternalPropsLoaded>$(MSBuildThisFile)</RnwExternalPropsLoaded>
37
+ </PropertyGroup>
26
38
  </Project>
@@ -8,7 +8,13 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
- <Import Project="$(ReactNativeWindowsDir)PropertySheets\External\Microsoft.ReactNative.Common.targets" />
11
+ <!-- Check that the correct props have already been imported. -->
12
+ <Target Name="EnsureRnwExternalPropsLoadedTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwExternalPropsLoaded)'!='Microsoft.ReactNative.Uwp.CSharpApp.props'">
13
+ <Warning Text="Property `RnwExternalPropsLoaded` was incorrectly set to '$(RnwExternalPropsLoaded)'. Please ensure your project imports 'Microsoft.ReactNative.Uwp.CSharpApp.props' before importing this prop sheet." />
14
+ </Target>
15
+
16
+ <!-- Import targets common to all projects. -->
17
+ <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Common.targets" />
12
18
 
13
19
  <!-- Due to visual studio unconditionally showing references, we have to trick it by making it impossible for VS to find the reference differences between building as source and building as NuGet -->
14
20
  <Import Project="$(ReactNativeWindowsDir)PropertySheets\External\Microsoft.ReactNative.CSharp.ProjectReferences.props" Condition="!$(UseExperimentalNuget)" />
@@ -8,10 +8,22 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <!-- Check that Microsoft.ReactNative.WindowsSdk.Default.props has already been imported. -->
12
+ <Target Name="EnsureRnwSdkDefaultsSetTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwSdkDefaultsSet)'!='true'">
13
+ <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
14
+ </Target>
15
+
16
+ <!-- Import common props sheets common to all UWP projects. -->
17
+ <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.Common.props" />
18
+
19
+ <!-- Set props and import specific prop sheets for this kind of project. -->
11
20
  <PropertyGroup>
12
21
  <ReactNativeCodeGenEnabled Condition="'$(ReactNativeCodeGenEnabled)' == ''">true</ReactNativeCodeGenEnabled>
13
22
  </PropertyGroup>
14
23
 
15
- <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.Common.props" />
16
24
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\NuGet.CSharp.props" />
25
+
26
+ <PropertyGroup>
27
+ <RnwExternalPropsLoaded>$(MSBuildThisFile)</RnwExternalPropsLoaded>
28
+ </PropertyGroup>
17
29
  </Project>
@@ -8,6 +8,12 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <!-- Check that the correct props have already been imported. -->
12
+ <Target Name="EnsureRnwExternalPropsLoadedTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwExternalPropsLoaded)'!='Microsoft.ReactNative.Uwp.CSharpLib.props'">
13
+ <Warning Text="Property `RnwExternalPropsLoaded` was incorrectly set to '$(RnwExternalPropsLoaded)'. Please ensure your project imports 'Microsoft.ReactNative.Uwp.CSharpLib.props' before importing this prop sheet." />
14
+ </Target>
15
+
16
+ <!-- Import targets common to all projects. -->
11
17
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Common.targets" />
12
18
 
13
19
  <!-- Due to visual studio unconditionally showing references, we have to trick it by making it impossible for VS to find the reference differences between building as source and building as NuGet -->
@@ -8,5 +8,8 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <Target Name="EnsureNoRnwNewArch" BeforeTargets="PrepareForBuild" Condition="'$(RnwNewArch)'=='true'">
12
+ <Error Text="Property 'RnwNewArch' was set to 'true'. Projects built against Microsoft.ReactNative.Uwp require RnwNewArch to be 'false'." />
13
+ </Target>
11
14
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Common.props" />
12
15
  </Project>
@@ -13,7 +13,15 @@
13
13
  <Import Project="$(ProjectDir)\AutolinkedNativeModules.g.props"
14
14
  Condition="Exists('$(ProjectDir)\AutolinkedNativeModules.g.props')" />
15
15
 
16
+ <!-- Check that Microsoft.ReactNative.WindowsSdk.Default.props has already been imported. -->
17
+ <Target Name="EnsureRnwSdkDefaultsSetTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwSdkDefaultsSet)'!='true'">
18
+ <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
19
+ </Target>
20
+
21
+ <!-- Import common props sheets common to all UWP projects. -->
16
22
  <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.Common.props" />
23
+
24
+ <!-- Set props and import specific prop sheets for this kind of project. -->
17
25
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Appx.props" />
18
26
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Autolink.props" />
19
27
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\Codegen.props" />
@@ -21,4 +29,8 @@
21
29
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\WinUI.props" />
22
30
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\CppAppConsumeCSharpModule.props" />
23
31
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\PackageVersionDefinitions.props" />
32
+
33
+ <PropertyGroup>
34
+ <RnwExternalPropsLoaded>$(MSBuildThisFile)</RnwExternalPropsLoaded>
35
+ </PropertyGroup>
24
36
  </Project>
@@ -8,6 +8,12 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <!-- Check that the correct props have already been imported. -->
12
+ <Target Name="EnsureRnwExternalPropsLoadedTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwExternalPropsLoaded)'!='Microsoft.ReactNative.Uwp.CppApp.props'">
13
+ <Warning Text="Property `RnwExternalPropsLoaded` was incorrectly set to '$(RnwExternalPropsLoaded)'. Please ensure your project imports 'Microsoft.ReactNative.Uwp.CppApp.props' before importing this prop sheet." />
14
+ </Target>
15
+
16
+ <!-- Import targets common to all projects. -->
11
17
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Common.targets" />
12
18
 
13
19
  <!-- Due to visual studio unconditionally showing references, we have to trick it by making it impossible for VS to find the reference differences between building as source and building as NuGet -->
@@ -8,6 +8,16 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+
12
+ <!-- Check that Microsoft.ReactNative.WindowsSdk.Default.props has already been imported. -->
13
+ <Target Name="EnsureRnwSdkDefaultsSetTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwSdkDefaultsSet)'!='true'">
14
+ <Warning Text="Property `RnwSdkDefaultsSet` was not set. Please ensure your project imports 'Microsoft.ReactNative.WindowsSdk.Default.props' before importing this prop sheet." />
15
+ </Target>
16
+
17
+ <!-- Import common props sheets common to all UWP projects. -->
18
+ <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.Common.props" />
19
+
20
+ <!-- Set props and import specific prop sheets for this kind of project. -->
11
21
  <PropertyGroup>
12
22
  <!--
13
23
  Define SkipAddPriPayloadFilesToCopyToOutputDirectoryItems=true and GenerateLibraryLayout=false to avoid
@@ -16,8 +26,12 @@
16
26
  <SkipAddPriPayloadFilesToCopyToOutputDirectoryItems>true</SkipAddPriPayloadFilesToCopyToOutputDirectoryItems>
17
27
  <GenerateLibraryLayout>false</GenerateLibraryLayout>
18
28
  </PropertyGroup>
19
- <Import Project="$(MSBuildThisFileDirectory)Microsoft.ReactNative.Uwp.Common.props" />
29
+
20
30
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\NuGet.Cpp.props" />
21
31
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\WinUI.props" />
22
32
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\PackageVersionDefinitions.props" />
33
+
34
+ <PropertyGroup>
35
+ <RnwExternalPropsLoaded>$(MSBuildThisFile)</RnwExternalPropsLoaded>
36
+ </PropertyGroup>
23
37
  </Project>
@@ -8,6 +8,12 @@
8
8
  Do not make any changes here unless it applies to ALL such projects.
9
9
  -->
10
10
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
11
+ <!-- Check that the correct props have already been imported. -->
12
+ <Target Name="EnsureRnwExternalPropsLoadedTarget" BeforeTargets="PrepareForBuild" Condition="'$(RnwExternalPropsLoaded)'!='Microsoft.ReactNative.Uwp.CppLib.props'">
13
+ <Warning Text="Property `RnwExternalPropsLoaded` was incorrectly set to '$(RnwExternalPropsLoaded)'. Please ensure your project imports 'Microsoft.ReactNative.Uwp.CppLib.props' before importing this prop sheet." />
14
+ </Target>
15
+
16
+ <!-- Import targets common to all projects. -->
11
17
  <Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Common.targets" />
12
18
 
13
19
  <!-- Due to visual studio unconditionally showing references, we have to trick it by making it impossible for VS to find the reference differences between building as source and building as NuGet -->
@@ -4,29 +4,38 @@
4
4
  Licensed under the MIT License.
5
5
  -->
6
6
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
7
-
8
7
  <!--
9
8
  This defines the default Windows SDK used to build both the app and 0.66+
10
- template community modules.
9
+ template community modules. This should be the very first import from RNW for
10
+ any RNW project.
11
11
 
12
12
  See https://microsoft.github.io/react-native-windows/docs/win10-compat
13
13
  -->
14
+
15
+ <ImportGroup Condition="'$(ReactNativeArchitecturePropsSet)' != 'true'">
16
+ <Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactNativeArchitecture.props" />
17
+ </ImportGroup>
18
+
14
19
  <PropertyGroup Label="Globals" Condition="'$(MSBuildProjectExtension)' == '.vcxproj'">
15
20
  <WindowsTargetPlatformVersion Condition="'$(WindowsTargetPlatformVersion)'=='' Or '$(WindowsTargetPlatformVersion)'=='10.0.0.0'">10.0.22621.0</WindowsTargetPlatformVersion>
16
21
  <WindowsTargetPlatformMinVersion Condition="'$(WindowsTargetPlatformMinVersion)'=='' Or '$(WindowsTargetPlatformMinVersion)'=='10.0.0.0'">10.0.17763.0</WindowsTargetPlatformMinVersion>
17
22
 
18
- <!-- WinAppSDK/Composition projects have higher version requirements. -->
19
- <WindowsTargetPlatformVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(WindowsTargetPlatformVersion)', '10.0.22621.0'))">10.0.22621.0</WindowsTargetPlatformVersion>
20
- <WindowsTargetPlatformMinVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(WindowsTargetPlatformMinVersion)', '10.0.18362.0'))">10.0.18362.0</WindowsTargetPlatformMinVersion>
23
+ <!-- New Architecture projects have higher version requirements. -->
24
+ <WindowsTargetPlatformVersion Condition="'$(RnwNewArch)'=='true' And $([MSBuild]::VersionLessThan('$(WindowsTargetPlatformVersion)', '10.0.22621.0'))">10.0.22621.0</WindowsTargetPlatformVersion>
25
+ <WindowsTargetPlatformMinVersion Condition="'$(RnwNewArch)'=='true' And $([MSBuild]::VersionLessThan('$(WindowsTargetPlatformMinVersion)', '10.0.18362.0'))">10.0.18362.0</WindowsTargetPlatformMinVersion>
21
26
  </PropertyGroup>
22
27
 
23
28
  <PropertyGroup Label="Globals" Condition="'$(MSBuildProjectExtension)' == '.csproj' Or '$(MSBuildProjectExtension)' == '.wapproj'">
24
29
  <TargetPlatformVersion Condition="'$(TargetPlatformVersion)'==''">10.0.22621.0</TargetPlatformVersion>
25
30
  <TargetPlatformMinVersion Condition="'$(TargetPlatformMinVersion)'==''">10.0.17763.0</TargetPlatformMinVersion>
26
31
 
27
- <!-- WinAppSDK/Composition projects have higher version requirements. -->
28
- <TargetPlatformVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(TargetPlatformVersion)', '10.0.22621.0'))">10.0.22621.0</TargetPlatformVersion>
29
- <TargetPlatformMinVersion Condition="'$(UseWinUI3)'=='true' And $([MSBuild]::VersionLessThan('$(TargetPlatformMinVersion)', '10.0.17763.0'))">10.0.17763.0</TargetPlatformMinVersion>
32
+ <!-- New Architecture projects have higher version requirements. -->
33
+ <TargetPlatformVersion Condition="'$(RnwNewArch)'=='true' And $([MSBuild]::VersionLessThan('$(TargetPlatformVersion)', '10.0.22621.0'))">10.0.22621.0</TargetPlatformVersion>
34
+ <TargetPlatformMinVersion Condition="'$(RnwNewArch)'=='true' And $([MSBuild]::VersionLessThan('$(TargetPlatformMinVersion)', '10.0.17763.0'))">10.0.17763.0</TargetPlatformMinVersion>
35
+ </PropertyGroup>
36
+
37
+ <PropertyGroup>
38
+ <RnwSdkDefaultsSet>true</RnwSdkDefaultsSet>
30
39
  </PropertyGroup>
31
40
 
32
41
  </Project>
@@ -10,11 +10,11 @@
10
10
  -->
11
11
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
12
12
  <PropertyGroup>
13
- <ReactNativeWindowsVersion>0.76.0-preview.5</ReactNativeWindowsVersion>
13
+ <ReactNativeWindowsVersion>0.76.0-preview.6</ReactNativeWindowsVersion>
14
14
  <ReactNativeWindowsMajor>0</ReactNativeWindowsMajor>
15
15
  <ReactNativeWindowsMinor>76</ReactNativeWindowsMinor>
16
16
  <ReactNativeWindowsPatch>0</ReactNativeWindowsPatch>
17
17
  <ReactNativeWindowsCanary>false</ReactNativeWindowsCanary>
18
- <ReactNativeWindowsCommitId>0091bbb94a83bc73c1a62acf821256b48c65dee2</ReactNativeWindowsCommitId>
18
+ <ReactNativeWindowsCommitId>28e050fa3962152708e992b519e89a553634ebfb</ReactNativeWindowsCommitId>
19
19
  </PropertyGroup>
20
20
  </Project>
@@ -0,0 +1,69 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!--
3
+ Copyright (c) Microsoft Corporation. All rights reserved.
4
+ Licensed under the MIT License.
5
+
6
+ Ensures properties align with architecture requirements.
7
+ -->
8
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
9
+ <PropertyGroup>
10
+ <RnwNewArch Condition="'$(RnwNewArch)'==''">false</RnwNewArch>
11
+ </PropertyGroup>
12
+
13
+ <!-- Check New Architecture properties and gently warn if they're misconfigured. -->
14
+ <Target Name="EnsureUseHermesForNewArch" BeforeTargets="PrepareForBuild" Condition="'$(RnwNewArch)'=='true' and '$(UseHermes)'=='false'">
15
+ <Warning Text="Property 'UseHermes' was set to 'false'. Projects built against the New Architecture require Hermes so it will be set to 'true'." />
16
+ </Target>
17
+
18
+ <Target Name="EnsureUseFabricForNewArch" BeforeTargets="PrepareForBuild" Condition="'$(RnwNewArch)'=='true' and '$(UseFabric)'=='false'">
19
+ <Warning Text="Property 'UseFabric' was set to 'false'. Projects built against the New Architecture require Fabric so it will be set to 'true'." />
20
+ </Target>
21
+
22
+ <Target Name="EnsureUseWinUI3ForNewArch" BeforeTargets="PrepareForBuild" Condition="'$(RnwNewArch)'=='true' and '$(UseWinUI3)' == 'false'">
23
+ <Warning Text="Property 'UseWinUI3' was set to 'false'. Projects built against the New Architecture require WinUI3 so it will be set to 'true'." />
24
+ </Target>
25
+
26
+ <PropertyGroup Condition="'$(RnwNewArch)'=='true'">
27
+ <!-- Every New Architecture project requires these to be true. -->
28
+ <UseHermes>true</UseHermes>
29
+ <UseFabric>true</UseFabric>
30
+ <UseWinUI3>true</UseWinUI3>
31
+
32
+ <!-- Default this to true if not specified but allow it to be false. -->
33
+ <UseExperimentalNuget Condition="'$(UseExperimentalNuget)'==''">true</UseExperimentalNuget>
34
+
35
+ <DefineConstants>RNW_NEW_ARCH;$(DefineConstants)</DefineConstants>
36
+ </PropertyGroup>
37
+
38
+ <ItemDefinitionGroup Condition="'$(RnwNewArch)'=='true'">
39
+ <ClCompile>
40
+ <PreprocessorDefinitions>RNW_NEW_ARCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
41
+ </ClCompile>
42
+ <Midl>
43
+ <PreprocessorDefinitions>RNW_NEW_ARCH;%(PreprocessorDefinitions)</PreprocessorDefinitions>
44
+ </Midl>
45
+ </ItemDefinitionGroup>
46
+
47
+ <!-- Check Old Architecture properties and gently warn if they're misconfigured. -->
48
+ <Target Name="EnsureUseFabricForOldArch" BeforeTargets="PrepareForBuild" Condition="'$(RnwNewArch)'=='false' and '$(UseFabric)'=='true'">
49
+ <Warning Text="Property 'UseFabric' was set to 'true'. Projects built against the Old Architecture do not support Fabric so it will be set to 'false'." />
50
+ </Target>
51
+
52
+ <Target Name="EnsureUseWinUI3ForOldArch" BeforeTargets="PrepareForBuild" Condition="'$(RnwNewArch)'=='false' and '$(UseWinUI3)' == 'true' and '$(ForcePaperUseWinUI3)'!='true'">
53
+ <Warning Text="Property 'UseWinUI3' was set to 'true'. Projects built against the Old Architecture do not support WinUI3 so it will be set to 'false'. You may set 'ForcePaperUseWinUI3' to 'true' override this at your own risk." />
54
+ </Target>
55
+
56
+ <PropertyGroup Condition="'$(RnwNewArch)'=='false'">
57
+ <!-- Every Old Architecture project requires these to be false. -->
58
+ <UseFabric>false</UseFabric>
59
+
60
+ <!-- Set UseWinUI3 to false unless 'ForcePaperUseWinUI3'. -->
61
+ <UseWinUI3 Condition="'$(ForcePaperUseWinUI3)'=='true'">true</UseWinUI3>
62
+ <UseWinUI3 Condition="'$(ForcePaperUseWinUI3)'!='true'">false</UseWinUI3>
63
+ </PropertyGroup>
64
+
65
+ <PropertyGroup>
66
+ <ReactNativeArchitecturePropsSet>true</ReactNativeArchitecturePropsSet>
67
+ </PropertyGroup>
68
+
69
+ </Project>
@@ -20,7 +20,7 @@ try
20
20
  # Re-run solutions that we also build a Fabric variant
21
21
  @("$RepoRoot\vnext\ReactWindows-Desktop.sln", "$RepoRoot\vnext\Microsoft.ReactNative.CppOnly.slnf") | Foreach {
22
22
  Write-Host Restoring $_ with Fabric
23
- & msbuild /t:Restore /p:RestoreForceEvaluate=true /p:UseFabric=true /p:UseWinUI3=true $_
23
+ & msbuild /t:Restore /p:RestoreForceEvaluate=true /p:RnwNewArch=true $_
24
24
  }
25
25
  }
26
26
  finally
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-windows",
3
- "version": "0.76.0-preview.5",
3
+ "version": "0.76.0-preview.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,7 +26,7 @@
26
26
  "@react-native-community/cli": "15.0.0-alpha.2",
27
27
  "@react-native-community/cli-platform-android": "15.0.0-alpha.2",
28
28
  "@react-native-community/cli-platform-ios": "15.0.0-alpha.2",
29
- "@react-native-windows/cli": "0.76.0-preview.4",
29
+ "@react-native-windows/cli": "0.76.0-preview.5",
30
30
  "@react-native/assets": "1.0.0",
31
31
  "@react-native/assets-registry": "0.76.0",
32
32
  "@react-native/codegen": "0.76.0",
@@ -70,7 +70,7 @@
70
70
  },
71
71
  "devDependencies": {
72
72
  "@react-native/metro-config": "0.76.0",
73
- "@react-native-windows/codegen": "0.76.0-preview.2",
73
+ "@react-native-windows/codegen": "0.76.0-preview.3",
74
74
  "@rnw-scripts/babel-react-native-config": "0.0.0",
75
75
  "@rnw-scripts/eslint-config": "1.2.27",
76
76
  "@rnw-scripts/jest-out-of-tree-snapshot-resolver": "^1.1.31",
@@ -16,14 +16,6 @@
16
16
  -->
17
17
  <UseHermes>{{useHermes}}</UseHermes>
18
18
 
19
- <!--
20
- Changes compilation to assume use of WinUI 3 instead of System XAML.
21
- Requires creation of new project.
22
-
23
- See https://microsoft.github.io/react-native-windows/docs/winui3
24
- -->
25
- <UseWinUI3>{{useWinUI3}}</UseWinUI3>
26
-
27
19
  <!--
28
20
  Changes compilation to assume use of Microsoft.ReactNative NuGet packages
29
21
  instead of building the framework from source.
@@ -16,14 +16,6 @@
16
16
  -->
17
17
  <UseHermes>{{useHermes}}</UseHermes>
18
18
 
19
- <!--
20
- Changes compilation to assume use of WinUI 3 instead of System XAML.
21
- Requires creation of new project.
22
-
23
- See https://microsoft.github.io/react-native-windows/docs/winui3
24
- -->
25
- <UseWinUI3>{{useWinUI3}}</UseWinUI3>
26
-
27
19
  <!--
28
20
  Changes compilation to assume use of Microsoft.ReactNative NuGet packages
29
21
  instead of building the framework from source.
@@ -75,6 +75,13 @@ async function getFileMappings(config = {}, options = {}) {
75
75
  addReactNativePublicAdoFeed: true || isCanary, // Temporary true for all new projects until code-signing is restored, see issue #14030
76
76
 
77
77
  cppNugetPackages,
78
+
79
+ // autolinking template variables
80
+ autolinkPropertiesForProps: '',
81
+ autolinkProjectReferencesForTargets: '',
82
+ autolinkCppIncludes: '',
83
+ autolinkCppPackageProviders:
84
+ '\n UNREFERENCED_PARAMETER(packageProviders);', // CODESYNC: @react-native-windows\cli\src\commands\autolinkWindows\autolinkWindows.ts
78
85
  };
79
86
 
80
87
  let fileMappings = [];
@@ -2,8 +2,23 @@
2
2
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
 
4
4
  <PropertyGroup Label="Microsoft.ReactNative Experimental Features">
5
- <UseFabric>true</UseFabric>
6
- <UseWinUI3>true</UseWinUI3>
5
+ <!--
6
+ Required for building a New Architecture project.
7
+
8
+ App projects should not change this value.
9
+
10
+ See https://microsoft.github.io/react-native-windows/docs/new-architecture
11
+ -->
12
+ <RnwNewArch>true</RnwNewArch>
13
+
14
+ <!--
15
+ Changes compilation to assume use of Microsoft.ReactNative NuGet packages
16
+ instead of building the framework from source. Defaults to true.
17
+
18
+ This is set during app project creation and should not be changed.
19
+
20
+ See https://microsoft.github.io/react-native-windows/docs/nuget
21
+ -->
7
22
  <UseExperimentalNuget>{{useNuGets}}</UseExperimentalNuget>
8
23
 
9
24
  <ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <!-- AutolinkedNativeModules.g.props contents generated by "npx @react-native-community/cli autolink-windows" -->
4
+ <PropertyGroup>{{ &autolinkPropertiesForProps }}
5
+ </PropertyGroup>
6
+ </Project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
+ <!-- AutolinkedNativeModules.g.targets contents generated by "npx @react-native-community/cli autolink-windows" -->
4
+ <ItemGroup>{{ &autolinkProjectReferencesForTargets }}
5
+ </ItemGroup>
6
+ </Project>
@@ -92,11 +92,6 @@
92
92
  <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
93
93
  </ClCompile>
94
94
  </ItemDefinitionGroup>
95
- <ItemDefinitionGroup>
96
- <ClCompile>
97
- <PreprocessorDefinitions Condition="'$(UseFabric)'=='true'">USE_FABRIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
98
- </ClCompile>
99
- </ItemDefinitionGroup>
100
95
  <PropertyGroup Label="UserMacros" />
101
96
  <ItemGroup>
102
97
  <ClInclude Include="{{ name }}.h" />
@@ -2,8 +2,29 @@
2
2
  <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
3
 
4
4
  <PropertyGroup Label="Microsoft.ReactNative Experimental Features">
5
- <UseFabric>true</UseFabric>
6
- <UseWinUI3>true</UseWinUI3>
5
+ <!--
6
+ Required for building a New Architecture project.
7
+
8
+ Library projects can change this value to test against Old and New
9
+ Architectures when building the library project's local sln file.
10
+
11
+ Otherwise this value will be decided by the consuming RNW app.
12
+
13
+ See https://microsoft.github.io/react-native-windows/docs/new-architecture
14
+ -->
15
+ <RnwNewArch>true</RnwNewArch>
16
+
17
+ <!--
18
+ Changes compilation to assume use of Microsoft.ReactNative NuGet packages
19
+ instead of building the framework from source. Defaults to true.
20
+
21
+ This is set during library project creation and is used when building
22
+ the library project's local sln file.
23
+
24
+ Otherwise this value will be decided by the consuming RNW app.
25
+
26
+ See https://microsoft.github.io/react-native-windows/docs/nuget
27
+ -->
7
28
  <UseExperimentalNuget>{{useNuGets}}</UseExperimentalNuget>
8
29
 
9
30
  <ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet>
@@ -98,11 +98,6 @@
98
98
  <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
99
99
  </ClCompile>
100
100
  </ItemDefinitionGroup>
101
- <ItemDefinitionGroup>
102
- <ClCompile>
103
- <PreprocessorDefinitions Condition="'$(UseFabric)'=='true'">USE_FABRIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
104
- </ClCompile>
105
- </ItemDefinitionGroup>
106
101
  <PropertyGroup Label="UserMacros" />
107
102
  <ItemGroup>
108
103
  <ClInclude Include="{{ name }}.h" />
@@ -55,6 +55,8 @@ function makeGenerateWindowsWrapper(
55
55
  options.namespace,
56
56
  generateOptions,
57
57
  );
58
+
59
+ await templateUtils.updateProjectPackageJson(config, options);
58
60
  };
59
61
 
60
62
  return {
@@ -110,7 +110,12 @@ async function runNpmInstall(config = {}, options = {}) {
110
110
  }
111
111
  }
112
112
 
113
- async function updateProjectPackageJson(config = {}, options = {}, props = {}) {
113
+ async function updateProjectPackageJson(
114
+ config = {},
115
+ options = {},
116
+ props = {},
117
+ saveOptions = true,
118
+ ) {
114
119
  const projectRoot = config?.root ?? process.cwd();
115
120
  const projectPackage =
116
121
  await pkgUtils.WritableNpmPackage.fromPath(projectRoot);
@@ -121,6 +126,16 @@ async function updateProjectPackageJson(config = {}, options = {}, props = {}) {
121
126
  );
122
127
  }
123
128
 
129
+ if (saveOptions) {
130
+ props['react-native-windows'] = {
131
+ 'init-windows': {
132
+ name: options.name,
133
+ namespace: options.namespace,
134
+ template: options.template,
135
+ },
136
+ };
137
+ }
138
+
124
139
  if (options?.logging) {
125
140
  console.log(`Modifying ${path.join(projectRoot, 'package.json')}...`);
126
141
  }