Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web]: update how flutter web builds its sdk artifacts #99161

Closed
sigmundch opened this issue Feb 25, 2022 · 2 comments
Closed

[web]: update how flutter web builds its sdk artifacts #99161

sigmundch opened this issue Feb 25, 2022 · 2 comments
Assignees
Labels
dependency: dart Dart team may need to help us e: web_canvaskit CanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Web e: web_html HTML rendering backend for Web engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list platform-web Web applications specifically

Comments

@sigmundch
Copy link
Contributor

Currently flutter web uses a mix of approaches to build its SDK artifacts, which are different than what's done in the Dart SDK repo and our internal build systems. We would like to align them.

This includes the following small changes:

  • Build DDC artifacts using the compile_platform script instead of the kernel_worker. Technically the output of both tools is supposed to be the same, so this part of the change is only for consistency/tech debt.
  • Replace dart2js artifacts and include dart:ui. Today flutter web ships the artifacts from the Dart SDK. All dart:* libraries in the Dart SDK are shipped as a kernel binary file. Whereas dart:ui and dart:_engine are shipped as source. This pushes the cost of compiling these libraries to the client. This may not be noticeable to users, but it feels wasteful and inconsistent with what we do elsewhere since are doing this effort on every single build of a flutter web application in the wild.

There are two things worth noting:

  • Until recently, the compile_platform script didn't support specifying a second library as an input, as a result this was not possible before. We have fixed that in dart-lang/sdk@14fa941
  • Flutter web still offers 3 variants of the SDK (html, canvaskit, autodetect) and chooses among them using const-fromEnvironment expressions. When compiling to kernel we may need 3 .dill files, one per configuration where those const expressions are evaluated according to the 3 variants. Technically, we could work with a single .dill file and leave those expressions unevaluated as well, but this may be in conflict with future plans of the dart2js team. While dart2js supports unevaluated constants today, but we are in the process of changing that to front-load constant evaluation. Doing so will allow us to leverage more modular analyses in the future.
@sigmundch sigmundch added engine flutter/engine repository. See also e: labels. platform-web Web applications specifically e: web_html HTML rendering backend for Web e: web_canvaskit CanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Web labels Feb 25, 2022
@yjbanov yjbanov added dependency: dart Dart team may need to help us P2 Important issues not at the top of the work list labels Mar 3, 2022
@eyebrowsoffire eyebrowsoffire self-assigned this Mar 8, 2022
@eyebrowsoffire eyebrowsoffire removed their assignment May 5, 2022
@eyebrowsoffire eyebrowsoffire self-assigned this Nov 18, 2022
@yjbanov
Copy link
Contributor

yjbanov commented Jan 13, 2023

This is done enough. Whatever work remains, let's file more specific issues.

@yjbanov yjbanov closed this as completed Jan 13, 2023
@github-actions
Copy link

github-actions bot commented Mar 4, 2023

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependency: dart Dart team may need to help us e: web_canvaskit CanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Web e: web_html HTML rendering backend for Web engine flutter/engine repository. See also e: labels. P2 Important issues not at the top of the work list platform-web Web applications specifically
Projects
None yet
Development

No branches or pull requests

3 participants