Conversation
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
2bc77f4 to
bad4dad
Compare
Member
Author
|
This is ready for review, the main commits to review are: d9244e4 There is a commit that adds tests for all scenarios we care about. I've put all the generated baselines into their own commit since I've also been doing fixes. The additional tests are also on their own commit, and you can check the associated baseline if you want to see if we are generating the right results. |
Member
Author
Contributor
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
pranavkm
approved these changes
Aug 4, 2021
Contributor
pranavkm
left a comment
There was a problem hiding this comment.
Changes look good. Some questions about test coverage
src/Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/BlazorWasmStaticWebAssetsIntegrationTest.cs
Outdated
Show resolved
Hide resolved
src/Tests/Microsoft.NET.Sdk.Razor.Tests/StaticWebAssetsIntegrationTest.cs
Show resolved
Hide resolved
2c8f963 to
ddaddf4
Compare
Member
Author
… there are assets present
190fc7f to
1dd270d
Compare
SonicGD
added a commit
to sitkoru/Sitko.Blockly
that referenced
this pull request
Aug 11, 2021
SonicGD
added a commit
to sitkoru/Sitko.Blockly
that referenced
this pull request
Aug 12, 2021
This reverts commit 8185b2e.
lewing
added a commit
to lewing/runtime
that referenced
this pull request
Aug 15, 2021
akoeplinger
pushed a commit
to dotnet/runtime
that referenced
this pull request
Aug 16, 2021
thaystg
added a commit
to thaystg/runtime
that referenced
this pull request
Aug 16, 2021
…information # By dotnet-maestro[bot] (4) and others # Via GitHub * origin/main: (58 commits) Localized file check-in by OneLocBuild Task (dotnet#57384) [debugger][wasm] Support DebuggerProxyAttribute (dotnet#56872) Account for type mismatch of `FIELD_LIST` members in LSRA (dotnet#57450) Qualify `sorted_table` allocation with `nothrow` (dotnet#57467) Rename transport packages to follow convention (dotnet#57504) Generate proper DWARF reg num for ARM32 (dotnet#57443) Enable System.Linq.Queryable and disable dotnet#50712 (dotnet#57464) Mark individual tests for 51211 (dotnet#57463) Fix Length for ReadOnlySequence created out of sliced Memory owned by MemoryManager (dotnet#57479) Add JsonConverter.Write/ReadAsPropertyName APIs (dotnet#57302) Remove workaround for dotnet/sdk#19482 (dotnet#57453) Do not drain HttpContentReadStream if the connection is disposed (dotnet#57287) [mono] Fix a few corner case overflow operations (dotnet#57407) make use of ports in SPN optional (dotnet#57159) Fixed H/3 stress server after the last Kestrel change (dotnet#57356) disable a failing stress test. (dotnet#57473) Eliminate temporary byte array allocations in the static constructor of `IPAddress`. (dotnet#57397) Update dependencies from https://github.com/dotnet/emsdk build 20210815.1 (dotnet#57447) [main] Update dependencies from mono/linker (dotnet#57344) Improve serializer performance (dotnet#57327) ... # Conflicts: # src/mono/wasm/debugger/BrowserDebugProxy/MemberReferenceResolver.cs # src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs # src/mono/wasm/debugger/BrowserDebugProxy/MonoSDBHelper.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Static web assets cleanups
Goals
into them to get the list of static web asset items.
Other work/cleanups
standardtargets where features can attach themselves to generatetheir assets.
Details
In the initial implementation of static web assets V2, we generated a manifest
and asked every referenced project to give us their manifest. This worked but it
incurred in the additional cost of having to read each referenced project manifest
every time we had to compute the manifest for a given project.
In addition to that, it was costly/impossible to support backwards compatibility with previous versions of static web assets, since they use different targets and work in a very different way.
Finally, the old implementation relied on the old project knowing all the details about referenced projects to compute the list of assets, which added complexity to the implementation.
The changes in this PR bring the implementation closer to the original implementation and make it more performant, backwards compatible and simpler.
Static web assets with referenced projects works as follows:
based on the configuration they gave us.
based on the configuration they gave us.
The initial step is to call GetStaticWebAssetsProjectConfiguration on all projects. This step defines how the remaining steps work by returning an item group that includes the version, the source, the targets and properties to call to get the static web assets for the project during build and publish.
Static web assets V2 defines a standard target
GetCurrentProjectBuildStaticWebAssetItemsthat it calls when no other target has been defined. Projects can change this by settingStaticWebAssetsGetBuildAssetsTargetsA similar thing happens for publish assets, we will call
ComputeReferencedStaticWebAssetsPublishManifest;GetCurrentProjectPublishStaticWebAssetItemsby default to make sure that the publish asset manifest is generated and retrieve the assets afterwards. Each project can change this by settingStaticWebAssetsGetPublishAssetsTargets.In addition to that, there are properties that projects can configure to define how we should retrieve their assets:
StaticWebAssetsAdditionalBuildPropertiesStaticWebAssetsAdditionalBuildPropertiesToRemoveStaticWebAssetsAdditionalPublishPropertiesStaticWebAssetsAdditionalPublishPropertiesToRemoveThese properties are mostly for our
internaluse and enable us to adapt how static web assets work in different environments, like blazor webassembly or blazor desktop, without burdening those projects with unnecessary details.This functionality is used also by older projects to bring forward compatibility with the new version of static web assets.
The 6.0 SDK forks static web assets and blazor based on whether the user is targeting 6.0 or earlier, we do this to avoid breaking backwards compatibility with previous versions given the amount of changes we've made to how static web assets work.
If a project targets net6.0 or higher it will load static web assets v2, otherwise, it will load v1, which live in different targets files.
We've updated the V1 SDK file to include targets to bring forward compatibility with static web assets V2.
V1 static web assets define a GetStaticWebAssetsProjectConfiguration target that returns the configuration to use for retrieving the assets. The only important element they return is
GetCurrentProjectStaticWebAssetsV2for retrieving the static web asssets during build.V1 static web assets projects don't define different assets during publish, so they don't return publish specific static web assets targets as part of their configuration.
Static web assets v1, scoped css v1, and blazor webassembly 5.0, attach to
GetCurrentProjectStaticWebAssetsV2and update the assets properties to adapt them to static web assets v2.Finally, by calling the referenced projects for their assets, we simplify how the assets are computed when the assets are being referenced by another project.
Other work details
Make publish respect PreserveNewest
This was missing and its obvious, we were just copying the assets to the publish output folder, we now split them by PreserveNewest or Always and do the appropriate thing.
Define standard targets for generating static web assets
Assets can do work at two points:
This makes it easier to adapt when the pipeline targets run in different environments (Webassembly, Maui) without them requiring intimate knowledge of every static web asset feature.