Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Installing from Hex doesn't fetch all dependencies #40

Closed
cloud8421 opened this issue Sep 14, 2015 · 6 comments
Closed

Installing from Hex doesn't fetch all dependencies #40

cloud8421 opened this issue Sep 14, 2015 · 6 comments

Comments

@cloud8421
Copy link
Contributor

It seems that only other hex packages are fetched as dependencies of an hex package.

screenshot 2015-09-14 15 56 31

I didn't know about this myself, but I'm seeing errors as it doesn't fetch websocket_client.

@jtmoulia
Copy link
Contributor

Ouch -- thanks for the report. Will fix ASAP.

That being said, this is a good impetus to fix #16.

@jtmoulia
Copy link
Contributor

I opened an issue with websocket_client, jeremyong/websocket_client#44, to try and get the library into hex.

However, given that this is out of our control (can't even publish to hex ourselves because someone is squatting on the package) and fixing #16 would take care of this issue (Spell's user would have to explicitly include the dependency), I'd like to go ahead and resolve #16. As an interface change, that would bump the vsn to 0.2.0. With the bump, I'd like to also fit in #19 which I'm currently working on.

@cloud8421
Copy link
Contributor Author

That's a good strategy and I definitely agree with #16

One possible way forward to resolve this is to plug these libraries at the configuration/setup level, like Postgrex does: https://github.com/ericmj/postgrex#extensions

This way, if I only use Spell with RawSocket, I can avoid the websockets dependency (or other similar use cases).

What do you think? Thanks for your work on this, BTW!

@jtmoulia
Copy link
Contributor

Cool, I like how postgrex handles plugging in libraries -- it's nice to not be constrained to a particular library. But, without adding a translation layer I'm not sure if it would work for the websocket component. For postgrex's JSON extension, it just calls encode!/1 and decode!/1 on the JSON library module it was configured with. In other words, it requires the JSON library to use a fixed interface. For websocket_client, however, we have to actually implement the websocket_client callbacks -- without a fixed interface across websocket libraries I don't know a simple approach which allows the user to dynamically specify the library.

For JSON or MsgPack, though, it's definitely possible :)

With #16 leaving the dependencies up to the user, it would still be possible to use Spell with only RawSocket, dropping the websocket dependency. The same is true of MsgPack + JSON.

@cloud8421
Copy link
Contributor Author

I see what you mean, makes a lot of sense!

@jtmoulia
Copy link
Contributor

Resolved by #42, see #43 for plan to update websocket dep.

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

No branches or pull requests

2 participants