Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brain-free installation #5

Closed
Eerey opened this issue Feb 15, 2022 · 25 comments
Closed

Brain-free installation #5

Eerey opened this issue Feb 15, 2022 · 25 comments

Comments

@Eerey
Copy link

Eerey commented Feb 15, 2022

I know it's kind of a huge task, but would it be theoretically possible to use ZeroMQ in Flutter without thinking about Android/Windows/iOS/Linux?

What steps would be necessary?

Would it be possible to distribute precompiled zeromq-Versions (.dll, .so etc) within this plugin?

Is it theoretically possible to transpile the ZeroMQ Code to Dart only?

We think this is an amazing plugin but we're really uncertain about the fact that you need to make sure that e.g. a precompiled .dll (windows) works on every machine (it does not).

@enwi
Copy link
Owner

enwi commented Feb 15, 2022

Would it be possible to distribute precompiled zeromq-Versions (.dll, .so etc) within this plugin?

I have already looked into this and it is possible to do. It would make using the library for mobile platforms and desktops a lot easier. Here is some reference on how it can be done, but I did not have the time to implement it: https://groups.google.com/a/dartlang.org/g/misc/c/fyh2W38AEVo

@Scylla2020
Copy link

I been struggling for hours trying to understand how creating a shared dll on windows works. It sounded like something that should be straightforward seeing the steps were omitted from the docs. Would you be able to share what exact steps to follow to create the shared dll for Windows 10? Like what file do we need to download from where, what commands are used to create the dll etc. Looks like an awesome plugin would love to get it to work. Thank you

@Eerey
Copy link
Author

Eerey commented Mar 13, 2022

In my case, I did not compile it myself. I downloaded it somewhere and renamed it to the expected file name.
This can be optimized in many ways and I struggled to find that out myself aswell.

@enwi
Copy link
Owner

enwi commented Mar 13, 2022

@Scylla2020
You can find some instructions here

@Scylla2020
Copy link

Oh great thanks let me have a look at the instructions,

@enwi
Copy link
Owner

enwi commented Mar 16, 2022

Ultimately it would be best to distribute precompiled versions with this package. Then anyone who still wants a specific version can go through the trouble.

@kevinelliott
Copy link

I don't use Flutter. I was disappointed that I couldn't use this library since I'm Dart-only.

@enwi
Copy link
Owner

enwi commented May 16, 2022

@kevinelliott Technically this should be possible, since there aren't any dependencies to Flutter afaik.

@kevinelliott
Copy link

kevinelliott commented May 17, 2022

@kevinelliott Technically this should be possible, since there aren't any dependencies to Flutter afaik.

The fact that it currently requires flutter SDK prevents this at the moment. Is there any way to allow for dart only?

@enwi
Copy link
Owner

enwi commented May 17, 2022

I think it should be possible to convert this into a dart only package, though how would the different compiled libraries for different platforms be handled?

@kevinelliott
Copy link

kevinelliott commented May 17, 2022 via email

@enwi
Copy link
Owner

enwi commented May 18, 2022

Me too

@rbebb
Copy link

rbebb commented Jul 28, 2022

Is there any news on this effort? It would be so cool to have this as a Dart only package!

@One-Nub
Copy link

One-Nub commented Jul 29, 2022

I have seen packages listed that support both SDKs. I wonder how they do it.

Just from skimming pubspec.yaml(s), this is usually just accomplished automatically by the site when a file only uses the SDK constraint under the environment field (so thus not requiring flutter). In the case of this package, I'm not sure how that would affect the other dependencies (specifically the dev_dependencies). I would guess removing flutter specific stuff would work in this case, but would just have to try it and see what happens.

Edit: Looks like that's exactly what @ach-ee did in his fork mentioned in issue #4 (His pubspec: https://github.com/ach-ee/dartzmq/blob/main/pubspec.yaml)

@kevinelliott
Copy link

Any update here?

@enwi
Copy link
Owner

enwi commented Aug 9, 2022

I haven't had time to take a deeper look into this, but this might change in the upcoming days. I would also like to check if the changes in #4 improve the overall performance.

@kevinelliott
Copy link

Is there an easy way for me to override this in my own project so that I can at least move forward with development?

@enwi
Copy link
Owner

enwi commented Aug 9, 2022

You can change the source code locally. If you use VS-Code it will display a warning, but until you update the dependencies and there is a new release of this library you should be fine.

@Eerey
Copy link
Author

Eerey commented Aug 9, 2022

Is there any news on this effort? It would be so cool to have this as a Dart only package!

According to stackoverflow answers, it would also be possible to do it in dart only (no c++ involved):
https://stackoverflow.com/questions/71127181/mimic-zeromq-sub-socket-in-a-pub-sub-system-with-e-g-socket-websocket-in-flut

But i guess it is a huge challenge and I'm not sure if it should be done after thinking about it, because it will be detached from the original repository.

@enwi
Copy link
Owner

enwi commented Aug 10, 2022

@kevinelliott I removed the flutter dependencies, if you want you can try the new version

@enwi enwi closed this as completed in 9a857aa Aug 10, 2022
enwi added a commit that referenced this issue Aug 10, 2022
- closes #5
- Add counter to example
- Bump version to 1.0.0-dev.9
enwi added a commit that referenced this issue Aug 10, 2022
- closes #5
- Add counter to example
- Bump version to 1.0.0-dev.9
enwi added a commit that referenced this issue Aug 10, 2022
- closes #5
- Add counter to example
- Bump version to 1.0.0-dev.9
@enwi
Copy link
Owner

enwi commented Aug 11, 2022

@Eerey @Scylla2020 it should now work for Windows and Android out of the box

@enwi
Copy link
Owner

enwi commented Aug 11, 2022

@kevinelliott @rbebb @One-Nub With the change now the issue is that I have to include the Flutter dependency otherwise it does not work. It won't let me publish the package without it, because the platforms key requires it. I wonder if there is a solution for this. Other than that if you provide the ZeroMQ binary yourself it should work with dart only with a298137

plugin:
    platforms:

@enwi
Copy link
Owner

enwi commented Aug 11, 2022

So we either need to find a workaround for the platforms key or we could split the code into two repositories, one with all the dart only code and one for flutter where it automatically includes the binaries

@kevinelliott
Copy link

I wonder if someone at https://github.com/dart-lang or https://github.com/flutter could chime in with the best practice here.

@Scylla2020
Copy link

@enwi Thanks for this! I'll give it a go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants