Skip to content

Commit 65c946f

Browse files
authored
Remove code related to USE_WINUI3 which is now always true (#15393)
* Remove code related to USE_WINUI3 which is now always true * format * Change files * fix * fix * fix * fix * remove test for paper types
1 parent 2873dad commit 65c946f

File tree

103 files changed

+307
-2794
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+307
-2794
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "Remove code related to USE_WINUI3 which is now always true",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/playground/windows/playground-composition/Playground-Composition.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <winrt/Microsoft.UI.Composition.h>
2020
#include <winrt/Microsoft.UI.Composition.interop.h>
2121
#include <winrt/Microsoft.UI.Content.h>
22+
#include <winrt/Microsoft.UI.Dispatching.h>
2223
#include <winrt/Microsoft.UI.Windowing.h>
2324
#include <winrt/Microsoft.UI.interop.h>
2425

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
#ifndef USE_WINUI3
5-
#define XAML_NAMESPACE Windows.UI.Xaml
6-
#else
7-
#define XAML_NAMESPACE Microsoft.UI.Xaml
8-
#endif
9-
104
namespace PlaygroundApp
115
{
126
// Used to notify of layout changes to forward to yoga
137
[default_interface]
148
[webhosthidden]
15-
runtimeclass YogaXamlPanel : XAML_NAMESPACE.Controls.Panel
9+
runtimeclass YogaXamlPanel : Microsoft.UI.Xaml.Controls.Panel
1610
{
1711
}
1812
}

packages/sample-custom-component/windows/SampleCustomComponent/DrawingIsland.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <winrt/Microsoft.UI.Composition.SystemBackdrops.h>
1313
#include <winrt/Microsoft.UI.Composition.h>
1414
#include <winrt/Microsoft.UI.Content.h>
15+
#include <winrt/Microsoft.UI.Dispatching.h>
1516
#include <winrt/Microsoft.UI.Input.h>
1617
#include <winrt/Microsoft.UI.interop.h>
1718
#include <winrt/Windows.System.h>

vnext/Desktop/React.Windows.Desktop.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
</ImportGroup>
9393
<ImportGroup Label="PropertySheets">
9494
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
95-
<Import Project="..\PropertySheets\WinUI.props" Condition="'$(UseWinUI3)'=='true'" />
95+
<Import Project="..\PropertySheets\WinUI.props" />
9696
<!-- Added since we build this project with/without UseExperimentalWinUI3. -->
9797
<Import Project="$(ReactNativeWindowsDir)PropertySheets\NuGet.LockFile.props" />
9898
</ImportGroup>
@@ -273,7 +273,7 @@
273273
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
274274
<PackageReference Include="Microsoft.JavaScript.Hermes" Version="$(HermesVersion)" />
275275
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
276-
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(UseWinUI3)'=='true'" />
276+
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" />
277277
</ItemGroup>
278278
<Choose>
279279
<When Condition="'$(EnableSourceLink)' == 'true'">

vnext/Desktop/module.g.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@
88
void* winrt_make_Microsoft_Internal_TestController();
99
void* winrt_make_Microsoft_ReactNative_Color();
1010
void* winrt_make_Microsoft_ReactNative_ReactNativeIsland();
11-
#ifdef USE_WINUI3
1211
void *winrt_make_Microsoft_ReactNative_Composition_ImageFailedResponse();
1312
void *winrt_make_Microsoft_ReactNative_Composition_StreamImageResponse();
1413
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_UriBrushFactoryImageResponse();
1514
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_MicrosoftCompositionContextHelper();
16-
#endif
1715
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_SystemCompositionContextHelper();
1816
void *winrt_make_Microsoft_ReactNative_Composition_CompositionUIService();
1917
void *winrt_make_Microsoft_ReactNative_Composition_FocusManager();
@@ -57,7 +55,6 @@ void* __stdcall winrt_get_activation_factory([[maybe_unused]] std::wstring_view
5755
if (requal(name, L"Microsoft.ReactNative.ReactNativeIsland")) {
5856
return winrt_make_Microsoft_ReactNative_ReactNativeIsland();
5957
}
60-
#ifdef USE_WINUI3
6158
if (requal(name, L"Microsoft.ReactNative.Composition.ImageFailedResponse")) {
6259
return winrt_make_Microsoft_ReactNative_Composition_ImageFailedResponse();
6360
}
@@ -70,7 +67,6 @@ void* __stdcall winrt_get_activation_factory([[maybe_unused]] std::wstring_view
7067
if (requal(name, L"Microsoft.ReactNative.Composition.Experimental.MicrosoftCompositionContextHelper")) {
7168
return winrt_make_Microsoft_ReactNative_Composition_Experimental_MicrosoftCompositionContextHelper();
7269
}
73-
#endif
7470
if (requal(name, L"Microsoft.ReactNative.Composition.Experimental.SystemCompositionContextHelper")) {
7571
return winrt_make_Microsoft_ReactNative_Composition_Experimental_SystemCompositionContextHelper();
7672
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"version": 1,
3+
"dependencies": {
4+
"native,Version=v0.0": {
5+
"boost": {
6+
"type": "Transitive",
7+
"resolved": "1.83.0",
8+
"contentHash": "cy53VNMzysEMvhBixDe8ujPk67Fcj3v6FPHQnH91NYJNLHpc6jxa2xq9ruCaaJjE4M3YrGSHDi4uUSTGBWw6EQ=="
9+
},
10+
"fmt": {
11+
"type": "Project"
12+
},
13+
"folly": {
14+
"type": "Project",
15+
"dependencies": {
16+
"boost": "[1.83.0, )",
17+
"fmt": "[1.0.0, )"
18+
}
19+
}
20+
},
21+
"native,Version=v0.0/win": {},
22+
"native,Version=v0.0/win-arm64": {},
23+
"native,Version=v0.0/win-x64": {},
24+
"native,Version=v0.0/win-x86": {}
25+
}
26+
}

vnext/Microsoft.ReactNative.Cxx.UnitTests/JSValueReaderTest.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -480,50 +480,6 @@ TEST_CLASS (JSValueReaderTest) {
480480
TestCheck(jsValue["NullValue"] == nullptr);
481481
TestCheck(jsValue["NullValue"] == JSValue::Null);
482482
}
483-
484-
TEST_METHOD(TestReadValueXamlTypes) {
485-
const wchar_t *json =
486-
LR"JSON({
487-
"Thickness1": 2,
488-
"Thickness2": 2.5,
489-
"Thickness3": [1,2,3,4],
490-
"Thickness4": {"left": 1, "top": 2, "right": 3, "bottom": 4},
491-
"CornerRadius1": 2,
492-
"CornerRadius2": 2.5,
493-
"CornerRadius3": [1,2,3,4],
494-
"CornerRadius4": {"topLeft": 1, "topRight": 2, "bottomRight": 3, "bottomLeft": 4},
495-
"Uri1": "https://bing.com",
496-
})JSON";
497-
498-
IJSValueReader reader = make<JsonJSValueReader>(json);
499-
500-
TestCheck(reader.ValueType() == JSValueType::Object);
501-
hstring propertyName;
502-
while (reader.GetNextObjectProperty(/*out*/ propertyName)) {
503-
if (propertyName == L"Thickness1") {
504-
TestCheck(ReadValue<xaml::Thickness>(reader) == xaml::ThicknessHelper::FromUniformLength(2));
505-
} else if (propertyName == L"Thickness2") {
506-
TestCheck(ReadValue<xaml::Thickness>(reader) == xaml::ThicknessHelper::FromUniformLength(2.5));
507-
} else if (propertyName == L"Thickness3") {
508-
TestCheck(ReadValue<xaml::Thickness>(reader) == xaml::ThicknessHelper::FromLengths(1, 2, 3, 4));
509-
} else if (propertyName == L"Thickness4") {
510-
TestCheck(ReadValue<xaml::Thickness>(reader) == xaml::ThicknessHelper::FromLengths(1, 2, 3, 4));
511-
} else if (propertyName == L"CornerRadius1") {
512-
TestCheck(ReadValue<xaml::CornerRadius>(reader) == xaml::CornerRadiusHelper::FromUniformRadius(2));
513-
} else if (propertyName == L"CornerRadius2") {
514-
TestCheck(ReadValue<xaml::CornerRadius>(reader) == xaml::CornerRadiusHelper::FromUniformRadius(2.5));
515-
} else if (propertyName == L"CornerRadius3") {
516-
TestCheck(ReadValue<xaml::CornerRadius>(reader) == xaml::CornerRadiusHelper::FromRadii(1, 2, 3, 4));
517-
} else if (propertyName == L"CornerRadius4") {
518-
TestCheck(ReadValue<xaml::CornerRadius>(reader) == xaml::CornerRadiusHelper::FromRadii(1, 2, 3, 4));
519-
} else if (propertyName == L"Uri1") {
520-
// Uri has no default ctor, so instead we read this way:
521-
auto jsValue = JSValue::ReadFrom(reader);
522-
auto uri = jsValue.To<Uri>();
523-
TestCheck(uri.RawUri() == L"https://bing.com");
524-
}
525-
}
526-
}
527483
};
528484

529485
} // namespace winrt::Microsoft::ReactNative

vnext/Microsoft.ReactNative.Cxx.UnitTests/Microsoft.ReactNative.Cxx.UnitTests.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<WholeProgramOptimization>true</WholeProgramOptimization>
4444
</PropertyGroup>
4545
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
46+
<Import Project="..\PropertySheets\WinUI.props" />
4647
<ImportGroup Label="ExtensionSettings">
4748
</ImportGroup>
4849
<ImportGroup Label="Shared">
@@ -157,6 +158,8 @@
157158
<Midl Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\RedBoxHandler.idl" />
158159
</ItemGroup>
159160
<ItemGroup>
161+
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)"
162+
Condition="'$(OverrideWinUIPackage)'!='true'" />
160163
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.7" />
161164
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
162165
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />

vnext/Microsoft.ReactNative.Cxx.UnitTests/ReactContextTest.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ struct ReactContextStub : implements<ReactContextStub, IReactContext> {
3636
VerifyElseCrashSz(false, "Not implemented");
3737
}
3838

39-
void DispatchEvent(
40-
xaml::FrameworkElement const & /*view*/,
41-
hstring const & /*eventName*/,
42-
JSValueArgWriter const & /*eventDataArgWriter*/) noexcept {
43-
VerifyElseCrashSz(false, "Not implemented");
44-
}
45-
4639
void CallJSFunction(
4740
hstring const &moduleName,
4841
hstring const &functionName,

0 commit comments

Comments
 (0)