-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Fixes #12588][Blazor] Move Blazor to use Static Web Assets #18409
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
Conversation
src/Components/Blazor/Build/test/BuildIntegrationTests/PublishIntegrationTest.cs
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Build/src/targets/StaticWebAssets.targets
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Build/src/targets/StaticWebAssets.targets
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Build/src/targets/StaticWebAssets.targets
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Server/src/Services/BlazorHostingServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Server/src/Services/BlazorHostingServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Server/src/Services/BlazorHostingServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Server/src/Services/BlazorHostingServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
@javiercn Since this is for preview 2, is it OK if I leave it a week before reviewing this? If that's going to derail your work then please let me know and I'll try to find space to dig into it sooner. |
src/Components/Blazor/Build/test/BuildIntegrationTests/PublishIntegrationTest.cs
Outdated
Show resolved
Hide resolved
src/Components/Blazor/Server/src/Services/BlazorHostingServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
3f0e24b
to
9f8dd5c
Compare
3fb8167
to
ed2afbd
Compare
src/Components/Blazor/Build/test/BuildIntegrationTests/BuildIntegrationTest.cs
Outdated
Show resolved
Hide resolved
dbe72d7
to
799fb16
Compare
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.
- Ended up the standalone publish output to the wwwroot folder as discussed here.
- Plugged Copy and Publish through Static Web Assets.
- Updated tests accordingly.
- Updated copying the pdbs to use
BlazorDebuggingEnabled
* Plugs-in Blazor wasm through the static web assets infrastructure. * Avoids the need for a custom Blazor.config file. * Removes broken auto-rebuild and debug support. * Removes unnecessary server-side Blazor helpers.
…and copying to use static web assets
24120f3
to
9f73e71
Compare
97f5608
to
14b7f0e
Compare
src/Components/WebAssembly/Build/src/targets/ServiceWorkerAssetsManifest.targets
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/Build/src/targets/StaticWebAssets.targets
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/Build/src/targets/StaticWebAssets.targets
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/Build/src/targets/StaticWebAssets.targets
Outdated
Show resolved
Hide resolved
...mponents/WebAssembly/Server/src/Services/ComponentsWebAssemblyServiceCollectionExtensions.cs
Show resolved
Hide resolved
...mponents/WebAssembly/Server/src/Services/ComponentsWebAssemblyServiceCollectionExtensions.cs
Show resolved
Hide resolved
...mponents/WebAssembly/Server/src/Services/ComponentsWebAssemblyServiceCollectionExtensions.cs
Show resolved
Hide resolved
...mplates/ComponentsWebAssembly.ProjectTemplates/ComponentsWebAssembly-CSharp.Client.csproj.in
Show resolved
Hide resolved
...mplates/ComponentsWebAssembly.ProjectTemplates/ComponentsWebAssembly-CSharp.Client.csproj.in
Show resolved
Hide resolved
841bcf1
to
a271758
Compare
src/Components/WebAssembly/Build/src/targets/StaticWebAssets.targets
Outdated
Show resolved
Hide resolved
...mponents/WebAssembly/Server/src/Services/ComponentsWebAssemblyServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Startup.cs
Show resolved
Hide resolved
src/Components/WebAssembly/testassets/Wasm.Authentication.Server/Startup.cs
Show resolved
Hide resolved
@@ -57,7 +57,7 @@ public void CachesResourcesAfterFirstLoad() | |||
var subsequentResourcesRequested = GetAndClearRequestedPaths(); | |||
Assert.NotEmpty(initialResourcesRequested.Where(path => path.EndsWith("/blazor.boot.json"))); | |||
Assert.Empty(subsequentResourcesRequested.Where(path => path.EndsWith("/dotnet.wasm"))); | |||
Assert.NotEmpty(subsequentResourcesRequested.Where(path => path.EndsWith(".js"))); | |||
Assert.Empty(subsequentResourcesRequested.Where(path => path.EndsWith(".js"))); |
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 did this change? I would expect it always to request blazor.webassembly.js
and dotnet.js
regardless of the caching, so I don't get how this can be right.
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.
Hmm, I didn't see it being requested.
Ah, it's likely due to the removal of the no-cache
header we put in blazor.webassembly.js
. We can chat a bit more about this, but it shouldn't be necessary for us to include the no-cache header, the browser will do the right thing.
The browser already does the right thing. We can talk about this later if you want.
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.
That doesn’t sound valid. We need the browser to request this since its content may have changed. Or if not, how does the browser do the right thing? I would expect the no-cache header is needed.
Let’s not consider this resolved just yet :)
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.
Discussed offline, I'll send a follow-up PR to resolve 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.
Looks like time to 🚢 !
I do have one actual correctness question and have posted a couple of suggestions about comment typos, but once those are resolved this is looking great to me.
…semblyServiceCollectionExtensions.cs Co-Authored-By: Steve Sanderson <[email protected]>
The main benefits of this change are:
This is a preview2 change,
There are a couple of loose ends here that I'll tackle before preview2 but not in this PR. I'm putting the PR out so that we can get it reviewed early and merged as the changes are "medium-sized" and I don't want them to get stale. The two loose ends are:
This can go in as soon as we've shipped preview1 and the changes we made in the 3.1 patch branches have made it to the blazor-wasm branch.