Improve Default Blazor WebAssembly Loading Experience#42548
Conversation
…mson/aspnetcore into t-samsoncera/wasm-loading
TanayParikh
left a comment
There was a problem hiding this comment.
Looking great so far! Can you please add a screen recording / gif of what the loading animation looks like?
Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com>
Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com>
|
Hi @cerasamson. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge. To learn more about how to prepare a servicing PR click here. |
|
Please rebase your changes on the new target branch. As-is, you're bringing way too much in from 'main'. |
6dd6536 to
80a0577
Compare
|
@dotnet/aspnet-build can this please be merged, it's |
|
/backport to main |
|
Started backporting to main: https://github.com/dotnet/aspnetcore/actions/runs/2699196368 |
|
@TanayParikh backporting to main failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Added loader SVG and CSS styling
Applying: Add WebAssemblyProgressService, WebAssemblyProgressReporter
Applying: Add styling for setProgress, fix resourcesTotal
Applying: Implement singleton pattern, fix CSS styling
Applying: Convert % text to SVG
Applying: Add WebAssemblyProgressService as IBlazor global export
Applying: Modify CSS classes, added TSDoc to public methods
Applying: Modify CSS element names
Applying: Update src/Components/Web.JS/src/Boot.WebAssembly.ts
Applying: Update src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts
Applying: Check for additional resources; percentage styling
Applying: Update app.css
Applying: Create global SetProgress, pass in ProgressService
Applying: Vertically center loading circle
Applying: Update Boot.WebAssembly.ts
Applying: Update src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts
Applying: Fix possible undefined wasmLoadingSetProgress
Applying: Remove setProgressFunction from GlobalExports
Applying: Update blazor.server.js
warning: Cannot merge binary files: src/Components/Web.JS/dist/Release/blazor.server.js (HEAD vs. Update blazor.server.js)
Using index info to reconstruct a base tree...
M src/Components/Web.JS/dist/Release/blazor.server.js
Falling back to patching base and 3-way merge...
Auto-merging src/Components/Web.JS/dist/Release/blazor.server.js
CONFLICT (content): Merge conflict in src/Components/Web.JS/dist/Release/blazor.server.js
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0019 Update blazor.server.js
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128Please backport manually! |
* Added loader SVG and CSS styling * Add WebAssemblyProgressService, WebAssemblyProgressReporter * Add styling for setProgress, fix resourcesTotal * Implement singleton pattern, fix CSS styling * Convert % text to SVG * Add WebAssemblyProgressService as IBlazor global export * Modify CSS classes, added TSDoc to public methods * Modify CSS element names * Update src/Components/Web.JS/src/Boot.WebAssembly.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Check for additional resources; percentage styling * Update app.css * Create global SetProgress, pass in ProgressService * Vertically center loading circle * Update Boot.WebAssembly.ts * Update src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Fix possible undefined wasmLoadingSetProgress * Remove setProgressFunction from GlobalExports * Update blazor.server.js * Update src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/WebAssemblyStartOptions.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Remove progress ring transition duration * Update src/Components/Web.JS/src/Platform/WebAssemblyStartOptions.ts * (WIP) Bring all .ts changes to MonoPlatform.ts * Remove reporter/service classes, update loading styling * Center percentage text * Update app.css * Add additional checks for element types * Prevent exception by changing to div id = "app" * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * WIP remove CSS id * Concat promises for setProgress function * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * CSS updates * Update src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css * Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css * Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> * Add default "Loading" test * Update Templates.Blazor.WebAssembly.Tests.csproj * Update Templates.Blazor.WebAssembly.Tests.csproj Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
* Added loader SVG and CSS styling * Add WebAssemblyProgressService, WebAssemblyProgressReporter * Add styling for setProgress, fix resourcesTotal * Implement singleton pattern, fix CSS styling * Convert % text to SVG * Add WebAssemblyProgressService as IBlazor global export * Modify CSS classes, added TSDoc to public methods * Modify CSS element names * Update src/Components/Web.JS/src/Boot.WebAssembly.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Check for additional resources; percentage styling * Update app.css * Create global SetProgress, pass in ProgressService * Vertically center loading circle * Update Boot.WebAssembly.ts * Update src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Fix possible undefined wasmLoadingSetProgress * Remove setProgressFunction from GlobalExports * Update blazor.server.js * Update src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/WebAssemblyStartOptions.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Remove progress ring transition duration * Update src/Components/Web.JS/src/Platform/WebAssemblyStartOptions.ts * (WIP) Bring all .ts changes to MonoPlatform.ts * Remove reporter/service classes, update loading styling * Center percentage text * Update app.css * Add additional checks for element types * Prevent exception by changing to div id = "app" * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * WIP remove CSS id * Concat promises for setProgress function * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * CSS updates * Update src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css * Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> * Update src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts * Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> * Update src/ProjectTemplates/Web.ProjectTemplates/content/ComponentsWebAssembly-CSharp/Client/wwwroot/css/app.css * Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> * Add default "Loading" test * Update Templates.Blazor.WebAssembly.Tests.csproj * Update Templates.Blazor.WebAssembly.Tests.csproj Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com> Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com> Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
|
Great work. 🎉 I really like that design. |
|
Hi @msschl. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context. |
Improve Default Blazor WebAssembly Loading Experience
This adds an enhanced loading element to the Blazor WebAssembly project template.
Description
A loading element is added to the Blazor WebAssembly project template and will load upon startup of the app. Progress is indicated by a percentage and a progress ring. Progression is based on the number of resources loaded compared to the number of total resources.
Loading Animation:

Fixes #37199
Customer Impact
Since this PR brings updates to a project template, we would like to get these changes to customers as soon as possible in order to adapt to any feedback that they have. This will also minimize the need for additional template changes in the RC builds.
Regression?
Risk
The change is purely additive without impact to any existing functionality. It's also scoped to a single page in the template.
Verification
Packaging changes reviewed?