dotnet / AspNetCore.Docs

Documentation for ASP.NET Core
https://docs.microsoft.com/aspnet/core
Creative Commons Attribution 4.0 International
12.61k stars 25.3k forks source link

Missing documentation for `StaticWebAssetProjectMode` attribute in ` *.Client.csproj` file #31658

Closed gragra33 closed 8 months ago

gragra33 commented 1 year ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe the problem.

Missing documentation.

Describe the solution you'd like

Is it possible to have a reply with what values are acceptable while we wait for the documentation team?

Additional context

No response

javiercn commented 1 year ago

@gragra33 thanks for contacting us.

StaticWebAssetProjectMode controls certain aspects of how the project flows assets to projects referencing it, but its not something that apps should be concerned with, nor change or take a dependency on.

Different SDKs will set it to the correct value for the scenarios, and the only case where (unfortunately) shows up in the templates is Blazor Web, due to the two-project setup. It will go away in the future when we move to a one project setup.

gragra33 commented 1 year ago

@javiercn So what you are saying is that it is a "blackbox" and will change in future, so devs should not know about it...

ghost commented 1 year ago

This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.

See our Issue Management Policies for more information.

danroth27 commented 8 months ago

Since this property appears in the Blazor project template, it's public surface area and should be documented.

javiercn commented 8 months ago

@danroth27 this is not something that we want users changing, not something we support changing. it's an implementation detail that leaked out of the fact that we had to go with the 2 project approach.

danroth27 commented 8 months ago

@javiercn and I chatted, and here's the proposed text:

The <StaticWebAssetProjectMode>Default</StaticWebAssetProjectMode> setting reverts Blazor WebAssembly specific behaviors with regards to static assets back to the defaults so that the project behaves as part of the hosted project. The setting is required in the Client project of a Blazor Web app and only the Default value is supported. The Blazor WebAssembly SDK (Microsoft.NET.Sdk.BlazorWebAssembly) configures static web assets in a specific way to work in "standalone" mode with a server simply consuming the outputs from the library. This is not appropriate for Blazor Web apps, where the WebAssembly portion of the app is a logical part of the host and needs to behave more like a library. For example, the project won't expose the styles bundle (BlazorApp.Client.styles.css) and instead will only provide the host with the project bundle, so that the host can include it in its own styles bundle.

@guardrex This one is headed your way!