Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Remove code from interfaces module #110

Closed
achingbrain opened this issue Oct 19, 2021 · 4 comments · Fixed by #111
Closed

Remove code from interfaces module #110

achingbrain opened this issue Oct 19, 2021 · 4 comments · Fixed by #111
Labels

Comments

@achingbrain
Copy link
Member

achingbrain commented Oct 19, 2021

We should remove all .js code from the interfaces module and just make it .ts interfaces, so we can use the types declared there without pulling in heavy implementations such as libp2p-crypto or peer-id.

The only significant chunks of code we have are the pubsub and connection base classes but these could be moved to packages within this repo. We could even repurpose the old libp2p-pubsub npm module.

What do you think? @vasco-santos @jacobheun

achingbrain added a commit that referenced this issue Nov 6, 2021
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110)
* Converts code to typescript (fixes #101)
* Adds types for PeerData and Registrar - these will need to be fleshed out properly in a subsequent PR

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces
achingbrain added a commit that referenced this issue Nov 6, 2021
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110)
* Converts code to typescript (fixes #101)
* Adds types for PeerData and Registrar - these will need to be fleshed out properly in a subsequent PR

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces
achingbrain added a commit that referenced this issue Nov 6, 2021
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110)
* Converts code to typescript (fixes #101)
* Adds types for PeerData and Registrar - these will need to be fleshed out properly in a subsequent PR

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces
achingbrain added a commit that referenced this issue Nov 6, 2021
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110)
* Converts code to typescript (fixes #101)
* Adds types for PeerData and Registrar - these will need to be fleshed out properly in a subsequent PR

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces
achingbrain added a commit that referenced this issue Nov 6, 2021
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110)
* Converts code to typescript (fixes #101)
* Adds types for PeerData and Registrar - these will need to be fleshed out properly in a subsequent PR

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces
achingbrain added a commit that referenced this issue Nov 7, 2021
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110)
* Converts code to typescript (fixes #101)
* Adds types for PeerData and Registrar - these will need to be fleshed out properly in a subsequent PR

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces
achingbrain added a commit that referenced this issue Nov 22, 2021
* Splits implementations out from interfaces so we can depend on interfaces module without pulling in crypto, etc (fixes #110).  New implementation modules are:
  * libp2p-pubsub
  * libp2p-connection
  * libp2p-topology
* Converts code to typescript (fixes #101)
* Adds types for PeerData, PeerStore, Registrar and some other libp2p internals - these will need to be fleshed out properly in a subsequent PR
* No CJS, only ESM, only forwards
* Upgrades deps that have also gone ESM-only
* Renames package folders for consistency

I've tried to break some of the circular dependencies in the interfaces (e.g. libp2p depends on pubsub, which depends on libp2p, which depends on pubsub, etc).  This hasn't been possible in the tests so I've added `@ts-expect-error` where we access these properties with the aim to revisit it once this has been rolled up to libp2p itself.

BREAKING CHANGE: not all fields from concrete classes have been added to the interfaces, some adjustment may be necessary as this gets rolled out
@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This issue has been resolved in version @libp2p/interfaces-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This issue has been resolved in version @libp2p/topology-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This issue has been resolved in version @libp2p/connection-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Jan 5, 2022

🎉 This issue has been resolved in version @libp2p/pubsub-v1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant