2.4.1 seems to have introduced breaking changes
KammererTob opened this issue · 5 comments
I've noticed that my package which depends on web_socket_channel
suddenly has a "Analysis Issue" in pub.dev (https://pub.dev/packages/stomp_dart_client/score). This seems to be because of a breaking change introduced in 2.4.1. The change in question seems to be a move to the web
package for the HTML WebSocket implementation.
Here is part of my code which is breaking because of that:
final completer = Completer<HtmlWebSocketChannel>();
final webSocket = WebSocket(config.connectUrl)
..binaryType = BinaryType.list.value;
webSocket.onOpen.first.then((value) {
completer.complete(HtmlWebSocketChannel(webSocket));
});
Previously HtmlWebSocketChannel
was expecting a WebSocket
from the dart:html
library. After 2.4.1 it seems to be expecting it from the package:web
package.
Was this intentional? I am a bit hesitant to also move my project to the web
package since it currently is still flagged as "highly experimental" (https://github.com/dart-lang/web)
Related closed issue in the pub.dev repo: dart-lang/pub-dev#7327
Do you mind posting the analysis issue you see?
Thanks for the report! It looks like the port to package:web was unintentionally a breaking API change. This should have been done in a new major version of this package (3.0.0
). We'll need to do some cleanup here, which may involve reverting the 2.x version of this package to continue to use dart:html, and re-publishing the package:web based version as 3.0.0.
I'm going to close this as the issue has mostly been addressed. If people find new breaking changes please re-open or create a new issue.
Thanks for addressing this so quickly!