-
Notifications
You must be signed in to change notification settings - Fork 6k
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
ui_web
library
#40608
ui_web
library
#40608
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
I don't have strong opinions on the library name, so I'll save you the bikeshedding from my end :)
@@ -4,18 +4,18 @@ | |||
|
|||
import 'package:meta/meta.dart'; | |||
import 'package:ui/ui.dart' as ui; | |||
import '../../../ui_web/src/ui_web.dart' as ui_web; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How hard would it be to make this similar to the package:ui/ui.dart
above? (i.e. package:ui_web/ui_web.dart
or something like that). I guess it's just a matter of rewriting it in the sdk_rewriter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just gets erased by the rewriter, and in the top-level library file it says import 'dart:ui_web' as ui_web;
so for the original source files we can import it any way we like as long as it is imported under the name ui_web
. I can try to find a cleaner way to do this import.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second look, I think package:ui/src/ui_web.dart
should work already?
@@ -183,15 +183,15 @@ class MultiEntriesBrowserHistory extends BrowserHistory { | |||
} | |||
|
|||
@override | |||
void onPopState(covariant DomPopStateEvent event) { | |||
void onPopState(covariant DomPopStateEvent state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep it the name event
or make it Object? state
?
I have a feeling you were trying to change DomPopStateEvent event
==> Object? state
but forgot to finish the change, or reverted it partially.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... you're right, I kind of did a half-measure here. I think I can clean this up a bit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what I ended up doing here is to basically unwrap the JS event in JSUrlStrategy
before it actually gets to the darty UrlStrategy
object, and so the pop state listener just takes the state itself. I think this is a bit better. For stuff on the framework side that uses actual JS interop to do the pop listener thing, they can just unwrap it there as well. The path through JSUrlStrategy remains unchanged, so I think this is non-breaking for the framework (but I'll find out as soon as I start testing against the framework side).
Co-authored-by: Mouad Debbar <mdebbar@google.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// found in the LICENSE file. | ||
|
||
/// This library defines the web-specific additions that go along with dart:ui | ||
library ui_web; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
library ui_web; | |
library; |
We now support name-less libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I definitely don't want a nameless library though. This is a library that the framework (and maybe eventually users) will use by name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name will map to the file name, though. tis fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also: #40669
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sdk_rewriter will not be able to rewrite this file properly without this statement.
That's okay. I don't think it's a huge deal
…On Mon, Mar 27, 2023, 16:17 Jackson Gardner ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In lib/web_ui/lib/ui_web/src/ui_web.dart
<#40608 (comment)>:
> @@ -0,0 +1,8 @@
+// Copyright 2013 The Flutter Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+/// This library defines the web-specific additions that go along with dart:ui
+library ui_web;
The sdk_rewriter will not be able to rewrite this file properly without
this statement.
—
Reply to this email directly, view it on GitHub
<#40608 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEFCSAHDKEFF7EJGLTICLW6IN2FANCNFSM6AAAAAAWG73EVA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
I'm going to wait until after the branch cut to merge this. |
…123833) flutter/engine@571c5de...c0e7cd5 2023-03-31 bdero@google.com [Impeller] iOS/macOS: Only wait for command scheduling prior to present (flutter/engine#40781) 2023-03-31 skia-flutter-autoroll@skia.org Roll Skia from 9b2e538f1367 to f6c1eefd4600 (4 revisions) (flutter/engine#40807) 2023-03-30 dnfield@google.com Revert "[Impeller] move everything needed by the code gen template to core (#40801)" (flutter/engine#40811) 2023-03-30 dnfield@google.com [Impeller] Delete dead code from reflector.cc (flutter/engine#40805) 2023-03-30 dnfield@google.com [Impeller] move everything needed by the code gen template to core (flutter/engine#40801) 2023-03-30 jacksongardner@google.com `ui_web` library (flutter/engine#40608) 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 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
…lutter#123833) flutter/engine@571c5de...c0e7cd5 2023-03-31 bdero@google.com [Impeller] iOS/macOS: Only wait for command scheduling prior to present (flutter/engine#40781) 2023-03-31 skia-flutter-autoroll@skia.org Roll Skia from 9b2e538f1367 to f6c1eefd4600 (4 revisions) (flutter/engine#40807) 2023-03-30 dnfield@google.com Revert "[Impeller] move everything needed by the code gen template to core (flutter#40801)" (flutter/engine#40811) 2023-03-30 dnfield@google.com [Impeller] Delete dead code from reflector.cc (flutter/engine#40805) 2023-03-30 dnfield@google.com [Impeller] move everything needed by the code gen template to core (flutter/engine#40801) 2023-03-30 jacksongardner@google.com `ui_web` library (flutter/engine#40608) 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 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
This is based off (and dependent on) these changes in the web engine that expose web-specific APIs: flutter/engine#40608
This introduces a public
ui_web
library that contains web-specific flutter APIs. The first thing to incorporate into this isUrlStrategy
, which will allow us to replace a lot of the magic JS interop handshaking between framework and engine into a formalized API.