From 63186f090fde4422757fad9632929912223e2285 Mon Sep 17 00:00:00 2001 From: Srujan Gaddam Date: Thu, 16 Nov 2023 09:02:13 -0800 Subject: [PATCH] Pin package:web 0.4.0 Now that Flutter main has moved to ^0.4.0, we can pin this version. --- flutter-candidate.txt | 2 +- .../lib/src/extensions/embedded/_controller_web.dart | 4 +--- .../perfetto/_perfetto_controller_web.dart | 4 +--- .../lib/src/shared/config_specific/analysis_options.yaml | 6 ------ .../notifications/_notifications_web.dart | 8 ++++---- .../config_specific/post_message/_post_message_web.dart | 9 ++------- packages/devtools_app/pubspec.yaml | 2 +- packages/devtools_app_shared/pubspec.yaml | 2 +- packages/devtools_extensions/pubspec.yaml | 2 +- 9 files changed, 12 insertions(+), 27 deletions(-) delete mode 100644 packages/devtools_app/lib/src/shared/config_specific/analysis_options.yaml diff --git a/flutter-candidate.txt b/flutter-candidate.txt index e489f3279e0a..00d21f4ce501 100644 --- a/flutter-candidate.txt +++ b/flutter-candidate.txt @@ -1 +1 @@ -3.17.0-9.0.pre +3.17.0-10.0.pre diff --git a/packages/devtools_app/lib/src/extensions/embedded/_controller_web.dart b/packages/devtools_app/lib/src/extensions/embedded/_controller_web.dart index 57e7ba58ba17..da221abd3e50 100644 --- a/packages/devtools_app/lib/src/extensions/embedded/_controller_web.dart +++ b/packages/devtools_app/lib/src/extensions/embedded/_controller_web.dart @@ -74,9 +74,7 @@ class EmbeddedExtensionControllerImpl extends EmbeddedExtensionController ); _initialized = true; - // TODO(kenz): replace with `createIFrameElement` when we upgrade to - // package:web ^0.3.1. - _extensionIFrame = createElementTag('iframe') as HTMLIFrameElement + _extensionIFrame = createIFrameElement() // This url is safe because we built it ourselves and it does not include // any user input. // ignore: unsafe_html diff --git a/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_controller_web.dart b/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_controller_web.dart index 31fd9e9b6a8e..e4ba4eb22b7e 100644 --- a/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_controller_web.dart +++ b/packages/devtools_app/lib/src/screens/performance/panes/timeline_events/perfetto/_perfetto_controller_web.dart @@ -165,9 +165,7 @@ class PerfettoControllerImpl extends PerfettoController { ); _initialized = true; - // TODO(kenz): replace with `createIFrameElement` when we upgrade to - // package:web ^0.3.1. - _perfettoIFrame = createElementTag('iframe') as HTMLIFrameElement + _perfettoIFrame = createIFrameElement() // This url is safe because we built it ourselves and it does not include // any user input. // ignore: unsafe_html diff --git a/packages/devtools_app/lib/src/shared/config_specific/analysis_options.yaml b/packages/devtools_app/lib/src/shared/config_specific/analysis_options.yaml deleted file mode 100644 index 73fe07731c17..000000000000 --- a/packages/devtools_app/lib/src/shared/config_specific/analysis_options.yaml +++ /dev/null @@ -1,6 +0,0 @@ -include: ../../../../analysis_options.yaml - -linter: - rules: - # For some reasons this doesn't work: https://github.com/dart-lang/linter/issues/4308 - avoid_web_libraries_in_flutter: false diff --git a/packages/devtools_app/lib/src/shared/config_specific/notifications/_notifications_web.dart b/packages/devtools_app/lib/src/shared/config_specific/notifications/_notifications_web.dart index 36e52d18fd90..b0617d289406 100644 --- a/packages/devtools_app/lib/src/shared/config_specific/notifications/_notifications_web.dart +++ b/packages/devtools_app/lib/src/shared/config_specific/notifications/_notifications_web.dart @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file. -import 'dart:js_util'; +import 'dart:js_interop'; import 'package:web/helpers.dart' as web_helpers; import 'package:web/web.dart'; @@ -17,9 +17,9 @@ class Notification { late final web_helpers.Notification _impl; - static Future requestPermission() { - return promiseToFuture(web_helpers.Notification.requestPermission()); - } + static Future requestPermission() async => + ((await web_helpers.Notification.requestPermission().toDart) as JSString) + .toDart; void close() { _impl.close(); diff --git a/packages/devtools_app/lib/src/shared/config_specific/post_message/_post_message_web.dart b/packages/devtools_app/lib/src/shared/config_specific/post_message/_post_message_web.dart index a3a9ae0b520f..c8c298eefea1 100644 --- a/packages/devtools_app/lib/src/shared/config_specific/post_message/_post_message_web.dart +++ b/packages/devtools_app/lib/src/shared/config_specific/post_message/_post_message_web.dart @@ -2,14 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file. -// TODO(https://github.com/flutter/devtools/issues/6606): remove this import. -// This is the final dart:html import in DevTools. In order to remove it, we -// need to bump the `package:web` version in DevTools to > 0.3.1, but we are -// blocked on `package:web` rolling into the Flutter SDK. -import 'dart:html' as html; import 'dart:js_interop'; -import 'package:web/helpers.dart'; +import 'package:web/helpers.dart' as html; import 'post_message.dart'; @@ -23,4 +18,4 @@ Stream get onPostMessage { } void postMessage(Object? message, String targetOrigin) => - window.parent?.postMessage(message.jsify(), targetOrigin.toJS); + html.window.parent?.postMessage(message.jsify(), targetOrigin.toJS); diff --git a/packages/devtools_app/pubspec.yaml b/packages/devtools_app/pubspec.yaml index b7b1d94a2136..9e04737947d9 100644 --- a/packages/devtools_app/pubspec.yaml +++ b/packages/devtools_app/pubspec.yaml @@ -65,7 +65,7 @@ dependencies: vm_service: ^13.0.0 # TODO https://github.com/dart-lang/sdk/issues/52853 - unpin this version vm_snapshot_analysis: 0.7.2 - web: '>=0.3.0 <0.5.0' + web: ^0.4.0 web_socket_channel: ^2.1.0 # widget_icons: ^0.0.1 diff --git a/packages/devtools_app_shared/pubspec.yaml b/packages/devtools_app_shared/pubspec.yaml index 216c5e3429f6..23d08746a41a 100644 --- a/packages/devtools_app_shared/pubspec.yaml +++ b/packages/devtools_app_shared/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: meta: ^1.9.1 pointer_interceptor: ^0.9.3+3 vm_service: ^13.0.0 - web: '>=0.3.0 <0.5.0' + web: ^0.4.0 dev_dependencies: flutter_lints: ^2.0.3 diff --git a/packages/devtools_extensions/pubspec.yaml b/packages/devtools_extensions/pubspec.yaml index 748460966c66..60c22f85654b 100644 --- a/packages/devtools_extensions/pubspec.yaml +++ b/packages/devtools_extensions/pubspec.yaml @@ -21,7 +21,7 @@ dependencies: path: ^1.8.0 logging: ^1.1.1 vm_service: ^13.0.0 - web: '>=0.3.0 <0.5.0' + web: ^0.4.0 dev_dependencies: flutter_driver: