Skip to content
This repository was archived by the owner on Feb 24, 2025. It is now read-only.

Commit 041aa3c

Browse files
authored
adjust the HtmlWebSocketChannel ctor parameter type; rev to 2.4.3 (#320)
adjust the HtmlWebSocketChannel ctor parameter type
1 parent 0e8bedc commit 041aa3c

File tree

5 files changed

+33
-9
lines changed

5 files changed

+33
-9
lines changed

.github/workflows/test-package.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
fail-fast: false
4343
matrix:
4444
os: [ubuntu-latest]
45-
sdk: [3.2.0, dev]
45+
sdk: [3.2, dev]
4646
steps:
4747
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
4848
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
@@ -60,3 +60,12 @@ jobs:
6060
- name: Run Chrome tests - wasm
6161
run: dart test --platform chrome --compiler dart2wasm
6262
if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev'
63+
64+
# Run analysis against the oldest supported pub constraints.
65+
downgrade:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
69+
- uses: dart-lang/setup-dart@b64355ae6ca0b5d484f0106a033dd1388965d06d
70+
- run: dart pub downgrade
71+
- run: dart analyze --fatal-infos

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
## 2.4.2
1+
## 2.4.3
2+
3+
- `HtmlWebSocketChannel`: Relax the type of the websocket parameter to the
4+
constructor in order to mitigate a breaking change introduced in `2.4.1`.
5+
6+
## 2.4.2 (retracted)
7+
28
- Allow `web: '>=0.3.0 <0.5.0'`
39

410
## 2.4.1

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
[![CI](https://github.com/dart-lang/web_socket_channel/actions/workflows/test-package.yml/badge.svg?branch=master)](https://github.com/dart-lang/web_socket_channel/actions/workflows/test-package.yml)
2+
[![pub package](https://img.shields.io/pub/v/web_socket_channel.svg)](https://pub.dev/packages/web_socket_channel)
3+
[![package publisher](https://img.shields.io/pub/publisher/web_socket_channel.svg)](https://pub.dev/packages/web_socket_channel/publisher)
24

3-
The `web_socket_channel` package provides [`StreamChannel`][stream_channel]
4-
wrappers for WebSocket connections. It provides a cross-platform
5+
`package:web_socket_channel` provides cross-platform
6+
[`StreamChannel`][stream_channel] wrappers for WebSocket connections.
7+
8+
## Docs and Usage
9+
10+
It provides a cross-platform
511
[`WebSocketChannel`][WebSocketChannel] API, a cross-platform implementation of
612
that API that communicates over an underlying [`StreamChannel`][stream_channel],
713
[an implementation][IOWebSocketChannel] that wraps `dart:io`'s `WebSocket`

lib/html.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,12 @@ class HtmlWebSocketChannel extends StreamChannelMixin
8282
)..binaryType = (binaryType ?? BinaryType.list).value,
8383
);
8484

85-
/// Creates a channel wrapping [innerWebSocket].
86-
HtmlWebSocketChannel(this.innerWebSocket) {
85+
/// Creates a channel wrapping [webSocket].
86+
///
87+
/// The parameter [webSocket] should be either a dart:html `WebSocket`
88+
/// instance or a package:web [WebSocket] instance.
89+
HtmlWebSocketChannel(Object /*WebSocket*/ webSocket)
90+
: innerWebSocket = webSocket as WebSocket {
8791
_readyCompleter = Completer();
8892
if (innerWebSocket.readyState == WebSocket.OPEN) {
8993
_readyCompleter.complete();

pubspec.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: web_socket_channel
2-
version: 2.4.2
3-
2+
version: 2.4.3
43
description: >-
54
StreamChannel wrappers for WebSockets. Provides a cross-platform
65
WebSocketChannel API, a cross-platform implementation of that API that
@@ -14,7 +13,7 @@ dependencies:
1413
async: ^2.5.0
1514
crypto: ^3.0.0
1615
stream_channel: ^2.1.0
17-
web: '>=0.3.0 <0.5.0'
16+
web: ^0.4.0
1817

1918
dev_dependencies:
2019
dart_flutter_team_lints: ^2.0.0

0 commit comments

Comments
 (0)