adjust the HtmlWebSocketChannel ctor parameter type; rev to 2.4.3 (dart-lang/web_socket_channel#320)
adjust the HtmlWebSocketChannel ctor parameter type
diff --git a/pkgs/web_socket_channel/.github/workflows/test-package.yml b/pkgs/web_socket_channel/.github/workflows/test-package.yml
index e25fcf6..b921ab4 100644
--- a/pkgs/web_socket_channel/.github/workflows/test-package.yml
+++ b/pkgs/web_socket_channel/.github/workflows/test-package.yml
@@ -42,7 +42,7 @@
fail-fast: false
matrix:
os: [ubuntu-latest]
- sdk: [3.2.0, dev]
+ sdk: [3.2, dev]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
@@ -60,3 +60,12 @@
- name: Run Chrome tests - wasm
run: dart test --platform chrome --compiler dart2wasm
if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev'
+
+ # Run analysis against the oldest supported pub constraints.
+ downgrade:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
+ - uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
+ - run: dart pub downgrade
+ - run: dart analyze --fatal-infos
diff --git a/pkgs/web_socket_channel/CHANGELOG.md b/pkgs/web_socket_channel/CHANGELOG.md
index 44c0784..d476216 100644
--- a/pkgs/web_socket_channel/CHANGELOG.md
+++ b/pkgs/web_socket_channel/CHANGELOG.md
@@ -1,4 +1,10 @@
-## 2.4.2
+## 2.4.3
+
+- `HtmlWebSocketChannel`: Relax the type of the websocket parameter to the
+ constructor in order to mitigate a breaking change introduced in `2.4.1`.
+
+## 2.4.2 (retracted)
+
- Allow `web: '>=0.3.0 <0.5.0'`
## 2.4.1
diff --git a/pkgs/web_socket_channel/README.md b/pkgs/web_socket_channel/README.md
index ec4c736..35f16c8 100644
--- a/pkgs/web_socket_channel/README.md
+++ b/pkgs/web_socket_channel/README.md
@@ -1,7 +1,13 @@
[](https://github.com/dart-lang/web_socket_channel/actions/workflows/test-package.yml)
+[](https://pub.dev/packages/web_socket_channel)
+[](https://pub.dev/packages/web_socket_channel/publisher)
-The `web_socket_channel` package provides [`StreamChannel`][stream_channel]
-wrappers for WebSocket connections. It provides a cross-platform
+`package:web_socket_channel` provides cross-platform
+[`StreamChannel`][stream_channel] wrappers for WebSocket connections.
+
+## Docs and Usage
+
+It provides a cross-platform
[`WebSocketChannel`][WebSocketChannel] API, a cross-platform implementation of
that API that communicates over an underlying [`StreamChannel`][stream_channel],
[an implementation][IOWebSocketChannel] that wraps `dart:io`'s `WebSocket`
diff --git a/pkgs/web_socket_channel/lib/html.dart b/pkgs/web_socket_channel/lib/html.dart
index e36dab0..5212e20 100644
--- a/pkgs/web_socket_channel/lib/html.dart
+++ b/pkgs/web_socket_channel/lib/html.dart
@@ -82,8 +82,12 @@
)..binaryType = (binaryType ?? BinaryType.list).value,
);
- /// Creates a channel wrapping [innerWebSocket].
- HtmlWebSocketChannel(this.innerWebSocket) {
+ /// Creates a channel wrapping [webSocket].
+ ///
+ /// The parameter [webSocket] should be either a dart:html `WebSocket`
+ /// instance or a package:web [WebSocket] instance.
+ HtmlWebSocketChannel(Object /*WebSocket*/ webSocket)
+ : innerWebSocket = webSocket as WebSocket {
_readyCompleter = Completer();
if (innerWebSocket.readyState == WebSocket.OPEN) {
_readyCompleter.complete();
diff --git a/pkgs/web_socket_channel/pubspec.yaml b/pkgs/web_socket_channel/pubspec.yaml
index 3e1338d..2f77f96 100644
--- a/pkgs/web_socket_channel/pubspec.yaml
+++ b/pkgs/web_socket_channel/pubspec.yaml
@@ -1,6 +1,5 @@
name: web_socket_channel
-version: 2.4.2
-
+version: 2.4.3
description: >-
StreamChannel wrappers for WebSockets. Provides a cross-platform
WebSocketChannel API, a cross-platform implementation of that API that
@@ -14,7 +13,7 @@
async: ^2.5.0
crypto: ^3.0.0
stream_channel: ^2.1.0
- web: '>=0.3.0 <0.5.0'
+ web: ^0.4.0
dev_dependencies:
dart_flutter_team_lints: ^2.0.0