Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Remove code related to USE_WINUI3 which is now always true",
"packageName": "react-native-windows",
"email": "30809111+acoates-ms@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <winrt/Microsoft.UI.Composition.h>
#include <winrt/Microsoft.UI.Composition.interop.h>
#include <winrt/Microsoft.UI.Content.h>
#include <winrt/Microsoft.UI.Dispatching.h>
#include <winrt/Microsoft.UI.Windowing.h>
#include <winrt/Microsoft.UI.interop.h>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#ifndef USE_WINUI3
#define XAML_NAMESPACE Windows.UI.Xaml
#else
#define XAML_NAMESPACE Microsoft.UI.Xaml
#endif

namespace PlaygroundApp
{
// Used to notify of layout changes to forward to yoga
[default_interface]
[webhosthidden]
runtimeclass YogaXamlPanel : XAML_NAMESPACE.Controls.Panel
runtimeclass YogaXamlPanel : Microsoft.UI.Xaml.Controls.Panel
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <winrt/Microsoft.UI.Composition.SystemBackdrops.h>
#include <winrt/Microsoft.UI.Composition.h>
#include <winrt/Microsoft.UI.Content.h>
#include <winrt/Microsoft.UI.Dispatching.h>
#include <winrt/Microsoft.UI.Input.h>
#include <winrt/Microsoft.UI.interop.h>
#include <winrt/Windows.System.h>
Expand Down
4 changes: 2 additions & 2 deletions vnext/Desktop/React.Windows.Desktop.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\PropertySheets\WinUI.props" Condition="'$(UseWinUI3)'=='true'" />
<Import Project="..\PropertySheets\WinUI.props" />
<!-- Added since we build this project with/without UseExperimentalWinUI3. -->
<Import Project="$(ReactNativeWindowsDir)PropertySheets\NuGet.LockFile.props" />
</ImportGroup>
Expand Down Expand Up @@ -273,7 +273,7 @@
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.JavaScript.Hermes" Version="$(HermesVersion)" />
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" Condition="'$(UseWinUI3)'=='true'" />
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)" />
</ItemGroup>
<Choose>
<When Condition="'$(EnableSourceLink)' == 'true'">
Expand Down
4 changes: 0 additions & 4 deletions vnext/Desktop/module.g.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@
void* winrt_make_Microsoft_Internal_TestController();
void* winrt_make_Microsoft_ReactNative_Color();
void* winrt_make_Microsoft_ReactNative_ReactNativeIsland();
#ifdef USE_WINUI3
void *winrt_make_Microsoft_ReactNative_Composition_ImageFailedResponse();
void *winrt_make_Microsoft_ReactNative_Composition_StreamImageResponse();
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_UriBrushFactoryImageResponse();
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_MicrosoftCompositionContextHelper();
#endif
void *winrt_make_Microsoft_ReactNative_Composition_Experimental_SystemCompositionContextHelper();
void *winrt_make_Microsoft_ReactNative_Composition_CompositionUIService();
void *winrt_make_Microsoft_ReactNative_Composition_FocusManager();
Expand Down Expand Up @@ -57,7 +55,6 @@ void* __stdcall winrt_get_activation_factory([[maybe_unused]] std::wstring_view
if (requal(name, L"Microsoft.ReactNative.ReactNativeIsland")) {
return winrt_make_Microsoft_ReactNative_ReactNativeIsland();
}
#ifdef USE_WINUI3
if (requal(name, L"Microsoft.ReactNative.Composition.ImageFailedResponse")) {
return winrt_make_Microsoft_ReactNative_Composition_ImageFailedResponse();
}
Expand All @@ -70,7 +67,6 @@ void* __stdcall winrt_get_activation_factory([[maybe_unused]] std::wstring_view
if (requal(name, L"Microsoft.ReactNative.Composition.Experimental.MicrosoftCompositionContextHelper")) {
return winrt_make_Microsoft_ReactNative_Composition_Experimental_MicrosoftCompositionContextHelper();
}
#endif
if (requal(name, L"Microsoft.ReactNative.Composition.Experimental.SystemCompositionContextHelper")) {
return winrt_make_Microsoft_ReactNative_Composition_Experimental_SystemCompositionContextHelper();
}
Expand Down
26 changes: 26 additions & 0 deletions vnext/FollyWin32/packages.lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"version": 1,
"dependencies": {
"native,Version=v0.0": {
"boost": {
"type": "Transitive",
"resolved": "1.83.0",
"contentHash": "cy53VNMzysEMvhBixDe8ujPk67Fcj3v6FPHQnH91NYJNLHpc6jxa2xq9ruCaaJjE4M3YrGSHDi4uUSTGBWw6EQ=="
},
"fmt": {
"type": "Project"
},
"folly": {
"type": "Project",
"dependencies": {
"boost": "[1.83.0, )",
"fmt": "[1.0.0, )"
}
}
},
"native,Version=v0.0/win": {},
"native,Version=v0.0/win-arm64": {},
"native,Version=v0.0/win-x64": {},
"native,Version=v0.0/win-x86": {}
}
}
44 changes: 0 additions & 44 deletions vnext/Microsoft.ReactNative.Cxx.UnitTests/JSValueReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,50 +480,6 @@ TEST_CLASS (JSValueReaderTest) {
TestCheck(jsValue["NullValue"] == nullptr);
TestCheck(jsValue["NullValue"] == JSValue::Null);
}

TEST_METHOD(TestReadValueXamlTypes) {
const wchar_t *json =
LR"JSON({
"Thickness1": 2,
"Thickness2": 2.5,
"Thickness3": [1,2,3,4],
"Thickness4": {"left": 1, "top": 2, "right": 3, "bottom": 4},
"CornerRadius1": 2,
"CornerRadius2": 2.5,
"CornerRadius3": [1,2,3,4],
"CornerRadius4": {"topLeft": 1, "topRight": 2, "bottomRight": 3, "bottomLeft": 4},
"Uri1": "https://bing.com",
})JSON";

IJSValueReader reader = make<JsonJSValueReader>(json);

TestCheck(reader.ValueType() == JSValueType::Object);
hstring propertyName;
while (reader.GetNextObjectProperty(/*out*/ propertyName)) {
if (propertyName == L"Thickness1") {
TestCheck(ReadValue<xaml::Thickness>(reader) == xaml::ThicknessHelper::FromUniformLength(2));
} else if (propertyName == L"Thickness2") {
TestCheck(ReadValue<xaml::Thickness>(reader) == xaml::ThicknessHelper::FromUniformLength(2.5));
} else if (propertyName == L"Thickness3") {
TestCheck(ReadValue<xaml::Thickness>(reader) == xaml::ThicknessHelper::FromLengths(1, 2, 3, 4));
} else if (propertyName == L"Thickness4") {
TestCheck(ReadValue<xaml::Thickness>(reader) == xaml::ThicknessHelper::FromLengths(1, 2, 3, 4));
} else if (propertyName == L"CornerRadius1") {
TestCheck(ReadValue<xaml::CornerRadius>(reader) == xaml::CornerRadiusHelper::FromUniformRadius(2));
} else if (propertyName == L"CornerRadius2") {
TestCheck(ReadValue<xaml::CornerRadius>(reader) == xaml::CornerRadiusHelper::FromUniformRadius(2.5));
} else if (propertyName == L"CornerRadius3") {
TestCheck(ReadValue<xaml::CornerRadius>(reader) == xaml::CornerRadiusHelper::FromRadii(1, 2, 3, 4));
} else if (propertyName == L"CornerRadius4") {
TestCheck(ReadValue<xaml::CornerRadius>(reader) == xaml::CornerRadiusHelper::FromRadii(1, 2, 3, 4));
} else if (propertyName == L"Uri1") {
// Uri has no default ctor, so instead we read this way:
auto jsValue = JSValue::ReadFrom(reader);
auto uri = jsValue.To<Uri>();
TestCheck(uri.RawUri() == L"https://bing.com");
}
}
}
};

} // namespace winrt::Microsoft::ReactNative
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="..\PropertySheets\WinUI.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
Expand Down Expand Up @@ -157,6 +158,8 @@
<Midl Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\RedBoxHandler.idl" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="$(WinUIPackageName)" Version="$(WinUIPackageVersion)"
Condition="'$(OverrideWinUIPackage)'!='true'" />
<PackageReference Include="Microsoft.googletest.v140.windesktop.msvcstl.static.rt-dyn" Version="1.8.1.7" />
<PackageReference Include="Microsoft.Windows.CppWinRT" Version="$(CppWinRTVersion)" PrivateAssets="all" />
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@ struct ReactContextStub : implements<ReactContextStub, IReactContext> {
VerifyElseCrashSz(false, "Not implemented");
}

void DispatchEvent(
xaml::FrameworkElement const & /*view*/,
hstring const & /*eventName*/,
JSValueArgWriter const & /*eventDataArgWriter*/) noexcept {
VerifyElseCrashSz(false, "Not implemented");
}

void CallJSFunction(
hstring const &moduleName,
hstring const &functionName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "future/future.h"

#include <functional>
#include "CppWinRTIncludes.h"
#include "JSValue.h"
#include "NativeModules.h"

Expand Down Expand Up @@ -142,11 +141,6 @@ struct ReactContextMock : implements<ReactContextMock, IReactContext> {
VerifyElseCrashSz(false, "Not implemented");
}

void DispatchEvent(
xaml::FrameworkElement const & /*view*/,
hstring const & /*eventName*/,
JSValueArgWriter const & /*eventDataArgWriter*/) noexcept {}

void CallJSFunction(
hstring const &moduleName,
hstring const &functionName,
Expand Down
Loading
Loading