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

Pin package:web 0.4.0 #6750

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,10 @@ class ExportControllerWeb extends ExportController {
final element = document.createElement('a') as HTMLAnchorElement;
element.setAttribute(
'href',
// TODO(srujzs): This is necessary in order to support package:web 0.4.0.
// This was not needed with 0.3.0, hence the lint.
// ignore: avoid-unnecessary-type-casts
URL.createObjectURL(Blob([content.toJS].toJS) as JSObject),
);
element.setAttribute('download', fileName);
element.style.display = 'none';
// TODO(srujzs): This is necessary in order to support package:web 0.4.0.
// This was not needed with 0.3.0, hence the lint.
// ignore: avoid-unnecessary-type-casts
(document.body as HTMLBodyElement).append(element as JSAny);
element.click();
element.remove();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -17,9 +17,9 @@ class Notification {

late final web_helpers.Notification _impl;

static Future<String> requestPermission() {
return promiseToFuture(web_helpers.Notification.requestPermission());
}
static Future<String> requestPermission() async =>
((await web_helpers.Notification.requestPermission().toDart) as JSString)
.toDart;

void close() {
_impl.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,14 @@
// 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 'post_message.dart';

Stream<PostMessageEvent> get onPostMessage {
return html.window.onMessage.map(
return window.onMessage.map(
(message) => PostMessageEvent(
origin: message.origin,
data: message.data,
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,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

Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_app_shared/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/devtools_extensions/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Loading