Currently, the `flutter_js` target is built as part of the flutter_web_sdk_archive target. However, it should also be built when doing the normal web_sdk, as that is what the monorepo builds (and does its own archiving).
* Roll esbuild as a CIPD package along with the browser roller. I renamed `browser_lock`/`browser_roller` etc to `package_lock` and `package_roller` since it will handle more than just browsers now.
* Download the esbuild CIPD package via DEPS.
* Have a build rule for running esbuild on some JavaScript or TypeScript
* Bundle and minify `flutter.js` using esbuild.
* Include in `flutter_web_sdk` the original `flutter.js` source, the minified `flutter.js`, and a sourcemap file to map between thnm.
* Also slightly changed the structure to put the `flutter.js` stuff in `flutter_web_sdk/flutter_js` instead of just at the root level of `flutter_web_sdk`. This should be fine because I haven't merged the change that has the flutter tool consume this yet.
This removes skips for the golden tests in `//testing/dart/canvas_test.dart` and instead passes them up to Skia gold.
Adds a utility class for dealing with Skia gold from these tests, as well as the existing fuzzy identical image comparison for tests that just want to do in memory comparison of images generated from the same test.
Removes the old golden files that were in tree.
Part of https://github.com/flutter/flutter/issues/53784
This will allow us to add tooling to do some bundling/minifying of `flutter.js`, which should make this more scalable/extensible long-term.
Also, this removes a few redundant build rules that produce artifacts that the flutter tool doesn't use anymore.
- Update the pinned version of `test` to the latest published.
- Add support for reading the `source.location` of messages to the JS
interop library.
- Update `host.dart` to support the new communication pattern with the
test frame. See https://github.com/dart-lang/test/issues/2065
- Use `Runtime.edge` for the edge browser. We may deprecate or remove
the constant. Edge is a more appropriate value for this usage.
This should help with https://github.com/flutter/flutter/issues/122834
Emitting DWARF data or source maps actually significantly changes the size of the build, since some binaryen optimizations must actually be skipped when producing either of those. So we can emit symbol maps for now, which don't affect the size of the actual wasm output. With these, we can at least manually deobfuscate stack traces.
Use the newly exposed functionality in `dart:_wasm` to fix up two different hacks we have:
1) When creating an image from an image source, use `wasm:import` instead of `@Native` and pass the image source directly as an externref. (Direct wasm binding instead of a JS interop shim, yay).
2) When binding the surface callback, previously we were wrapping the callback in a JS function, and then using `WebAssembly.Function` to create a wasm function wrapper around that. Now, we can create a `WasmFuncRef` that is a direct reference to a dart function and pass that over. Now there are no intermediary JavaScript layers when skwasm calls back to us, and we no longer are dependent on the type reflection flag in Chrome.
This fixes https://github.com/flutter/flutter/issues/134556
In this PR, I'm leaving a getter for `platformViewRegistry` in `dart:ui` for backwards compatibility. At some point, we need to properly deprecate it (e.g. print a warning asking users to import it from `dart:ui_web` instead).
Next step is to migrate all call sites in flutter/flutter, flutter/packages and flutter/devtools (anything else?).
Issue: https://github.com/flutter/flutter/issues/126831
Fixes https://github.com/flutter/flutter/issues/41563
This implements font loading for the skwasm renderer.
In addition, it does some pretty major refactors:
1) Simplified the font collection interface to just have a single `loadAssetFonts` call, without the separate registration and debug fonts loading stuff
2) Debug fonts load now through http/asset mocking mechanisms instead of having a separate `downloadDebugTestFonts` call
3) Consolidated a few of our different unit test setup functions into a single `setUpUnitTests` function
dart:js_interop and package:js will start conflicting. Eventually, we
want people to only use dart:js_interop, so this CL refactors code to do
that.
Unblocks https://dart-review.googlesource.com/c/sdk/+/294130/8 and
prevents confusing shadowing of dart:js_interop annotations like we do
today.
## Pre-launch Checklist
- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [Mentioned CL that is unblocked] I listed at least one issue that this
PR fixes in the description above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [Need test-exemption] I added new tests to check the change I am
making, or this PR is [test-exempt].
- [X] All existing and new tests are passing.
Previous attempt was here: https://github.com/flutter/engine/pull/40846
I was including un-rewritten source files, which caused breakage. Now we run out `ui_web` files through the sdk_rewriter script before putting them into sky_engine
* [web] New gn for building CanvasKit
* Use toolchain_args to override CanvasKit gn args
* Use correct path for the generated canvaskit files
* Put toolchain close to target
* remove extra toolchains
* remove extra import
* add canvaskit_lite to archive
* fix local canvaskit path in tests
* add some guards using visibility and asserts
* renames
* formatting
* rename mistake
* Add github issue to the TODO
* Update buildroot sha
* clang-tidy error
* skip canvaskit targets when not needed
* Generate zip archives for Windows following target platform.
* Add CI builder for windows-arm64.
All packages can be cross compiled from an x64 machine.
Unittests are disabled, as they require an arm64 machine.
* Add windows-arm64 to CI.