Skip to content

package:shelf_web_socket v3.0.0

Latest
Compare
Choose a tag to compare
@devoncarew devoncarew released this 30 Jan 17:49
2a7442f
  • BREAKING:: Change the signature of the webSocketHandler method's
    onConnection callback. Previously this took an untyped function with either
    one or two parameters. This now requires a ConnectionCallback; a typedef
    taking two parameters. See also #457.
  • Add a API usage example.
  • Require Dart ^3.5.0.

Note that most clients seeing analysis issues from the above breaking change can
fix it by adding a second parameter to their callback. So, they would change
this:

webSocketHandler((webSocket) {
  webSocket.stream.listen((message) {
    webSocket.sink.add('echo $message');
  });
});

to this:

webSocketHandler((webSocket, _) {
  webSocket.stream.listen((message) {
    webSocket.sink.add('echo $message');
  });
});