• Jackson Gardner's avatar
    Flutter Web Bootstrapping Improvements (#144434) · 3c30e3cb
    Jackson Gardner authored
    This makes several changes to flutter web app bootstrapping.
    * The build now produces a `flutter_bootstrap.js` file.
      * By default, this file does the basic streamlined startup of a flutter app with the service worker settings and no user configuration.
      * The user can also put a `flutter_bootstrap.js` file in the `web` subdirectory in the project directory which can have whatever custom bootstrapping logic they'd like to write instead. This file is also templated, and can use any of the tokens  that can be used with the `index.html` (with the exception of `{{flutter_bootstrap_js}}`, see below).
    * Introduced a few new templating tokens for `index.html`:
      * `{{flutter_js}}` => inlines the entirety of `flutter.js`
      * `{{flutter_service_worker_version}}` => replaced directly by the service worker version. This can be used instead of the script that sets the `serviceWorkerVersion` local variable that we used to have by default.
      * `{{flutter_bootstrap_js}}` => inlines the entirety of `flutter_bootstrap.js` (this token obviously doesn't apply to `flutter_bootstrap.js` itself).
    * Changed `IndexHtml` to be called `WebTemplate` instead, since it is used for more than just the index.html now.
    * We now emit warnings at build time for certain deprecated flows:
      * Warn on the old service worker version pattern (i.e.`(const|var) serviceWorkerVersion = null`) and recommends using `{{flutter_service_worker_version}}` token instead
      * Warn on use of `FlutterLoader.loadEntrypoint` and recommend using `FlutterLoader.load` instead
      * Warn on manual loading of `flutter_service_worker.js`.
    * The default `index.html` on `flutter create` now uses an async script tag with `flutter_bootstrap.js`.
    3c30e3cb
Name
Last commit
Last update
..
abstract_method_smoke_test Loading commit data...
android_custom_host_app Loading commit data...
android_embedding_v2_smoke_test Loading commit data...
android_host_app/.gradle Loading commit data...
android_host_app_v2_embedding Loading commit data...
android_module_host_with_custom_build_v2_embedding/app/src/main/java/io/flutter/addtoapp Loading commit data...
android_semantics_testing Loading commit data...
android_verified_input Loading commit data...
android_views Loading commit data...
channels Loading commit data...
deferred_components_test Loading commit data...
external_textures Loading commit data...
flavors Loading commit data...
flutter_gallery Loading commit data...
gradle_deprecated_settings Loading commit data...
hybrid_android_views Loading commit data...
ios_add2app_life_cycle Loading commit data...
ios_app_with_extensions Loading commit data...
ios_host_app Loading commit data...
ios_host_app_swift Loading commit data...
ios_platform_view_tests Loading commit data...
module_host_with_custom_build/.gradle Loading commit data...
module_host_with_custom_build_v2_embedding Loading commit data...
new_gallery Loading commit data...
non_nullable Loading commit data...
platform_interaction Loading commit data...
release_smoke_test Loading commit data...
spell_check Loading commit data...
ui Loading commit data...
web Loading commit data...
web_compile_tests Loading commit data...
web_e2e_tests Loading commit data...
wide_gamut_test Loading commit data...
windows_startup_test Loading commit data...
README.md Loading commit data...