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] Move web-only initialization APIs to dart:ui_web #43111

Merged
merged 8 commits into from
Jun 29, 2023

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Jun 22, 2023

Old API in dart:ui New API in dart:ui_web
webOnlyInitializePlatform ui_web.initializePlatform
webOnlyWarmupEngine ui_web.bootstrapEngine
debugEmulateFlutterTesterEnvironment ui_web.debugEmulateFlutterTesterEnvironment
webOnlySetPluginHandler ui_web.setPluginHandler

Part of flutter/flutter#126831

@mdebbar mdebbar requested review from yjbanov and ditman June 22, 2023 21:49
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Jun 22, 2023
/// Flutter framework.
///
/// Unlike [warmupEngine], this method initializes UI and non-UI services.
Future<void> initializePlatform() async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not call it initializeEngine?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason. I just removed the webOnly prefix from the name. I think initializeEngine makes more sense, and is more consistent with warmupEngine.

lib/web_ui/lib/ui_web/src/ui_web/initialization.dart Outdated Show resolved Hide resolved
lib/web_ui/lib/ui_web/src/ui_web/initialization.dart Outdated Show resolved Hide resolved
lib/web_ui/lib/ui_web/src/ui_web/initialization.dart Outdated Show resolved Hide resolved
lib/web_ui/lib/ui_web/src/ui_web/initialization.dart Outdated Show resolved Hide resolved
lib/web_ui/lib/ui_web/src/ui_web/initialization.dart Outdated Show resolved Hide resolved
lib/web_ui/lib/ui_web/src/ui_web/initialization.dart Outdated Show resolved Hide resolved
}
// TODO(mdebbar): Deprecate this and remove it.
// https://github.com/flutter/flutter/issues/127395
bool get debugEmulateFlutterTesterEnvironment {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something that is needed for end users, or is this only for our testing? If it's only for our engine testing, it probably should live within engine or similar, rather than be exposed to web_ui?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Never mind, this is used all over the bootstrap and the framework!)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, this could be hidden behind JS-interop, if we don't want it to show up in the public APIs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

debugEmulateFlutterTesterEnvironment has effect on several things including the usage of Ahem font. If users want their tests to produce real text (e.g. for screenshots), they have to disable debugEmulateFlutterTesterEnvironment.

@mdebbar
Copy link
Contributor Author

mdebbar commented Jun 27, 2023

  1. Not moving webOnlyInitializePlatform to dart:ui_web anymore. We might be able to switch all call sites to use bootstrapEngine instead.
  2. Renamed warmupEngine to bootstrapEngine.
  3. Updated the docs of bootstrapEngine.

@mdebbar mdebbar requested review from yjbanov and ditman June 27, 2023 19:39
lib/web_ui/lib/ui_web/src/ui_web/initialization.dart Outdated Show resolved Hide resolved
lib/web_ui/lib/ui_web/src/ui_web/plugins.dart Outdated Show resolved Hide resolved
@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 29, 2023
@auto-submit auto-submit bot merged commit 9a3d191 into flutter:main Jun 29, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 29, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jun 29, 2023
…129799)

flutter/engine@cd9ce66...68cc1a7

2023-06-29 skia-flutter-autoroll@skia.org Roll Skia from a4d0373cd414 to c83f8ba23a80 (3 revisions) (flutter/engine#43340)
2023-06-29 mdebbar@google.com [web] Move web-only initialization APIs to `dart:ui_web` (flutter/engine#43111)
2023-06-29 skia-flutter-autoroll@skia.org Roll Skia from 8ada2c4b2947 to a4d0373cd414 (14 revisions) (flutter/engine#43338)
2023-06-29 skia-flutter-autoroll@skia.org Roll Dart SDK from 656201921b30 to ecc2440be198 (1 revision) (flutter/engine#43333)
2023-06-29 skia-flutter-autoroll@skia.org Roll Skia from 0c320b3d5b64 to 8ada2c4b2947 (1 revision) (flutter/engine#43332)
2023-06-29 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from fxCNy4QivAngZXkvM... to nboAFpQUzwtrESDVo... (flutter/engine#43334)
2023-06-29 kustermann@google.com Prepare for utf8.encode() to return more precise Uint8List type (flutter/engine#43335)
2023-06-29 jason-simmons@users.noreply.github.com [Impeller] Ensure that the auto-release pool is available when the GoldenPlaygroundTestImpl is destructed (flutter/engine#43322)
2023-06-29 uysalere@gmail.com [fuchsia] Remove strict equality check for SkMatrix comparison for Fl� (flutter/engine#43309)
2023-06-29 jason-simmons@users.noreply.github.com [Impeller] Add an autorelease pool to the GoldenTests fixture (flutter/engine#43323)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from fxCNy4QivAng to nboAFpQUzwtr

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-engine-flutter-autoroll
Please CC jimgraham@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
kjlubick pushed a commit to kjlubick/engine that referenced this pull request Jul 14, 2023
| Old API in `dart:ui` | New API in `dart:ui_web` |
|-|-|
| ~`webOnlyInitializePlatform`~ | ~`ui_web.initializePlatform`~ |
| `webOnlyWarmupEngine` | `ui_web.bootstrapEngine` |
| `debugEmulateFlutterTesterEnvironment` | `ui_web.debugEmulateFlutterTesterEnvironment` |
| `webOnlySetPluginHandler` | `ui_web.setPluginHandler` |

Part of flutter/flutter#126831
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants