Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blazor] Fix static file handling so that it special cases modules.json (main) #18953

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

javiercn
Copy link
Member

@javiercn javiercn commented Nov 22, 2023

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 dotnet/aspnetcore#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
  • No

Risk

  • High
  • Medium
  • 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

  • Manual (required)
  • Automated

The changes were made locally on the package cache and ensured the file got imported.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

When servicing release/2.1

  • Make necessary changes in eng/PatchConfig.props

@javiercn javiercn force-pushed the javiercn/fix-static-asset-handling-main branch from 066d289 to 7026081 Compare November 24, 2023 10:45
@halter73
Copy link
Member

Fixed issue link: dotnet/aspnetcore#42348. I cannot edit the summary myself in this repo.

@mkArtakMSFT mkArtakMSFT merged commit 4a31ee1 into main Nov 27, 2023
47 checks passed
@mkArtakMSFT mkArtakMSFT deleted the javiercn/fix-static-asset-handling-main branch November 27, 2023 22:52
@rmarinho
Copy link
Member

Hmm, seems we might have some issue with this when creating our test templates..

D:\a\_work\1\s\bin\dotnet\sdk\8.0.100\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(25,5): error : IOException: The process cannot access the file 'D:\a\_work\1\s\src\Controls\samples\Controls.Sample\obj\Release\net8.0-android\staticwebassets.publish.json' because it is being used by another process. [D:\a\_work\1\s\src\Controls\samples\Controls.Sample\Maui.Controls.Sample.csproj::TargetFramework=net8.0-android]

https://dev.azure.com/xamarin/public/_build/results?buildId=102338&view=logs&j=7000cffb-6b68-5cac-5fde-d77b5b795ab9&s=02e1de88-e742-55f2-1150-896beebccf0c&t=9d371a75-5d60-5e8e-a428-cc68ae0bf1de&l=2118

@rmarinho
Copy link
Member

This keeps failing a lot in our CI. can someone take a look from the @dotnet/dotnet-maui-blazor-eng team? We are going to revert the PR from main now

@github-actions github-actions bot locked and limited conversation to collaborators Dec 30, 2023
@samhouts samhouts added the fixed-in-8.0.6 Look for this fix in 8.0.6 SR1! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-8.0.6 Look for this fix in 8.0.6 SR1!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Blazor] Microsoft.AspNetCore.Components.WebView.props is not imported by Maui apps
7 participants