Skip to content

feat(wasm): Let the bootstrapper fade its loader out on first frame - #25103

Merged
MartinZikmund merged 1 commit into
masterfrom
dev/mazi/loader-dismiss
Oct 8, 2026
Merged

MartinZikmund merged 1 commit into
masterfrom
dev/mazi/loader-dismiss

Conversation

@MartinZikmund

Copy link
Copy Markdown
Member

What changed

When removing the bootstrapper's persistent loader after the first rendered frame, WebAssemblyWindowWrapper.removeLoading now calls Uno.WebAssembly.Bootstrap.Bootstrapper.dismissLoader() if it exists. Otherwise it falls back to the existing direct element removal. #uno-loading removal and persistBootstrapperLoader are unchanged.

Why

Uno.Wasm.Bootstrap #1097 redesigns the loading screen and adds dismissLoader(), which fades the loader out and lets custom loaders run their own exit animation. Removing the element directly skips both.

Feature detection keeps this backward compatible: older bootstrappers don't expose dismissLoader and behave exactly as before.

Validation

  • tsc -p src/Uno.UI.Runtime.WebAssembly.Browser/tsconfig.json --noEmit (TypeScript 7.0.2 via npx): 90 errors both before and after the change, none introduced (pre-existing strict-null noise).
  • Not tested at runtime against a bootstrapper build containing dismissLoader.

🤖 Generated with Claude Code

https://claude.ai/code/session_013terw2KRvw8e64cogQymUL

Call Bootstrapper.dismissLoader when the bootstrapper exposes it, and fall
back to removing the persistent loader element for older bootstrappers.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013terw2KRvw8e64cogQymUL
@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Oct 8, 2026
@MartinZikmund
MartinZikmund marked this pull request as ready for review October 8, 2026 14:44
Copilot AI balanced review requested due to automatic review settings October 8, 2026 14:44
@MartinZikmund
MartinZikmund merged commit c336663 into master Oct 8, 2026
51 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MartinZikmund
MartinZikmund deleted the dev/mazi/loader-dismiss branch October 8, 2026 14:44
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @MartinZikmund's task in 14s —— View job


Review summary

Verdict: Looks good, with one minor suggestion. The change is small and backward compatible, because it feature-detects dismissLoader and falls back to the existing removal.

  • Blocking: 0
  • Minor: 1 (inline). dismissLoader is invoked unbound, so this is lost. Call it on Bootstrapper instead.

Not covered: I didn't test this at runtime. As the PR notes, there is no bootstrapper build with dismissLoader to test against. No tests were added, which is reasonable for a TypeScript interop shim.

// Newer bootstrappers fade the loader out themselves; older ones don't expose dismissLoader.
const dismissLoader = (globalThis as any).Uno?.WebAssembly?.Bootstrap?.Bootstrapper?.dismissLoader;
if (typeof dismissLoader === "function") {
dismissLoader();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: dismissLoader is pulled off Bootstrapper into a local and invoked unbound, so this is undefined inside it. If the bootstrapper implements it as a static method that uses this (e.g. this.something), this would throw. Safer to call it on its owner:

Suggested change
dismissLoader();
const bootstrapper = (globalThis as any).Uno?.WebAssembly?.Bootstrap?.Bootstrapper;
if (typeof bootstrapper?.dismissLoader === "function") {
bootstrapper.dismissLoader();

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

Labels

platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants