192 Commits

Author SHA1 Message Date
Jackson Gardner
3133e1fbca Add the flutter_js target as a dep to web_sdk. (flutter/engine#48814)
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).
2023-12-08 15:28:12 +00:00
Jackson Gardner
9549a0fbe2 Bundle flutter.js via esbuild (flutter/engine#47573)
* 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.
2023-11-03 20:24:29 +00:00
Dan Field
23b2847379 [Impeller] Skia gold for flutter_tester dart tests. (flutter/engine#47066)
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
2023-11-02 17:48:28 +00:00
Jackson Gardner
d6ca6b37d2 Move flutter.js into the engine. (flutter/engine#47240)
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.
2023-10-31 19:19:17 +00:00
Zachary Anderson
14a7db93d1 Cleanup Dart package dependencies a bit (flutter/engine#47306)
Removes package:quiver, and an older second copy of package:file
2023-10-25 13:09:30 -07:00
Nate Bosch
fbb4b6abd9 Update to the latest package:test (flutter/engine#46592)
- 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.
2023-10-23 19:08:10 +00:00
Jackson Gardner
ef900554cb Include symbol maps in CanvasKit and Skwasm builds. (flutter/engine#46973)
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.
2023-10-17 16:24:18 +00:00
Jackson Gardner
2c58573690 Use dart:_wasm constructs to avoid dependence on WebAssembly.Function (flutter/engine#46388)
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
2023-09-29 20:52:36 +00:00
Michael Goderbauer
efc22ee283 Enable private field promotion (flutter/engine#45722)
New feature in upcoming Dart 3.2. See https://github.com/dart-lang/language/issues/2020. Feature is enabled by bumping the min SDK version to 3.2.

Part of https://github.com/flutter/flutter/issues/134476.
2023-09-14 21:02:03 +00:00
Jackson Gardner
c93da27b95 Compile a platform dill for dart2wasm (flutter/engine#45797)
This continues work on https://github.com/flutter/flutter/issues/133467

We still need a change on the tool side to consume this platform dill file after this lands.
2023-09-13 22:12:13 +00:00
Nicholas Shahan
f7132b576d Update deps on DDC build targets (flutter/engine#45404)
Update deps to use the new Dart SDK DDC build targets introduced in
these changes:
 - https://dart-review.googlesource.com/c/sdk/+/313081
 - https://dart-review.googlesource.com/c/sdk/+/315561

Fixes: https://github.com/flutter/flutter/issues/133606
2023-09-06 11:10:39 -07:00
Jacob MacDonald
660bdd6b03 add dart_internal override where necessary (flutter/engine#42920)
A dependency to dart_internal was added in https://dart-review.googlesource.com/c/sdk/+/309460/6 and all transitive deps need to have overrides.
2023-06-16 17:20:18 +00:00
Mouad Debbar
3a4677a6d7 [web] Cleanup assertionsEnabled (flutter/engine#41829)
For consistency with the rest of the flutter code, this PR explores the possibility of removing our proprietary `assertionsEnabled`.
2023-05-24 15:08:50 +00:00
Mouad Debbar
9aec8c5c62 [web] Move platformViewRegistry to ui_web (flutter/engine#41877)
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
2023-05-23 16:17:56 +00:00
Jackson Gardner
16360e9e25 Reland "Skwasm Font Loading (flutter/engine#41756)
This relands https://github.com/flutter/engine/pull/41246, which had to be reverted due to some issues parsing the font manifest.
2023-05-08 18:17:22 +00:00
Jackson Gardner
f2970b73b0 Revert "Skwasm Font Loading" (flutter/engine#41750)
Reverts flutter/engine#41246

The new font manifest parsing fails in some cases.
2023-05-04 23:54:18 +00:00
Jackson Gardner
6f5ad9737e Skwasm Font Loading (flutter/engine#41246)
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
2023-05-04 18:22:53 +00:00
joshualitt
e370809b5e [web] Add dart:js_interop_unsafe to SDK. (flutter/engine#41591)
Adds the `dart:js_interop_unsafe` library to the SDK.
2023-05-03 08:38:33 -07:00
Srujan Gaddam
e253aeff60 Remove package:js references and move to dart:js_interop (flutter/engine#41212)
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.
2023-04-25 12:20:12 -07:00
Jackson Gardner
c2719b8e06 Reland ui_web files in sky_engine (flutter/engine#41169)
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
2023-04-17 22:31:25 +00:00
Jackson Gardner
439141c38d Skwasm scene (flutter/engine#40330)
Skwasm scene
2023-04-10 17:38:57 +00:00
Jackson Gardner
12f968e369 Don't build wasm targets for the web sdk archive in host mode. (flutter/engine#40967)
Don't build wasm targets for the web sdk archive in host mode.
2023-04-06 23:04:59 +00:00
Jackson Gardner
911b85dc77 Copy canvaskit files directly into flutter_web_sdk (flutter/engine#40951)
Copy canvaskit files directly into `flutter_web_sdk`
2023-04-05 22:55:41 +00:00
joshualitt
bee9f91790 [web] Migrate EventListener's to JS types. (flutter/engine#40566) 2023-04-04 09:53:13 -07:00
Jackson Gardner
1a59a35e3c ui_web library (flutter/engine#40608)
`ui_web` library
2023-03-30 23:14:18 +00:00
Mouad Debbar
13a74dcec7 [web] Print screenshot paths at the right spot (flutter/engine#40714)
[web] Print screenshot paths at the right spot
2023-03-28 16:47:05 +00:00
Michael Goderbauer
a508065bbc Reland "Post 3.0 lint sync (#40394)" (flutter/engine#40688)
Reland "Post 3.0 lint sync (#40394)"
2023-03-28 03:25:02 +00:00
Jackson Gardner
82886d52b3 Web test reorganization (flutter/engine#39984)
Web test reorganization
2023-03-28 00:08:48 +00:00
Brandon DeRosier
9e9590a68f Revert "Post 3.0 lint sync (#40394)" (flutter/engine#40687)
This reverts commit 8ba209121d2671b0d202d9731fe67ec5eb1529b4.
2023-03-27 15:45:59 -07:00
Michael Goderbauer
8ba209121d Post 3.0 lint sync (flutter/engine#40394)
Post 3.0 lint sync
2023-03-27 17:15:08 +00:00
Jackson Gardner
b6af3bcc91 Ensure all golden filenames end in .png. (flutter/engine#40604)
Ensure all golden filenames end in .png.
2023-03-24 19:28:57 +00:00
Michael Goderbauer
9026c75b1c Use bundled analyzer everywhere (flutter/engine#40398)
Use analyzer from dart source everywhere
2023-03-17 21:21:04 +00:00
Michael Goderbauer
7187bc8e88 Update analyzer for api_conform_test (flutter/engine#40386)
Update analyzer for api_conform_test
2023-03-17 19:15:50 +00:00
Michael Goderbauer
1986d84d6e replace some ._() constructors with class modifiers (flutter/engine#40328)
replace some ._() constructors with class modifiers
2023-03-17 16:18:49 +00:00
joshualitt
be4da063e8 add support for JS types (flutter/engine#40310) 2023-03-17 08:27:53 -07:00
Jackson Gardner
5508a04de1 Output web test artifacts to out directory. (flutter/engine#40355)
Output web test artifacts to out directory.
2023-03-16 22:19:55 +00:00
Michael Goderbauer
dcc4b1b535 Reland: Bump lower Dart SDK constraints to 3.0 (flutter/engine#40318)
* WIP

Bump to 3.0.0-0

* fix lints

* drop web_ui

* opt pointer_converter.dart out of dart 3

* Revert "drop web_ui"

This reverts commit b97a015d5cd0d7e0380a4231be4c31aad36671f1.
2023-03-16 08:07:39 -07:00
Zachary Anderson
32b3e66d7c Revert "Bump lower Dart SDK constraints to 3.0 (#40178)" (flutter/engine#40317)
Revert "Bump lower Dart SDK constraints to 3.0"
2023-03-15 18:53:00 +00:00
Michael Goderbauer
828f3deb86 Bump lower Dart SDK constraints to 3.0 (flutter/engine#40178)
Bump lower Dart SDK constraints to 3.0
2023-03-15 17:57:04 +00:00
Michael Goderbauer
bd58dd7222 Bump pubspecs to unblock Dart SDK roller (flutter/engine#40297)
Bump pubspecs to unblock Dart SDK roller
2023-03-15 06:46:22 +00:00
Yegor
e9abb22ba1 Revert "[web] Access engine version to get correct gstatic URL (#40194)" (flutter/engine#40235)
This reverts commit 46682951fe7f61296070c2fdfb673576628bbd89.
2023-03-10 14:46:06 -08:00
Harry Terkelsen
46682951fe [web] Access engine version to get correct gstatic URL (flutter/engine#40194) 2023-03-10 10:16:48 -08:00
Mouad Debbar
f9989a551d [web] Copy canvaskit_chromium/* to canvaskit/chromium/* (flutter/engine#39796)
[web] Copy canvaskit_chromium/* to canvaskit/chromium/*
2023-03-03 22:07:49 +00:00
LongCatIsLooong
48c413ae2f Add new test font (flutter/engine#39809)
Add new test font
2023-03-03 21:38:01 +00:00
Jackson Gardner
d41ba81937 Don't include other files outisde the flutter_web_sdk. (flutter/engine#40009)
Don't include other files outside the flutter_web_sdk.
2023-03-02 06:37:07 +00:00
Jackson Gardner
a3dc9e77fb Skwasm Renderer - initial implementation (flutter/engine#39072)
Skwasm Renderer - initial implementation
2023-03-02 00:01:04 +00:00
Yegor
543f998577 [web] consolidate network code into httpFetch (flutter/engine#39657)
* consolidate network code into httpFetch

* make HTTP test cross-browser friendly; fix copypasta
2023-02-16 00:02:02 +00:00
Michael Goderbauer
c545a799d2 Remove unnecessary null checks (flutter/engine#39113) 2023-01-25 10:15:02 -08:00
Mouad Debbar
105bb9ab43 [web] Build multiple CanvasKit variants (using toolchain_args) (flutter/engine#38448)
* [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
2023-01-23 20:37:18 +00:00
Pierrick Bouvier
3811a350df Add CI builder for windows-arm64. (#38394) (flutter/engine#38739)
* 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.
2023-01-11 23:01:08 +00:00