flutter/packages/flutter_tools/templates/app_shared
Jackson Gardner 3c30e3cb20
Flutter Web Bootstrapping Improvements (#144434)
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`.
2024-03-12 22:41:26 +00:00
..
.idea
android-java.tmpl Android Gradle file templates: make it easier to convert them to Kotlin DSL in the future (#142146) 2024-02-15 23:42:13 +00:00
android-kotlin.tmpl Android Gradle file templates: make it easier to convert them to Kotlin DSL in the future (#142146) 2024-02-15 23:42:13 +00:00
android.tmpl [flutter_tools] Update external link in Android manifest template (#144302) 2024-02-29 06:47:19 +00:00
ios-objc.tmpl Migrate Xcode projects last version checks to Xcode 15.1 (#140256) 2024-01-03 23:05:46 +00:00
ios-swift.tmpl Sort Swift imports in templates (#141487) 2024-01-16 18:07:21 +00:00
ios.tmpl Set template and migrate apps to iOS 12 minimum (#140823) 2024-01-03 00:47:40 +00:00
linux.tmpl Add missing call to parent method of GApplication::shutdown, implement GApplication::startup (#136836) 2023-10-20 22:19:57 +00:00
macos.tmpl Sort Swift imports in templates (#141487) 2024-01-16 18:07:21 +00:00
web Flutter Web Bootstrapping Improvements (#144434) 2024-03-12 22:41:26 +00:00
windows.tmpl [Windows] Fix signed/unsigned int comparison (#142341) 2024-02-07 00:09:57 +00:00
.gitignore.tmpl No longer include .packages in created .gitignore files (#133484) 2023-08-30 00:40:01 +00:00
analysis_options.yaml.tmpl Update links to old linter site to dart.dev (#129866) 2023-07-01 18:36:10 +00:00
projectName.iml.tmpl Remove .pub directories from iml templates (#109622) 2022-09-09 22:20:12 +00:00