Skip to content

Commit 7f9dfcf

Browse files
authored
Support latest pkg:shelf_web_socket (#3837)
builder_runner and build_daemon
1 parent eb5454c commit 7f9dfcf

File tree

5 files changed

+18
-11
lines changed

5 files changed

+18
-11
lines changed

build_daemon/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 4.0.4
2+
3+
- Support the latest `package:shelf_web_socket`.
4+
15
## 4.0.3
26

37
- Bump the min sdk to 3.6.0.

build_daemon/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_daemon
2-
version: 4.0.3
2+
version: 4.0.4
33
description: A daemon for running Dart builds.
44
repository: https://github.com/dart-lang/build/tree/master/build_daemon
55
resolution: workspace
@@ -16,10 +16,10 @@ dependencies:
1616
path: ^1.8.0
1717
pool: ^1.5.0
1818
shelf: ^1.0.0
19-
shelf_web_socket: ">=1.0.0 <3.0.0"
19+
shelf_web_socket: ">=1.0.0 <4.0.0"
2020
stream_transform: ^2.0.0
2121
watcher: ^1.0.0
22-
web_socket_channel: ">=2.0.0 <4.0.0"
22+
web_socket_channel: ">=2.3.0 <4.0.0"
2323

2424
dev_dependencies:
2525
analyzer: '>=3.4.0 <8.0.0'

build_runner/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
## 2.4.15-wip
1+
## 2.4.15
22

33
- Update to package:web and dart:js_interop.
4+
- Support the latest `package:shelf_web_socket`.
45

56
## 2.4.14
67

build_runner/lib/src/server/server.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ class ServeHandler implements BuildState {
198198
/// build updates
199199
class BuildUpdatesWebSocketHandler {
200200
final connectionsByRootDir = <String, List<WebSocketChannel>>{};
201-
final shelf.Handler Function(Function, {Iterable<String> protocols})
202-
_handlerFactory;
201+
final shelf.Handler Function(
202+
void Function(WebSocketChannel webSocket, String? subprotocol), {
203+
Iterable<String> protocols,
204+
}) _handlerFactory;
203205
final _internalHandlers = <String, shelf.Handler>{};
204206
final WatchImpl _state;
205207

@@ -208,7 +210,7 @@ class BuildUpdatesWebSocketHandler {
208210

209211
shelf.Handler createHandlerByRootDir(String rootDir) {
210212
if (!_internalHandlers.containsKey(rootDir)) {
211-
void closureForRootDir(WebSocketChannel webSocket, String protocol) =>
213+
void closureForRootDir(WebSocketChannel webSocket, String? protocol) =>
212214
_handleConnection(webSocket, protocol, rootDir);
213215
_internalHandlers[rootDir] = _handlerFactory(closureForRootDir,
214216
protocols: [_buildUpdatesProtocol]);
@@ -239,7 +241,7 @@ class BuildUpdatesWebSocketHandler {
239241
}
240242

241243
void _handleConnection(
242-
WebSocketChannel webSocket, String protocol, String rootDir) async {
244+
WebSocketChannel webSocket, String? protocol, String rootDir) async {
243245
var connections = connectionsByRootDir.putIfAbsent(rootDir, () => [])
244246
..add(webSocket);
245247
await webSocket.stream.drain<void>();

build_runner/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_runner
2-
version: 2.4.15-wip
2+
version: 2.4.15
33
description: A build system for Dart code generation and modular compilation.
44
repository: https://github.com/dart-lang/build/tree/master/build_runner
55
resolution: workspace
@@ -41,13 +41,13 @@ dependencies:
4141
pub_semver: ^2.0.0
4242
pubspec_parse: ^1.0.0
4343
shelf: ^1.0.0
44-
shelf_web_socket: ">=1.0.0 <3.0.0"
44+
shelf_web_socket: ">=1.0.0 <4.0.0"
4545
stack_trace: ^1.10.0
4646
stream_transform: ^2.0.0
4747
timing: ^1.0.0
4848
watcher: ^1.0.0
4949
web: ^1.1.0
50-
web_socket_channel: ">=2.0.0 <4.0.0"
50+
web_socket_channel: ">=2.3.0 <4.0.0"
5151
yaml: ^3.0.0
5252

5353
dev_dependencies:

0 commit comments

Comments
 (0)