-
Notifications
You must be signed in to change notification settings - Fork 111
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
migrate to pkg web #294
migrate to pkg web #294
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:web/helpers.dart'; | ||
kevmoo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
// TODO(kevmoo): remove when https://github.com/dart-lang/web/commit/4cb5811ed06 | ||
// is in a published release and the min constraint on pkg:web is updated | ||
extension WebSocketEvents on WebSocket { | ||
Stream<Event> get onOpen => EventStreamProviders.openEvent.forTarget(this); | ||
Stream<MessageEvent> get onMessage => | ||
EventStreamProviders.messageEvent.forTarget(this); | ||
Stream<CloseEvent> get onClose => | ||
EventStreamProviders.closeEvent.forTarget(this); | ||
Stream<Event> get onError => | ||
EventStreamProviders.errorEventSourceEvent.forTarget(this); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ dependencies: | |
async: ^2.5.0 | ||
crypto: ^3.0.0 | ||
stream_channel: ^2.1.0 | ||
web: ^0.4.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Its definitely good to start dogfooding this stuff; does this in any way tie our hands wrt publishing packages that now depend on it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to be careful about Flutter pinning There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might want to allow the same version range as http (from dart-lang/http#1055) EDIT: Just read "I'm not racing to publish this", probably not a bad change to add though still |
||
|
||
dev_dependencies: | ||
dart_flutter_team_lints: ^2.0.0 | ||
|
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.
Why is the default
arraybuffer
? Looks like it'sblob
according to https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/binaryType