-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Add package for consuming Blazor framework assets #58721
Conversation
Haven't looked at the PR yet, but we should probably name it in a way that is related to the framework reference and include It might also be interesting if we find a way of precluding explicit consumption through a package reference (we can have MSBuild logic to potentially detect that scenario). |
<Description>ASP.NET Core static framework assets</Description> | ||
<PackageId>Microsoft.AspNetCore.Assets.Pack</PackageId> | ||
<IsPackable>true</IsPackable> | ||
<OutputType>Library</OutputType> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why library
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not? This is not producing any exe/dll
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wanted to make sure it's intentional, I don't know off the top of my head if this controls any behavior we care about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's conceptually a library
d65dd82
to
fa5f52d
Compare
<Error | ||
Condition="'@(_MissingBlazorJSFile)' != ''" | ||
Text="'%(_MissingBlazorJSFile.Identity)' does not exist. Run 'npm run build' in the repo root to generate the file." /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having troubles getting this to build inside the VMR. Don't we need something similar to
aspnetcore/src/Components/WebView/WebView/src/Microsoft.AspNetCore.Components.WebView.csproj
Lines 66 to 72 in 8d0f798
<!-- blazor.webview.js should exist after eng/Npm.Workspace.nodeproj builds. Fall back if not. --> | |
<Target Name="_CheckBlazorWebViewJSPath" AfterTargets="ResolveProjectReferences" Condition=" !EXISTS('$(BlazorWebViewJSFile)') "> | |
<Warning Text="'$(BlazorWebViewJSFile)' does not exist. Falling back to checked-in copy." /> | |
<PropertyGroup> | |
<BlazorWebViewJSFile>..\..\..\Web.JS\dist\Release\$(BlazorWebViewJSFilename)</BlazorWebViewJSFile> | |
</PropertyGroup> | |
</Target> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK my issue with building this inside the VMR is unrelated to this change. But I wonder if a fallback should still get added as the other project has it.
So with this change I can't build the repo anymore if I don't have nodejs installed. Is that intentional? |
Adds a new package
Microsoft.AspNetCore.Assets.Pack
(final package name open for discussion), which includes Blazor framework files as static web assets. A follow-up change in the SDK will add an implicit reference to this package in any Blazor project targeting .NET 10 or later.This change means that
blazor.*.js
files will get compressed and fingerprinted automatically.Fixes #58783