Skip to content

Improve Default Blazor WebAssembly Loading Experience#42548

Merged
dougbu merged 53 commits into
dotnet:release/7.0-preview7from
cerasamson:t-samsoncera/wasm-loading
Jul 16, 2022
Merged

Improve Default Blazor WebAssembly Loading Experience#42548
dougbu merged 53 commits into
dotnet:release/7.0-preview7from
cerasamson:t-samsoncera/wasm-loading

Conversation

@cerasamson
Copy link
Copy Markdown
Contributor

@cerasamson cerasamson commented Jul 1, 2022

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:
progress_ring

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?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low
    The change is purely additive without impact to any existing functionality. It's also scoped to a single page in the template.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

Copy link
Copy Markdown
Contributor

@TanayParikh TanayParikh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great so far! Can you please add a screen recording / gif of what the loading animation looks like?

Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
Comment thread src/Components/Web.JS/src/Boot.WebAssembly.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
Comment thread src/Components/Web.JS/src/Boot.WebAssembly.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressService.ts Outdated
Comment thread src/Components/Web.JS/src/Boot.WebAssembly.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
@Pilchie Pilchie added the area-blazor Includes: Blazor, Razor Components label Jul 5, 2022
@TanayParikh TanayParikh added this to the 7.0-preview7 milestone Jul 5, 2022
@cerasamson cerasamson marked this pull request as ready for review July 6, 2022 23:33
@cerasamson cerasamson requested a review from a team as a code owner July 6, 2022 23:33
Comment thread src/Components/Web.JS/src/Boot.WebAssembly.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/Mono/MonoPlatform.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyProgressReporter.ts Outdated
Comment thread src/Components/Web.JS/src/Platform/WebAssemblyResourceLoader.ts Outdated
Comment thread src/Components/Web.JS/src/Boot.WebAssembly.ts Outdated
cerasamson and others added 4 commits July 7, 2022 10:17
@TanayParikh TanayParikh requested a review from a team July 7, 2022 20:32
@mkArtakMSFT mkArtakMSFT added the Servicing-consider Shiproom approval is required for the issue label Jul 14, 2022
@ghost
Copy link
Copy Markdown

ghost commented Jul 14, 2022

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.

@mkArtakMSFT mkArtakMSFT added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Jul 14, 2022
@dougbu
Copy link
Copy Markdown
Contributor

dougbu commented Jul 15, 2022

Please rebase your changes on the new target branch. As-is, you're bringing way too much in from 'main'.

@cerasamson cerasamson force-pushed the t-samsoncera/wasm-loading branch from 6dd6536 to 80a0577 Compare July 15, 2022 22:06
@TanayParikh
Copy link
Copy Markdown
Contributor

@dotnet/aspnet-build can this please be merged, it's servicing-approved.

@dougbu dougbu merged commit 301829c into dotnet:release/7.0-preview7 Jul 16, 2022
@TanayParikh
Copy link
Copy Markdown
Contributor

/backport to main

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@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 128

Please backport manually!

cerasamson added a commit to cerasamson/aspnetcore that referenced this pull request Jul 19, 2022
* 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>
cerasamson added a commit that referenced this pull request Jul 19, 2022
* 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>
@msschl
Copy link
Copy Markdown
Contributor

msschl commented Aug 1, 2022

Great work. 🎉 I really like that design.

@ghost
Copy link
Copy Markdown

ghost commented Aug 1, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-blazor Includes: Blazor, Razor Components Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Default Blazor WASM Loading Experience

9 participants