-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Bring interfaces back here #182
Comments
I think i like this idea, but would need to draw out the dependency graph first to figure out how it would look in practice |
Awesome -- yeah agreed about the dependency graph. The remaining extractions look something like this:
It's not actually that much left. |
I've looked into this a bit more now, and it looks relatively staightforward. The annoying part will be updating all the packages depending on go-libp2p/p2p/ and the interface packages. Annoying, but still straightforward. Though in addition to improving general accessibility, a handful of things can be simplified after the move :) For example we can remove a few slight duplications in the interfaces (namely in the various Conns and Listeners). Any package which gets touched (likely all of them) should probably get a major version bump. Extractions
Packages to move back
After the moveOnce we have only interfaces and tiny utilities in go-libp2p, we can optimize this further for developer happiness. Candidates:
|
I am not 100% sure about that, currently it is possible to updgrade one interface and do limited propagation. If we do bring all interfaces to go-libp2p, any update to interface will require propagation among all packages. This means that first tooling around gx-workspace has to get awesome. |
Yeah, I think so too. Any change in the go-libp2p package would require an update of nearly all other go-libp2p-* packages. But I have a hunch it might actually turn out to be a good thing, because it's largely below the "UI surface". Within libp2p we can take care of it with tooling, and users of libp2p (ipfs included) will actually end up with smaller updates, since the surface of libp2p packages they directly depend on gets smaller.
Agreed 👍 |
Also @Kubuxu let's test ipfs-inactive/gx-workspace#3 more, it's promising. |
I tested it a bit and it still needs a lot of work. Libp2p currently is 29 packages, sorry but I can't really imagine doing all of that even with gx-wrokspace in its current state. |
From IRC:
So I'll leave it up to you, but for me personally it addresses a problem that does not exist or is not a big deal (for the amount of refactoring required). |
Also from IRC. tl;dr let's scrap the interfaces move. Let's just have go-libp2p hold tested examples for everything.
|
I believe it would only not be annoying if gx didn't exist but as soon as semver is a thing (with gx), circular deps are a pain unless I'm missing a special feature of gx??! |
Yeah this whole thing wasn't though through very well |
I feel like once all implementation code is extracted, we could bring back the various interfaces (Conn, Swarm, Host, Peer, Transport, etc.) into a then-flat go-libp2p package. Every libp2p module would depend go-libp2p, but it'd be just a bunch of interfaces.
This would help making the mountain of abstractions more accessible.
The text was updated successfully, but these errors were encountered: