Sitelet https://github.com/flutter/flutter/pull/192483
Skip to content

[flutter_tools] Keep web loading bar visible until app starts - #192483

Merged
goderbauer merged 4 commits into
flutter:masterfrom
bkonyi:fix_flutter_web_loader
Sep 9, 2026
Merged

goderbauer merged 4 commits into
flutter:masterfrom
bkonyi:fix_flutter_web_loader

Conversation

@bkonyi

@bkonyi bkonyi commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

The blue loading indicator on Flutter Web was previously removed when receiving the dart-app-ready DOM event. However, DWDS dispatches dart-app-ready immediately when the injected debug client connects to the debug service protocol, which occurs while Frontend Server is still compiling the application.

This change:

  1. Replaces the dart-app-ready listener with an explicit window._removeFlutterLoader function that is invoked directly before executing the application entrypoint in both generateMainModule and generateDDCLibraryBundleMainModule.
  2. Cleans up window._removeFlutterLoader upon execution to allow the DOM elements and closure scope to be garbage collected.
  3. Updates the loading indicator animation keyframes to use hardware-composited CSS transforms (translateX and scaleX with will-change: transform; and transform-origin: left;) instead of layout properties (left/width), preventing the animation from freezing when the browser evaluates large JavaScript bundles.

Pre-launch Checklist

The blue loading indicator on Flutter Web was previously removed when receiving the `dart-app-ready` DOM event. However, DWDS dispatches `dart-app-ready` immediately when the injected debug client connects to the debug service protocol, which occurs while Frontend Server is still compiling the application.

This change replaces the `dart-app-ready` listener with an explicit `window._removeFlutterLoader` function that is invoked directly before executing the application entrypoint in both `generateMainModule` and `generateDDCLibraryBundleMainModule`.
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 9, 2026
@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Sep 9, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request replaces the 'dart-app-ready' event listener in the web bootstrap script with a global window._removeFlutterLoader function to handle the removal of the loading indicator and stylesheet, and updates the main module generation and tests accordingly. Feedback suggests clearing the global window._removeFlutterLoader reference inside the function itself to prevent potential memory leaks by allowing the DOM elements and closure scope to be garbage collected.

Comment thread packages/flutter_tools/lib/src/web/bootstrap.dart

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

Thank you!

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

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants