Skip to content

Commit bd14217

Browse files
committed
Update WindowsAppSDK version to 1.7.250401001 (microsoft#14605)
* Update WindowsAppSDK version to 1.7.250401001 * Change files * Update nuget lock files * more nuget lock file updates * Bump webview props * updated lock files
1 parent 5218bfc commit bd14217

33 files changed

+322
-472
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": "Update WindowsAppSDK version to 1.7.250401001",
4+
"packageName": "react-native-windows",
5+
"email": "30809111+acoates-ms@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/playground/windows/playground-composition/CustomComponent.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,17 @@ struct CustomComponentUserData : winrt::implements<CustomComponentUserData, winr
8383
bool nativeLayout) {
8484
nativeLayout;
8585
islandView;
86-
#ifdef USE_EXPERIMENTAL_WINUI3
8786
m_xamlIsland = winrt::Microsoft::UI::Xaml::XamlIsland{};
8887
m_xamlIsland.Content(CreateXamlButtonContent(nativeLayout));
8988
islandView.Connect(m_xamlIsland.ContentIsland());
90-
#endif
9189
}
9290

9391
void PropsChanged(
9492
const winrt::Microsoft::ReactNative::Composition::ContentIslandComponentView & /*islandView*/,
9593
const winrt::Microsoft::ReactNative::IComponentProps &newProps,
9694
const winrt::Microsoft::ReactNative::IComponentProps & /*oldProps*/) {
9795
auto myProps = newProps.as<CustomXamlComponentProps>();
98-
#ifdef USE_EXPERIMENTAL_WINUI3
9996
m_buttonLabelTextBlock.Text(myProps->label);
100-
#endif
10197
}
10298

10399
void FinalizeUpdates() noexcept {
@@ -167,13 +163,11 @@ struct CustomComponentUserData : winrt::implements<CustomComponentUserData, winr
167163
userData->Initialize(islandView, nativeLayout);
168164
islandView.UserData(*userData);
169165

170-
#ifdef USE_EXPERIMENTAL_WINUI3
171166
islandView.Destroying([](const winrt::IInspectable &sender, const winrt::IInspectable & /*args*/) {
172167
auto senderIslandView = sender.as<winrt::Microsoft::ReactNative::Composition::ContentIslandComponentView>();
173168
auto userData = senderIslandView.UserData().as<CustomComponentUserData>();
174169
userData->m_xamlIsland.Close();
175170
});
176-
#endif
177171
});
178172

179173
builder.SetUpdateEventEmitterHandler([](const winrt::Microsoft::ReactNative::ComponentView &source,
@@ -231,9 +225,7 @@ struct CustomComponentUserData : winrt::implements<CustomComponentUserData, winr
231225
winrt::Microsoft::UI::Xaml::Controls::TextBlock m_buttonLabelTextBlock{nullptr};
232226
winrt::Microsoft::ReactNative::IComponentState m_state;
233227
std::unique_ptr<CustomXamlComponentEventEmitter> m_eventEmitter{nullptr};
234-
#ifdef USE_EXPERIMENTAL_WINUI3
235228
winrt::Microsoft::UI::Xaml::XamlIsland m_xamlIsland{nullptr};
236-
#endif
237229
};
238230

239231
static void RegisterViewComponent(winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder) {

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,7 @@ struct CompReactPackageProvider
104104
: winrt::implements<CompReactPackageProvider, winrt::Microsoft::ReactNative::IReactPackageProvider> {
105105
public: // IReactPackageProvider
106106
void CreatePackage(winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder) noexcept {
107-
#ifdef USE_EXPERIMENTAL_WINUI3
108107
RegisterCustomComponent(packageBuilder);
109-
#else
110-
UNREFERENCED_PARAMETER(packageBuilder);
111-
#endif // USE_EXPERIMENTAL_WINUI3
112108
}
113109
};
114110

@@ -715,12 +711,9 @@ _Use_decl_annotations_ int CALLBACK WinMain(HINSTANCE instance, HINSTANCE, PSTR
715711
winrt::Microsoft::UI::Dispatching::DispatcherQueueController::CreateOnCurrentThread();
716712
g_liftedCompositor = winrt::Microsoft::UI::Composition::Compositor();
717713

718-
// We only want to init XAML if we are using XAML islands
719-
#ifdef USE_EXPERIMENTAL_WINUI3
720714
// Island-support: Create our custom Xaml App object. This is needed to properly use the controls and metadata
721715
// in Microsoft.ui.xaml.controls.dll.
722716
auto playgroundApp{winrt::make<winrt::Playground::implementation::App>()};
723-
#endif
724717

725718
return RunPlayground(showCmd, false);
726719
}

packages/playground/windows/playground-composition/packages.lock.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
},
2929
"Microsoft.WindowsAppSDK": {
3030
"type": "Direct",
31-
"requested": "[1.6.240923002, )",
32-
"resolved": "1.6.240923002",
33-
"contentHash": "7PfOz2scXU+AAM/GYge+f6s7k3DVI+R1P8MNPZQr56GOPCGw+csvcg3S5KZg47z/o04kNvWH3GKtWT1ML9tpZw==",
31+
"requested": "[1.7.250401001, )",
32+
"resolved": "1.7.250401001",
33+
"contentHash": "kPsJ2LZoo3Xs/6FtIWMZRGnQ2ZMx9zDa0ZpqRGz1qwZr0gwwlXZJTmngaA1Ym2AHmIa05NtX2jEE2He8CzfhTg==",
3434
"dependencies": {
35-
"Microsoft.Web.WebView2": "1.0.2651.64",
35+
"Microsoft.Web.WebView2": "1.0.2903.40",
3636
"Microsoft.Windows.SDK.BuildTools": "10.0.22621.756"
3737
}
3838
},
@@ -57,8 +57,8 @@
5757
},
5858
"Microsoft.Web.WebView2": {
5959
"type": "Transitive",
60-
"resolved": "1.0.2651.64",
61-
"contentHash": "f5sc/vcAoTCTEW7Nqzp4galAuTRguZViw8ksn+Nx2uskEBPm0/ubzy6gVjvXS/P96jLS89C8T9I0hPc417xpNg=="
60+
"resolved": "1.0.2903.40",
61+
"contentHash": "THrzYAnJgE3+cNH+9Epr44XjoZoRELdVpXlWGPs6K9C9G6TqyDfVCeVAR/Er8ljLitIUX5gaSkPsy9wRhD1sgQ=="
6262
},
6363
"Microsoft.Windows.SDK.BuildTools": {
6464
"type": "Transitive",
@@ -77,8 +77,8 @@
7777
"folly": {
7878
"type": "Project",
7979
"dependencies": {
80-
"boost": "[1.83.0, )",
81-
"fmt": "[1.0.0, )"
80+
"Fmt": "[1.0.0, )",
81+
"boost": "[1.83.0, )"
8282
}
8383
},
8484
"microsoft.reactnative": {
@@ -88,7 +88,7 @@
8888
"Folly": "[1.0.0, )",
8989
"Microsoft.JavaScript.Hermes": "[0.1.23, )",
9090
"Microsoft.SourceLink.GitHub": "[1.1.1, )",
91-
"Microsoft.WindowsAppSDK": "[1.6.240923002, )",
91+
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
9292
"ReactCommon": "[1.0.0, )",
9393
"boost": "[1.83.0, )"
9494
}
@@ -105,7 +105,7 @@
105105
"dependencies": {
106106
"Microsoft.ReactNative": "[1.0.0, )",
107107
"Microsoft.VCRTForwarders.140": "[1.0.2-rc, )",
108-
"Microsoft.WindowsAppSDK": "[1.6.240923002, )",
108+
"Microsoft.WindowsAppSDK": "[1.7.250401001, )",
109109
"boost": "[1.83.0, )"
110110
}
111111
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#include "CalendarView.h"
66

7-
#if defined(RNW_NEW_ARCH) && defined(USE_EXPERIMENTAL_WINUI3)
7+
#if defined(RNW_NEW_ARCH)
88

99
#include "codegen/react/components/SampleCustomComponent/CalendarView.g.h"
1010

@@ -71,4 +71,4 @@ void RegisterCalendarViewComponentView(winrt::Microsoft::ReactNative::IReactPack
7171
});
7272
}
7373

74-
#endif // defined(RNW_NEW_ARCH) && defined(USE_EXPERIMENTAL_WINUI3)
74+
#endif // defined(RNW_NEW_ARCH)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#if defined(RNW_NEW_ARCH) && defined(USE_EXPERIMENTAL_WINUI3)
3+
#if defined(RNW_NEW_ARCH)
44

55
void RegisterCalendarViewComponentView(winrt::Microsoft::ReactNative::IReactPackageBuilder const &packageBuilder);
66

7-
#endif // defined(RNW_NEW_ARCH) && defined(USE_EXPERIMENTAL_WINUI3)
7+
#endif // defined(RNW_NEW_ARCH)

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

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ DrawingIsland::DrawingIsland(const winrt::Microsoft::UI::Composition::Compositor
7676

7777
DrawingIsland::~DrawingIsland() {
7878
m_siteBridge = nullptr;
79-
#ifdef USE_EXPERIMENTAL_WINUI3
8079
m_popupSiteBridge = nullptr;
81-
#endif
8280
// m_fragmentRoot = nullptr;
8381
m_compositor = nullptr;
8482
}
@@ -187,9 +185,7 @@ void DrawingIsland::RightClickAndRelease(const winrt::float2 currentPoint) {
187185

188186
void DrawingIsland::SetHostBridge(const winrt::IContentSiteBridge &bridge) {
189187
m_siteBridge = bridge;
190-
#ifdef USE_EXPERIMENTAL_WINUI3
191-
m_popupSiteBridge = m_siteBridge.try_as<winrt::PopupWindowSiteBridge>();
192-
#endif
188+
m_popupSiteBridge = m_siteBridge.try_as<winrt::DesktopPopupSiteBridge>();
193189
Accessibility_Initialize();
194190
SystemBackdrop_Initialize();
195191
EvaluateLightDismissPopup();
@@ -470,11 +466,7 @@ void DrawingIsland::Input_Initialize() {
470466
}
471467

472468
bool DrawingIsland::IsHostedByPopupWindowSiteBridge() {
473-
#ifdef USE_EXPERIMENTAL_WINUI3
474469
return (m_popupSiteBridge != nullptr);
475-
#else
476-
return false;
477-
#endif
478470
}
479471

480472
bool DrawingIsland::Input_OnKeyDown(winrt::Windows::System::VirtualKey virtualKey) {
@@ -671,17 +663,11 @@ void DrawingIsland::OnRightClick(const winrt::float2 point) {
671663

672664
if (selectedVisual != nullptr) {
673665
// Right button brings up a context menu if clicked on a visual
674-
#ifdef USE_EXPERIMENTAL_WINUI3
675666
if (m_siteBridge != nullptr) {
676-
// Create a new popup window.
677-
auto desktopBridge2 = m_siteBridge.try_as<winrt::IDesktopSiteBridge2>();
678-
auto popupBridge = desktopBridge2.TryCreatePopupSiteBridge();
679-
680667
// Convert the current position to screen coordinates and display.
681668
winrt::Rect initialPosition(point.x, point.y, 200, 300);
682669

683670
auto convertedPosition = m_island.CoordinateConverter().ConvertLocalToScreen(initialPosition);
684-
popupBridge.MoveAndResize(convertedPosition);
685671

686672
// Put a new instance of the content and connect it with the popup bridge.
687673
auto popupContent = winrt::make_self<DrawingIsland>(m_compositor);
@@ -691,8 +677,13 @@ void DrawingIsland::OnRightClick(const winrt::float2 point) {
691677
popupContent->LightDismissPopup(m_lightDismissPopup);
692678
popupContent->UseSystemBackdrop(m_useSystemBackdrop);
693679

680+
#ifdef USE_EXPERIMENTAL_WINUI3
694681
// Funnel through the existing backdrop controller, we do not want to create a new one for every popup.
695682
popupContent->SetSystemBackdropController(m_backdropController);
683+
#endif
684+
685+
auto popupBridge = winrt::Microsoft::UI::Content::DesktopPopupSiteBridge::Create(popupContent->Island());
686+
popupBridge.MoveAndResize(convertedPosition);
696687

697688
// Connect the content and input site to the DesktopWindowDrawingIslandBridge
698689
popupBridge.Connect(popupContent->Island());
@@ -723,7 +714,6 @@ void DrawingIsland::OnRightClick(const winrt::float2 point) {
723714
childFragment->SetParent(parentFragment);
724715
*/
725716
}
726-
#endif
727717
}
728718
}
729719

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,7 @@ void Accessibility_OnAutomationProviderRequested(
233233
// Popups
234234
// https://task.ms/32440118: Add ContentIsland.SiteBridge to avoid this workaround
235235
winrt::IContentSiteBridge m_siteBridge{nullptr};
236-
#ifdef USE_EXPERIMENTAL_WINUI3
237-
winrt::PopupWindowSiteBridge m_popupSiteBridge{nullptr};
238-
#endif
236+
winrt::DesktopPopupSiteBridge m_popupSiteBridge{nullptr};
239237

240238
// SystemBackdrops for Popups
241239
winrt::ISystemBackdropControllerWithTargets m_backdropController{nullptr};

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ void ReactPackageProvider::CreatePackage(IReactPackageBuilder const &packageBuil
2121
#ifdef RNW_NEW_ARCH
2222
RegisterDrawingIslandComponentView(packageBuilder);
2323
RegisterMovingLightNativeComponent(packageBuilder);
24-
#endif // #ifdef RNW_NEW_ARCH
25-
26-
#if defined(RNW_NEW_ARCH) && defined(USE_EXPERIMENTAL_WINUI3)
2724
RegisterCalendarViewComponentView(packageBuilder);
28-
#endif // #if defined(RNW_NEW_ARCH) && defined(USE_EXPERIMENTAL_WINUI3)
25+
#endif // #ifdef RNW_NEW_ARCH
2926
}
3027

3128
} // namespace winrt::SampleCustomComponent::implementation

packages/sample-custom-component/windows/SampleCustomComponent/codegen/react/components/SampleCustomComponent/CalendarView.g.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,31 +158,31 @@ void RegisterCalendarViewNativeComponent(
158158
userData->UpdateEventEmitter(std::make_shared<CalendarViewEventEmitter>(eventEmitter));
159159
});
160160

161-
if constexpr (&TUserData::FinalizeUpdate != &BaseCalendarView<TUserData>::FinalizeUpdate) {
161+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::FinalizeUpdate != &BaseCalendarView<TUserData>::FinalizeUpdate) {
162162
builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
163163
winrt::Microsoft::ReactNative::ComponentViewUpdateMask mask) noexcept {
164164
auto userData = view.UserData().as<TUserData>();
165165
userData->FinalizeUpdate(view, mask);
166166
});
167167
}
168168

169-
if constexpr (&TUserData::UpdateState != &BaseCalendarView<TUserData>::UpdateState) {
169+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UpdateState != &BaseCalendarView<TUserData>::UpdateState) {
170170
builder.SetUpdateStateHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
171171
const winrt::Microsoft::ReactNative::IComponentState &newState) noexcept {
172172
auto userData = view.UserData().as<TUserData>();
173173
userData->UpdateState(view, newState);
174174
});
175175
}
176176

177-
if constexpr (&TUserData::MountChildComponentView != &BaseCalendarView<TUserData>::MountChildComponentView) {
177+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::MountChildComponentView != &BaseCalendarView<TUserData>::MountChildComponentView) {
178178
builder.SetMountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
179179
const winrt::Microsoft::ReactNative::MountChildComponentViewArgs &args) noexcept {
180180
auto userData = view.UserData().as<TUserData>();
181181
return userData->MountChildComponentView(view, args);
182182
});
183183
}
184184

185-
if constexpr (&TUserData::UnmountChildComponentView != &BaseCalendarView<TUserData>::UnmountChildComponentView) {
185+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::UnmountChildComponentView != &BaseCalendarView<TUserData>::UnmountChildComponentView) {
186186
builder.SetUnmountChildComponentViewHandler([](const winrt::Microsoft::ReactNative::ComponentView &view,
187187
const winrt::Microsoft::ReactNative::UnmountChildComponentViewArgs &args) noexcept {
188188
auto userData = view.UserData().as<TUserData>();
@@ -192,13 +192,13 @@ void RegisterCalendarViewNativeComponent(
192192

193193
compBuilder.SetViewComponentViewInitializer([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
194194
auto userData = winrt::make_self<TUserData>();
195-
if constexpr (&TUserData::Initialize != &BaseCalendarView<TUserData>::Initialize) {
195+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::Initialize != &BaseCalendarView<TUserData>::Initialize) {
196196
userData->Initialize(view);
197197
}
198198
view.UserData(*userData);
199199
});
200200

201-
if constexpr (&TUserData::CreateVisual != &BaseCalendarView<TUserData>::CreateVisual) {
201+
if CONSTEXPR_SUPPORTED_ON_VIRTUAL_FN_ADDRESS (&TUserData::CreateVisual != &BaseCalendarView<TUserData>::CreateVisual) {
202202
compBuilder.SetCreateVisualHandler([](const winrt::Microsoft::ReactNative::ComponentView &view) noexcept {
203203
auto userData = view.UserData().as<TUserData>();
204204
return userData->CreateVisual(view);

0 commit comments

Comments
 (0)