Skip to content

Why switch from subpath exports to barrel files? #2310

Answered by achingbrain
justin0mcateer asked this question in Q&A
Discussion options

You must be logged in to vote

It was getting increasingly hard to remember which interfaces were exported from which sub paths, and some of them were inconsistent and arbitrary, e.g:

import type { Connection } from '@libp2p/interface/connection'

// vs

import type { Stream } from '@libp2p/interface/stream-muxer'

so for V1 everything has shifted to the root which is a bit simpler to consume:

import type { Connection, Stream } from '@libp2p/interface'

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by maschad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants