Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c5d8588
Add RnwNewArch property and RNW_NEW_ARCH constants when building proj…
jonthysell Oct 29, 2024
8450fc3
Change files
jonthysell Oct 29, 2024
01e6a53
Propagate RnwNewArch so it's explicitly false for UWP projects.
jonthysell Oct 29, 2024
6e6585b
Add ReactNativeArchitecture.props, add requirement for WindowsSDK pro…
jonthysell Oct 30, 2024
e5000f2
Add checks that correct props sheets were loaded before target sheets
jonthysell Oct 30, 2024
11974cd
Update templates and existing projects to specify RnwNewArch
jonthysell Oct 30, 2024
21ff8f9
Fix warnings for re-using targets
jonthysell Oct 30, 2024
4aab043
Revert vnext/PropertySheets/NewAPIDeclarations.props
jonthysell Oct 30, 2024
dade572
Update ado build to use the new prop
jonthysell Oct 30, 2024
da2450b
Fix lock files
jonthysell Oct 30, 2024
b16b3e7
Change files
jonthysell Oct 30, 2024
426dec2
Fix automation channel, playground
jonthysell Oct 31, 2024
6344568
Fix missing npm folder
jonthysell Nov 1, 2024
a7b9bd4
Fix mkdir and environment for desktop
jonthysell Nov 1, 2024
8d3692e
re-add usefabric and winui3 to our CI build enable task
jonthysell Nov 1, 2024
d2d5647
Fix more lock files
jonthysell Nov 1, 2024
8ee1038
fix npx commands and automation-channel project
jonthysell Nov 1, 2024
b5ab461
fix package locks after rebase
jonthysell Nov 4, 2024
94373eb
Fix desktop build
jonthysell Nov 4, 2024
3b7af31
Fix Desktop again
jonthysell Nov 5, 2024
1537d50
Try fix playground composition
jonthysell Nov 5, 2024
dcb7bcb
Merge branch 'main' into newarchconstants
jonthysell Nov 5, 2024
05cd7e3
try fix playground
jonthysell Nov 6, 2024
4717e40
Merge branch 'newarchconstants' of https://github.com/jonthysell/reac…
jonthysell Nov 6, 2024
8060d46
Merge branch 'main' into newarchconstants
jonthysell Nov 6, 2024
8be193d
fix lock files
jonthysell Nov 6, 2024
6b9b7e2
Merge branch 'main' into newarchconstants
jonthysell Nov 7, 2024
dc29e02
Fix playground composiion build with singleproc
jonthysell Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .ado/jobs/cli-init-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -325,12 +325,6 @@ jobs:
platform: ${{ parameters.platform }}
configuration: ${{ parameters.configuration }}
buildEnvironment: ${{ parameters.buildEnvironment }}

- task: CmdLine@2
displayName: Create npm directory
name: createNpmDirectory
inputs:
script: mkdir %APPDATA%\npm

- template: ../templates/react-native-init-windows.yml
parameters:
Expand Down
2 changes: 2 additions & 0 deletions .ado/jobs/playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ jobs:
msbuildArgs:
/p:PackageCertificateKeyFile=$(Build.SourcesDirectory)\EncodedKey.pfx
/p:PackageCertificatePassword=${{ parameters.certificatePassword }}
${{if eq(matrix.SolutionFile, 'Playground-Composition.sln')}}:
parallelBuild: false # required to workaround issue #13599

- ${{if and(false, endsWith(matrix.Name, 'Universal'), eq(matrix.BuildConfiguration, 'Debug')) }}: # Disabled as debugging doesn't work,remove false after issue is resolved, see https://github.com/microsoft/react-native-windows/issues/13543
# Execute debug feature tests (skip this step for the Win32 Playground app and for release builds)
Expand Down
3 changes: 0 additions & 3 deletions .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ extends:

- template: .ado/templates/run-compliance-prebuild.yml@self

- script: if not exist %USERPROFILE%\AppData\Roaming\npm (mkdir %USERPROFILE%\AppData\Roaming\npm)
displayName: Fix missing npm config

- pwsh: |
npx beachball check --verbose 2>&1 | Tee-Object -Variable beachballOutput
$beachballErrors = $beachballOutput | Where-Object { $_ -match "ERROR: *"}
Expand Down
2 changes: 1 addition & 1 deletion .ado/templates/enable-fabric-experimental-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ steps:
$nsm.AddNamespace('ns', $experimentalFeatures.DocumentElement.NamespaceURI)

$xmlNode = $experimentalFeatures.CreateElement("PropertyGroup");
$xmlNode.InnerXml = "<UseFabric>true</UseFabric><UseWinUI3>true</UseWinUI3>"
$xmlNode.InnerXml = "<RnwNewArch>true</RnwNewArch><UseFabric>true</UseFabric><UseWinUI3>true</UseWinUI3>"

$experimentalFeatures.DocumentElement.AppendChild($xmlNode);

Expand Down
3 changes: 2 additions & 1 deletion .ado/templates/msbuild-sln.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ parameters:
msbuildArguments: ''
warnAsError: true
oneESMode: false
parallelBuild: true

steps:
- powershell: |
Expand All @@ -36,7 +37,7 @@ steps:
platform: ${{ parameters.buildPlatform }}
configuration: ${{ parameters.buildConfiguration }}
clean: false # Optional
maximumCpuCount: true
maximumCpuCount: ${{parameters.parallelBuild}}
restoreNugetPackages: false # Optional
createLogFile: true
logFileVerbosity: detailed
Expand Down
4 changes: 4 additions & 0 deletions .ado/templates/prepare-js-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ steps:
inputs:
versionSpec: '18.x'

- script: if not exist %APPDATA%\npm (mkdir %APPDATA%\npm)
displayName: Ensure npm directory for npx commands
condition: eq(variables['Agent.OS'], 'Windows_NT')

- template: yarn-install.yml
parameters:
agentImage: ${{ parameters.agentImage }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture",
"packageName": "@react-native-windows/automation-channel",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture",
"packageName": "@react-native-windows/codegen",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add RnwNewArch property and RNW_NEW_ARCH constants when building projects for the new architecture",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"jsonrpc-lite": "^2.2.0"
},
"devDependencies": {
"@react-native-community/cli": "15.0.0-alpha.2",
"@rnw-scripts/eslint-config": "1.2.30",
"@rnw-scripts/just-task": "2.3.47",
"@rnw-scripts/ts-config": "2.0.5",
Expand All @@ -44,4 +45,4 @@
"engines": {
"node": ">= 18"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="ReactNativeWindowsPropertySheets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\external\Microsoft.ReactNative.Uwp.CppLib.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" />
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\external\Microsoft.ReactNative.CppLib.props" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.props')" />
<!-- Added since we build this project with Paper/Fabric. -->
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\NuGet.LockFile.props" />
</ImportGroup>
Expand Down Expand Up @@ -143,13 +143,13 @@
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ReactNativeWindowsTargets">
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" />
<Import Project="$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.targets" Condition="Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.targets')" />
</ImportGroup>
<Target Name="EnsureReactNativeWindowsTargets" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references targets in your node_modules\react-native-windows folder that are missing. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.props'))" />
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.Uwp.CppLib.targets'))" />
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.props')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.props'))" />
<Error Condition="!Exists('$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(ReactNativeWindowsDir)\PropertySheets\External\Microsoft.ReactNative.CppLib.targets'))" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@
"version": 1,
"dependencies": {
"native,Version=v0.0": {
"boost": {
"type": "Direct",
"requested": "[1.83.0, )",
"resolved": "1.83.0",
"contentHash": "cy53VNMzysEMvhBixDe8ujPk67Fcj3v6FPHQnH91NYJNLHpc6jxa2xq9ruCaaJjE4M3YrGSHDi4uUSTGBWw6EQ=="
},
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
"requested": "[1.0.2-rc, )",
"resolved": "1.0.2-rc",
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
},
"Microsoft.Windows.CppWinRT": {
"type": "Direct",
"requested": "[2.0.230706.1, )",
Expand All @@ -18,11 +30,6 @@
"Microsoft.Windows.SDK.BuildTools": "10.0.22621.756"
}
},
"boost": {
"type": "Transitive",
"resolved": "1.83.0",
"contentHash": "cy53VNMzysEMvhBixDe8ujPk67Fcj3v6FPHQnH91NYJNLHpc6jxa2xq9ruCaaJjE4M3YrGSHDi4uUSTGBWw6EQ=="
},
"Microsoft.Build.Tasks.Git": {
"type": "Transitive",
"resolved": "1.1.1",
Expand Down Expand Up @@ -94,6 +101,12 @@
}
},
"native,Version=v0.0/win10-arm": {
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
"requested": "[1.0.2-rc, )",
"resolved": "1.0.2-rc",
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
},
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.6.240923002, )",
Expand All @@ -111,6 +124,12 @@
}
},
"native,Version=v0.0/win10-arm-aot": {
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
"requested": "[1.0.2-rc, )",
"resolved": "1.0.2-rc",
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
},
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.6.240923002, )",
Expand All @@ -128,6 +147,12 @@
}
},
"native,Version=v0.0/win10-arm64-aot": {
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
"requested": "[1.0.2-rc, )",
"resolved": "1.0.2-rc",
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
},
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.6.240923002, )",
Expand All @@ -145,6 +170,12 @@
}
},
"native,Version=v0.0/win10-x64": {
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
"requested": "[1.0.2-rc, )",
"resolved": "1.0.2-rc",
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
},
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.6.240923002, )",
Expand All @@ -162,6 +193,12 @@
}
},
"native,Version=v0.0/win10-x64-aot": {
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
"requested": "[1.0.2-rc, )",
"resolved": "1.0.2-rc",
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
},
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.6.240923002, )",
Expand All @@ -179,6 +216,12 @@
}
},
"native,Version=v0.0/win10-x86": {
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
"requested": "[1.0.2-rc, )",
"resolved": "1.0.2-rc",
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
},
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.6.240923002, )",
Expand All @@ -196,6 +239,12 @@
}
},
"native,Version=v0.0/win10-x86-aot": {
"Microsoft.VCRTForwarders.140": {
"type": "Direct",
"requested": "[1.0.2-rc, )",
"resolved": "1.0.2-rc",
"contentHash": "/r+sjtEeCIGyDhobIZ5hSmYhC/dSyGZxf1SxYJpElUhB0LMCktOMFs9gXrauXypIFECpVynNyVjAmJt6hjJ5oQ=="
},
"Microsoft.WindowsAppSDK": {
"type": "Direct",
"requested": "[1.6.240923002, )",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Label="Microsoft.ReactNative Experimental Features">
<RnwNewArch>false</RnwNewArch>
<UseExperimentalNuget>false</UseExperimentalNuget>

<ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ const headerTemplate = `/*
*/
#pragma once

#include <JSValueComposition.h>
#include <NativeModules.h>

#ifdef RNW_NEW_ARCH
#include <JSValueComposition.h>

#include <winrt/Microsoft.ReactNative.Composition.h>
#include <winrt/Microsoft.UI.Composition.h>`;
#include <winrt/Microsoft.UI.Composition.h>
#endif // #ifdef RNW_NEW_ARCH`;

const propsTemplate = `REACT_STRUCT(::_PROPS_NAME_::)
struct ::_PROPS_NAME_:: : winrt::implements<::_PROPS_NAME_::, winrt::Microsoft::ReactNative::IComponentProps> {
Expand Down Expand Up @@ -229,6 +233,8 @@ void Register::_COMPONENT_NAME_::NativeComponent(
const fileTemplate = `
${headerTemplate}

#ifdef RNW_NEW_ARCH

namespace ::_NAMESPACE_:: {

::_COMPONENT_PROP_OBJECT_TYPES_::
Expand All @@ -240,6 +246,8 @@ namespace ::_NAMESPACE_:: {

::_COMPONENT_REGISTRATION_::
} // namespace ::_NAMESPACE_::

#endif // #ifdef RNW_NEW_ARCH
`;

function capitalizeFirstLetter(s: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<PropertyGroup Label="Microsoft.ReactNative Experimental Features">
<UseFabric>true</UseFabric>
<UseWinUI3>true</UseWinUI3>
<RnwNewArch>true</RnwNewArch>
<UseExperimentalNuget>false</UseExperimentalNuget>

<ReactExperimentalFeaturesSet>true</ReactExperimentalFeaturesSet>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
"type": "Project",
"dependencies": {
"Microsoft.ReactNative": "[1.0.0, )",
"Microsoft.WindowsAppSDK": "[1.6.240923002, )"
"Microsoft.VCRTForwarders.140": "[1.0.2-rc, )",
"Microsoft.WindowsAppSDK": "[1.6.240923002, )",
"boost": "[1.83.0, )"
}
},
"common": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,6 @@
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions Condition="'$(UseFabric)'=='true'">USE_FABRIC;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<PropertyGroup Label="UserMacros" />
<ItemGroup>
<ClInclude Include="RNTesterApp-Fabric.h" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
"type": "Project",
"dependencies": {
"Microsoft.ReactNative": "[1.0.0, )",
"Microsoft.WindowsAppSDK": "[1.6.240923002, )"
"Microsoft.VCRTForwarders.140": "[1.0.2-rc, )",
"Microsoft.WindowsAppSDK": "[1.6.240923002, )",
"boost": "[1.83.0, )"
}
},
"common": {
Expand Down
Loading