Skip to content

Consolidate IPFS Path libraries under boxo/path #198

@lidel

Description

@lidel

How many clowns path deps can you fit in a clown car one line of code?

During review of Gateway API refactor from #176, I've realized there are cases, when we use three "path types" from three different libraries. This culminated in this fun one-liner:

imPath, err := NewImmutablePath(ifacepath.New(ipath.String()))

Proposed path forward

Thoughts on deduplicating/consolidating under boxo/path?
It honestly feels like if go-libipfs has a purpose, it is to provide a solution for reusable things like this.

I feel we will make better Gateway API in #176 if we don't use ifacepath but use a single go-libipfs/path library that covers Path, Immutable and Resolved states with distinct types/interfaces.

I assume we want to follow "copy" strategy from #191 here, to minimize blast radius?

We could make this consolidation in steps, first switch gateway, so the public interface from #176 only uses types from boxo/path, and in the future switch namesys/kubo to that as well.

Things to look out for

During the consolidation, the following issues and Pull Requests from the relevant repositories should be taken into consideration.

cc @ipfs/kubo-maintainers for feedback (paths are everywhere, and as much as I'd like to clean this up, I don't want to add unnecessary work for anyone)

Metadata

Metadata

Assignees

Labels

need/triageNeeds initial labeling and prioritization

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions