Repository navigation
[flutter_tools] Keep web loading bar visible until app starts - #192483
Merged
Merged
Conversation
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`.
Contributor
There was a problem hiding this comment.
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.
# Conflicts: # packages/flutter_tools/lib/src/web/bootstrap.dart # packages/flutter_tools/test/general.shard/web/bootstrap_test.dart
This was referenced Sep 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The blue loading indicator on Flutter Web was previously removed when receiving the
dart-app-readyDOM event. However, DWDS dispatchesdart-app-readyimmediately when the injected debug client connects to the debug service protocol, which occurs while Frontend Server is still compiling the application.This change:
dart-app-readylistener with an explicitwindow._removeFlutterLoaderfunction that is invoked directly before executing the application entrypoint in bothgenerateMainModuleandgenerateDDCLibraryBundleMainModule.window._removeFlutterLoaderupon execution to allow the DOM elements and closure scope to be garbage collected.translateXandscaleXwithwill-change: transform;andtransform-origin: left;) instead of layout properties (left/width), preventing the animation from freezing when the browser evaluates large JavaScript bundles.Pre-launch Checklist
///).