rikulo / socket.io-client-dart

socket.io-client-dart: Dartlang port of socket.io-client https://github.com/socketio/socket.io-client
https://quire.io
MIT License
675 stars 184 forks source link

Supporting multiple versions of Socket.IO #385

Open zsolthathazi opened 4 months ago

zsolthathazi commented 4 months ago

Hi!

In my application, I have 2 separate packages. One of the packages has to use socket_io_client 1.0.2 to communicate with V2 Socket.IO servers, the other one has to use socket_io_client 2.0.3+1 to communicate with a V3 Socket.IO server.

When I run pub get from the main application's pubspec.yaml, I get the following dependency error:

_Because every version of package_which_uses_socket_io_client 2.0.3+1 from path depends on socket_io_client 2.0.3 and every version of package_which_uses_socket_io_client 1.0.2 from path depends on socket_io_client 1.0.2, package_which_uses_socket_io_client 2.0.3+1 from path is incompatible with package_which_uses_socket_io_client 1.0.2 from path. So, because app_name depends on both package_which_uses_socket_io_client 1.0.2 from path and package_which_uses_socket_io_client 2.0.3+1 from path, version solving failed._

Is there any way to support both V2 & V3 socket communication?

hamzaalmahdi commented 2 months ago

Hello,

I had the same issue, what I did was forking the old version, fixing its errors, and changing the library name so I could use it in parallel with V3.