pauldemarco / socketcluster_client

SocketCluster.io Client for Dart
BSD 3-Clause "New" or "Revised" License
12 stars 10 forks source link

Update repo to allow a "platform" to opt for io or html websocket #9

Closed kealjones-wk closed 5 years ago

kealjones-wk commented 5 years ago

Motivation

This repo currently only worked for io based projects meaning that it could not be used in a browser. This project also happens to be the main websocket connection method used by https://github.com/MichaelMarner/dart-redux-remote-devtools which we would like to take advantage of in the browser.

Changes

This update allows users who would like to use the html based websocket to do so by simply adding:

import 'package:socketcluster_client/src/socket_platform.dart';
import 'package:socketcluster_client/src/socket_platform_http.dart';

and then in main adding:

 globalSocketPlatform = HttpSocketPlatform();

Review

@pauldemarco I would love your feedback on this PR. If you have any issue with its approach please let me know and i would be happy to discuss. My teammates will also be reviewing to double check my work.

kealjones-wk commented 5 years ago

@pauldemarco Just curious if you've seen this yet. :)

pauldemarco commented 5 years ago

I’ll take a look, thanks!

kealjones-wk commented 5 years ago

no rush, i can always just fork this while this is in review, I was just hoping to contribute to everyone's benefit.

pauldemarco commented 5 years ago

This all looks good to me!

pauldemarco commented 5 years ago

Also, love that this is being used in the remote devtools, that's super cool!

MichaelMarner commented 5 years ago

Could this also be published to pub.dev? Latest version is still 0.0.3:

https://pub.dev/packages/socketcluster_client

I can then update the devtools dependency.

Thanks