-
Notifications
You must be signed in to change notification settings - Fork 10k
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
base: main
Are you sure you want to change the base?
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). |
<!-- The package doesn't produce any lib or ref assemblies --> | ||
<NoWarn>$(NoWarn);NU5128</NoWarn> | ||
|
||
<StaticWebAssetBasePath>_framework</StaticWebAssetBasePath> |
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.
We should not set the base path to _framework
it should be /
and the relative paths on the assets to include _framework
.
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.
Actually, this should be $(StaticWebAsetBasePath)
, if the user sets the base path in their project, the assets should be located in their app base path, not anywhere else.
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.
Would this require that we move most of the static web asset generation into the build/*.targets
file so we get insight into the props of the consuming project? Or is there another way you had in mind that we'd achieve this?
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.
We don't really need to move the logic there, we can "escape" the value so that it ends up as $(StaticWebAsetBasePath)
in the file.
Same with the $(SourceId)
, we can use escaping for now
<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
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