react-native-windows 0.76.0-preview.4 → 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 (40) hide show
  1. package/Libraries/Core/ReactNativeVersion.js +1 -1
  2. package/Libraries/Text/Text.windows.js +23 -58
  3. package/Microsoft.ReactNative/Microsoft.ReactNative.vcxproj +0 -1
  4. package/PropertySheets/Autolink.props +1 -1
  5. package/PropertySheets/Codegen.props +1 -1
  6. package/PropertySheets/CppAppConsumeCSharpModule.props +2 -0
  7. package/PropertySheets/External/Microsoft.ReactNative.CSharp.Dependencies.props +1 -1
  8. package/PropertySheets/External/Microsoft.ReactNative.Composition.Common.props +2 -15
  9. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppApp.props +12 -0
  10. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppApp.targets +9 -0
  11. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.props +14 -1
  12. package/PropertySheets/External/Microsoft.ReactNative.Composition.CppLib.targets +10 -0
  13. package/PropertySheets/External/Microsoft.ReactNative.Cpp.PackageReferences.props +1 -1
  14. package/PropertySheets/External/Microsoft.ReactNative.CppLib.props +8 -2
  15. package/PropertySheets/External/Microsoft.ReactNative.CppLib.targets +2 -2
  16. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.props +13 -1
  17. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpApp.targets +7 -1
  18. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.props +13 -1
  19. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CSharpLib.targets +6 -0
  20. package/PropertySheets/External/Microsoft.ReactNative.Uwp.Common.props +3 -0
  21. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.props +12 -0
  22. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppApp.targets +6 -0
  23. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.props +15 -1
  24. package/PropertySheets/External/Microsoft.ReactNative.Uwp.CppLib.targets +6 -0
  25. package/PropertySheets/External/Microsoft.ReactNative.WindowsSdk.Default.props +17 -8
  26. package/PropertySheets/Generated/PackageVersion.g.props +2 -2
  27. package/PropertySheets/ReactNativeArchitecture.props +69 -0
  28. package/Scripts/NuGetRestoreForceEvaluateAllSolutions.ps1 +1 -1
  29. package/package.json +13 -13
  30. package/template/shared-app/proj/ExperimentalFeatures.props +0 -8
  31. package/template/shared-lib/proj/ExperimentalFeatures.props +0 -8
  32. package/templates/cpp-app/template.config.js +7 -0
  33. package/templates/cpp-app/windows/ExperimentalFeatures.props +17 -2
  34. package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.props +6 -0
  35. package/templates/cpp-app/windows/MyApp/AutolinkedNativeModules.g.targets +6 -0
  36. package/templates/cpp-app/windows/MyApp/MyApp.vcxproj +0 -5
  37. package/templates/cpp-lib/windows/ExperimentalFeatures.props +23 -2
  38. package/templates/cpp-lib/windows/MyLib/MyLib.vcxproj +0 -5
  39. package/templates/old/generateWrapper.js +2 -0
  40. package/templates/templateUtils.js +16 -1
@@ -17,7 +17,7 @@ const version: $ReadOnly<{
17
17
  major: 0,
18
18
  minor: 76,
19
19
  patch: 0,
20
- prerelease: 'rc.6',
20
+ prerelease: null,
21
21
  };
22
22
 
23
23
  module.exports = {version};
@@ -8,6 +8,8 @@
8
8
  * @format
9
9
  */
10
10
 
11
+ import type {TextStyleProp} from '../StyleSheet/StyleSheet';
12
+ import type {____TextStyle_Internal as TextStyleInternal} from '../StyleSheet/StyleSheetTypes';
11
13
  import type {PressEvent} from '../Types/CoreEventTypes';
12
14
  import type {NativeTextProps} from './TextNativeComponent';
13
15
  import type {PressRetentionOffset, TextProps} from './TextProps';
@@ -23,7 +25,7 @@ import * as React from 'react';
23
25
  import {useContext, useMemo, useState} from 'react';
24
26
 
25
27
  const View = require('../Components/View/View'); // [Windows]
26
- import {type TextStyleProp, type ViewStyleProp} from '../StyleSheet/StyleSheet'; // [Windows]
28
+ import {type ViewStyleProp} from '../StyleSheet/StyleSheet'; // [Windows]
27
29
 
28
30
  type TextForwardRef = React.ElementRef<
29
31
  typeof NativeText | typeof NativeVirtualText,
@@ -144,25 +146,32 @@ const Text: React.AbstractComponent<TextProps, TextForwardRef> =
144
146
 
145
147
  let _selectable = selectable;
146
148
 
147
- const processedStyle = flattenStyle(_style);
149
+ let processedStyle = flattenStyle<TextStyleProp>(_style);
148
150
  if (processedStyle != null) {
151
+ let overrides: ?{...TextStyleInternal} = null;
149
152
  if (typeof processedStyle.fontWeight === 'number') {
150
- // $FlowFixMe[cannot-write]
151
- processedStyle.fontWeight = processedStyle.fontWeight.toString();
153
+ overrides = overrides || ({}: {...TextStyleInternal});
154
+ overrides.fontWeight =
155
+ // $FlowFixMe[incompatible-cast]
156
+ (processedStyle.fontWeight.toString(): TextStyleInternal['fontWeight']);
152
157
  }
153
158
 
154
159
  if (processedStyle.userSelect != null) {
155
160
  _selectable = userSelectToSelectableMap[processedStyle.userSelect];
156
- // $FlowFixMe[cannot-write]
157
- delete processedStyle.userSelect;
161
+ overrides = overrides || ({}: {...TextStyleInternal});
162
+ overrides.userSelect = undefined;
158
163
  }
159
164
 
160
165
  if (processedStyle.verticalAlign != null) {
161
- // $FlowFixMe[cannot-write]
162
- processedStyle.textAlignVertical =
166
+ overrides = overrides || ({}: {...TextStyleInternal});
167
+ overrides.textAlignVertical =
163
168
  verticalAlignToTextAlignVerticalMap[processedStyle.verticalAlign];
164
- // $FlowFixMe[cannot-write]
165
- delete processedStyle.verticalAlign;
169
+ overrides.verticalAlign = undefined;
170
+ }
171
+
172
+ if (overrides != null) {
173
+ // $FlowFixMe[incompatible-type]
174
+ _style = [_style, overrides];
166
175
  }
167
176
  }
168
177
 
@@ -185,7 +194,7 @@ const Text: React.AbstractComponent<TextProps, TextForwardRef> =
185
194
  numberOfLines: _numberOfLines,
186
195
  selectable: _selectable,
187
196
  selectionColor: _selectionColor,
188
- style: processedStyle,
197
+ style: _style,
189
198
  disabled: disabled,
190
199
  children,
191
200
  }}
@@ -222,7 +231,7 @@ const Text: React.AbstractComponent<TextProps, TextForwardRef> =
222
231
  ref={forwardedRef}
223
232
  selectable={_selectable}
224
233
  selectionColor={_selectionColor}
225
- style={processedStyle}
234
+ style={_style}
226
235
  disabled={disabled}>
227
236
  {children}
228
237
  </NativeVirtualText>
@@ -269,7 +278,7 @@ const Text: React.AbstractComponent<TextProps, TextForwardRef> =
269
278
  numberOfLines: _numberOfLines,
270
279
  selectable: _selectable,
271
280
  selectionColor: _selectionColor,
272
- style: processedStyle,
281
+ style: _style,
273
282
  children,
274
283
  }}
275
284
  textPressabilityProps={{
@@ -307,7 +316,7 @@ const Text: React.AbstractComponent<TextProps, TextForwardRef> =
307
316
  ref={forwardedRef}
308
317
  selectable={_selectable}
309
318
  selectionColor={_selectionColor}
310
- style={processedStyle}>
319
+ style={_style}>
311
320
  {children}
312
321
  </NativeText>
313
322
  );
@@ -328,50 +337,6 @@ const Text: React.AbstractComponent<TextProps, TextForwardRef> =
328
337
  styleProps.borderStartWidth != null ||
329
338
  styleProps.borderTopWidth != null)
330
339
  ) {
331
- let textStyleProps = Array.isArray(styleProps)
332
- ? // $FlowFixMe[underconstrained-implicit-instantiation]
333
- flattenStyle(styleProps)
334
- : styleProps;
335
- let {
336
- // $FlowFixMe[prop-missing]
337
- margin,
338
- // $FlowFixMe[prop-missing]
339
- marginBottom,
340
- // $FlowFixMe[prop-missing]
341
- marginEnd,
342
- // $FlowFixMe[prop-missing]
343
- marginHorizontal,
344
- // $FlowFixMe[prop-missing]
345
- marginLeft,
346
- // $FlowFixMe[prop-missing]
347
- marginRight,
348
- // $FlowFixMe[prop-missing]
349
- marginStart,
350
- // $FlowFixMe[prop-missing]
351
- marginTop,
352
- // $FlowFixMe[prop-missing]
353
- marginVertical,
354
- // $FlowFixMe[prop-missing]
355
- padding,
356
- // $FlowFixMe[prop-missing]
357
- paddingBottom,
358
- // $FlowFixMe[prop-missing]
359
- paddingEnd,
360
- // $FlowFixMe[prop-missing]
361
- paddingHorizontal,
362
- // $FlowFixMe[prop-missing]
363
- paddingLeft,
364
- // $FlowFixMe[prop-missing]
365
- paddingRight,
366
- // $FlowFixMe[prop-missing]
367
- paddingStart,
368
- // $FlowFixMe[prop-missing]
369
- paddingTop,
370
- // $FlowFixMe[prop-missing]
371
- paddingVertical,
372
- // $FlowFixMe[not-an-object]
373
- ...rest
374
- } = textStyleProps != null ? textStyleProps : {};
375
340
  return (
376
341
  <View style={styleProps}>
377
342
  <TextAncestor.Provider value={true}>
@@ -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.4</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>5b950cfec87e5ce5e60f7762619f9acdd33c63d2</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.4",
3
+ "version": "0.76.0-preview.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,15 +26,15 @@
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
- "@react-native/assets-registry": "0.76.0-rc.6",
32
- "@react-native/codegen": "0.76.0-rc.6",
33
- "@react-native/community-cli-plugin": "0.76.0-rc.6",
34
- "@react-native/gradle-plugin": "0.76.0-rc.6",
35
- "@react-native/js-polyfills": "0.76.0-rc.6",
36
- "@react-native/normalize-colors": "0.76.0-rc.6",
37
- "@react-native/virtualized-lists": "0.76.0-rc.6",
31
+ "@react-native/assets-registry": "0.76.0",
32
+ "@react-native/codegen": "0.76.0",
33
+ "@react-native/community-cli-plugin": "0.76.0",
34
+ "@react-native/gradle-plugin": "0.76.0",
35
+ "@react-native/js-polyfills": "0.76.0",
36
+ "@react-native/normalize-colors": "0.76.0",
37
+ "@react-native/virtualized-lists": "0.76.0",
38
38
  "abort-controller": "^3.0.0",
39
39
  "anser": "^1.4.9",
40
40
  "ansi-regex": "^5.0.0",
@@ -69,8 +69,8 @@
69
69
  "yargs": "^17.6.2"
70
70
  },
71
71
  "devDependencies": {
72
- "@react-native-windows/codegen": "0.76.0-preview.2",
73
- "@react-native/metro-config": "0.76.0-rc.6",
72
+ "@react-native/metro-config": "0.76.0",
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",
@@ -85,7 +85,7 @@
85
85
  "just-scripts": "^1.3.3",
86
86
  "prettier": "2.8.8",
87
87
  "react": "18.3.1",
88
- "react-native": "0.76.0-rc.6",
88
+ "react-native": "0.76.0",
89
89
  "react-native-platform-override": "^1.9.46",
90
90
  "react-refresh": "^0.14.0",
91
91
  "typescript": "5.0.4"
@@ -93,7 +93,7 @@
93
93
  "peerDependencies": {
94
94
  "@types/react": "^18.2.6",
95
95
  "react": "^18.2.0",
96
- "react-native": "0.76.0-rc.6"
96
+ "react-native": "^0.76.0"
97
97
  },
98
98
  "beachball": {
99
99
  "defaultNpmTag": "preview",
@@ -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
  }