Commit Graph

5 Commits

Author SHA1 Message Date
Jackson Gardner
ba626dc83a
Wasm/JS Dual Compile with the flutter tool (#141396)
This implements dual compile via the newly available flutter.js bootstrapping APIs for intelligent build fallback.
* Users can now use the `FlutterLoader.load` API from flutter.js
* Flutter tool injects build info into the `index.html` of the user so that the bootstrapper knows which build variants are available to bootstrap
* The semantics of the `--wasm` flag for `flutter build web` have changed:
  - Instead of producing a separate `build/web_wasm` directory, the output goes to the `build/web` directory like a normal web build
  - Produces a dual build that contains two build variants: dart2wasm+skwasm and dart2js+CanvasKit. The dart2wasm+skwasm will only work on Chrome in a cross-origin isolated context, all other environments will fall back to dart2js+CanvasKit.
  - `--wasm` and `--web-renderer` are now mutually exclusive. Since there are multiple build variants with `--wasm`, the web renderer cannot be expressed via a single command-line flag. For now, we are hard coding what build variants are produced with the `--wasm` flag, but I plan on making this more customizable in the future.
* Build targets now can optionally provide a "build key" which can uniquely identify any specific parameterization of that build target. This way, the build target can invalidate itself by changing its build key. This works a bit better than just stuffing everything into the environment defines because (a) it doesn't invalidate the entire build, just the targets which are affected and (b) settings for multiple build variants don't translate well to the flat map of environment defines.
2024-02-02 01:52:28 +00:00
Christopher Fujino
cc83f03822
[flutter_tools] Migrate more integration tests to process result matcher (#128737)
Part of https://github.com/flutter/flutter/issues/127135
2023-06-15 13:25:32 -07:00
Kevin Moore
a8cc95e36d
flutter_tool: only enable wasm compile in master channel (#121755)
flutter_tool: only enable wasm compile in master channel
2023-03-02 22:21:50 +00:00
joshualitt
8f365a3bdc
[web] Update build to use generated JS runtime for Dart2Wasm. (#118359) 2023-01-12 13:46:39 -08:00
Jackson Gardner
9f2c5d8e21
Support flutter build web --wasm (#117075)
* Work in progress.

* Some fixes to the command line.

* Bootstrapping works.

* Change kickoff order to maximize concurrency.

* Fix analyzer errors and formatting issues.

* Fix doc comment.

* Added unit tests for some of the web targets.

* Format issue.

* Add an integration test that builds an app to wasm.

* Add a todo for depfiles.

* Formatting.

* Apparently the license header needs to say 2014.

* `file://` URIs confuse dart2wasm on Windows. Just use absolute paths.

* Update unit tests to match new path passing.

* Have a distinct build directory for wasm, and fixes for some upstream changes.
2022-12-19 20:09:02 +00:00