You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most of ipfs / libp2p stack depends on Multiaddr class which introduces large number of dependencies, it is made worth by the fact that typescript forces all of them to agree on the same exact package to type check.
We should instead introduce Multiaddr interface and type our APIs so they take / produce value compatible with that interface. That way they become implementation agnostic allowing us to swap / upgrade implementation without coordinating these changes across the board.
Multiaddr Implementation in this library will just become a one implementation of that interface.
The text was updated successfully, but these errors were encountered:
- Renames the `Multiaddr` class to `DefaultMultiaddr`
- Exports `Multiaddr` as an interface
The `multiaddr` function (introduced in v9.0.0) should be used to create new instances of `Multiaddr` instead of instantiating the `Multiaddr` class directly.
This allows us to remove the `inspect` symbol from the interface and avoid use of `Object.defineProperty` which is very slow.
Fixes: #202
BREAKING CHANGE: the `Multiaddr` class is now an interface
## [11.0.0](v10.5.0...v11.0.0) (2022-09-21)
### ⚠ BREAKING CHANGES
* the `Multiaddr` class is now an interface
### Features
* convert to interface ([#274](#274)) ([36de98f](36de98f)), closes [#202](#202)
### Bug Fixes
* fix converting strings to IP addresses and back again ([#270](#270)) ([77f063a](77f063a))
Most of ipfs / libp2p stack depends on Multiaddr class which introduces large number of dependencies, it is made worth by the fact that typescript forces all of them to agree on the same exact package to type check.
We should instead introduce Multiaddr interface and type our APIs so they take / produce value compatible with that interface. That way they become implementation agnostic allowing us to swap / upgrade implementation without coordinating these changes across the board.
Multiaddr Implementation in this library will just become a one implementation of that interface.
The text was updated successfully, but these errors were encountered: