From 94b47e5ae8a12a396c2c1b481b821237bfa3e25f Mon Sep 17 00:00:00 2001 From: Javier Calvarro Nelson Date: Mon, 27 Nov 2023 22:48:38 +0100 Subject: [PATCH] [Blazor] Update MSBuild targets so they get imported correctly (7.0) (#52298) ## Issue: Microsoft.AspNetCore.Components.WebView.props is not imported by Maui applications This issue pertains to the non-importation of Microsoft.AspNetCore.Components.WebView.props by Maui applications. The file has been relocated within the package to ensure its correct pickup and importation during the restore/build process. Fixes #42348. ## Description The inability of Maui applications to rely on JavaScript (JS) initializers, particularly in the case of Fluent UI, is impacted by this issue. The runtime searches for the initializer's definition in a specific location, which is configured in the props file of the package. ## Impact on Customers The malfunction of JS initializers in Blazor Hybrid has significant implications for both library authors and end users. Library authors may find their libraries' functionality restricted due to this bug. JS initializers, a feature in Blazor, enable library authors to inject scripts onto the page at the start of the app. These scripts can augment functionality, enhance user interfaces, or facilitate third-party service integration. For instance, a library author might employ a JS initializer to inject a script that integrates with a mapping service, thereby providing real-time location updates within a Blazor app. This functionality would be unavailable in Blazor Hybrid apps due to this bug. End users may be unable to use certain libraries, or those libraries may not function as anticipated in Blazor Hybrid apps. If a user were to use a Blazor Hybrid app that relies on the aforementioned mapping library, they would not receive the real-time location updates that they would in a regular Blazor app. This could result in an inferior user experience, and in some cases, render the app unusable. Users and library authors are compelled to manually inject the script onto the page, and some functionality (like configuring Blazor before it starts) is not available in this mode. ## Regression? - [ ] Yes - [X] No ## Risk - [ ] High - [ ] Medium - [X] Low The failure to load a file from a NuGet package impacts the build. The change causes the file to load at build time, enabling the rest of the pipeline to function as expected. ## Verification - [X] Manual (required) - [ ] Automated The changes were made locally on the package cache and ensured the file got imported. ## Packaging changes reviewed? - [ ] Yes - [ ] No - [x] N/A ## When servicing release/2.1 - [ ] Make necessary changes in eng/PatchConfig.props --- .../testassets/PhotinoTestApp/PhotinoTestApp.csproj | 2 +- .../WebView/src/Microsoft.AspNetCore.Components.WebView.csproj | 2 +- .../Microsoft.AspNetCore.Components.WebView.props | 0 .../Microsoft.AspNetCore.Components.WebView.props | 3 +++ .../Microsoft.AspNetCore.Components.WebView.props | 3 +++ 5 files changed, 8 insertions(+), 2 deletions(-) rename src/Components/WebView/WebView/src/{buildTransitive/any => build}/Microsoft.AspNetCore.Components.WebView.props (100%) create mode 100644 src/Components/WebView/WebView/src/buildMultiTargeting/Microsoft.AspNetCore.Components.WebView.props create mode 100644 src/Components/WebView/WebView/src/buildTransitive/Microsoft.AspNetCore.Components.WebView.props diff --git a/src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/PhotinoTestApp.csproj b/src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/PhotinoTestApp.csproj index 2e581d2a73f9..009fa65b06dc 100644 --- a/src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/PhotinoTestApp.csproj +++ b/src/Components/WebView/Samples/PhotinoPlatform/testassets/PhotinoTestApp/PhotinoTestApp.csproj @@ -7,7 +7,7 @@ false - + diff --git a/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj b/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj index fb3ef95fb4a8..a401a79bb987 100644 --- a/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj +++ b/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj @@ -33,7 +33,7 @@ - + diff --git a/src/Components/WebView/WebView/src/buildTransitive/any/Microsoft.AspNetCore.Components.WebView.props b/src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props similarity index 100% rename from src/Components/WebView/WebView/src/buildTransitive/any/Microsoft.AspNetCore.Components.WebView.props rename to src/Components/WebView/WebView/src/build/Microsoft.AspNetCore.Components.WebView.props diff --git a/src/Components/WebView/WebView/src/buildMultiTargeting/Microsoft.AspNetCore.Components.WebView.props b/src/Components/WebView/WebView/src/buildMultiTargeting/Microsoft.AspNetCore.Components.WebView.props new file mode 100644 index 000000000000..1a28c40b8013 --- /dev/null +++ b/src/Components/WebView/WebView/src/buildMultiTargeting/Microsoft.AspNetCore.Components.WebView.props @@ -0,0 +1,3 @@ + + + diff --git a/src/Components/WebView/WebView/src/buildTransitive/Microsoft.AspNetCore.Components.WebView.props b/src/Components/WebView/WebView/src/buildTransitive/Microsoft.AspNetCore.Components.WebView.props new file mode 100644 index 000000000000..1a28c40b8013 --- /dev/null +++ b/src/Components/WebView/WebView/src/buildTransitive/Microsoft.AspNetCore.Components.WebView.props @@ -0,0 +1,3 @@ + + +