Why switch from subpath exports to barrel files? #2310
Answered
by
achingbrain
justin0mcateer
asked this question in
Q&A
-
When the mono-repo was created, the exports under the libp2p package were specified using 'exports' in package.json. With 1.0, these subpath exports have been eliminated in favor of barrel file. Why so? |
Beta Was this translation helpful? Give feedback.
Answered by
achingbrain
Dec 20, 2023
Replies: 1 comment
-
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' |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
maschad
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
so for V1 everything has shifted to the root which is a bit simpler to consume: