Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: remove @libp2p/components #229

Merged

Conversation

achingbrain
Copy link
Collaborator

@libp2p/components is a choke-point for our dependency graph as it depends on every interface, meaning when one interface revs a major @libp2p/components major has to change too which means every module depending on it also needs a major.

Switch instead to constructor injection of simple objects that let modules declare their dependencies on interfaces directly instead of indirectly via @libp2p/components

Refs libp2p/js-libp2p-components#6

BREAKING CHANGE: modules no longer implement Initializable instead switching to constructor injection

`@libp2p/components` is a choke-point for our dependency graph as it depends on every interface, meaning when one interface revs a major `@libp2p/components` major has to change too which means every module depending
on it also needs a major.

Switch instead to constructor injection of simple objects that let modules declare their dependencies on interfaces directly instead of indirectly via `@libp2p/components`

Refs libp2p/js-libp2p-components#6

BREAKING CHANGE: modules no longer implement `Initializable` instead switching to constructor injection
@dapplion
Copy link
Contributor

The changes of this PR do not remove @libp2p/components since is not used in noise, or am I missing something?

The changes of this PR appear to be:

  • Bump protons, uint8arrays
  • change Noise constructor to take an object (this appears to be a BREAKING CHANGE?)
  • Rename writer variable to w
  • Change src/proto/payload.ts logic

@achingbrain
Copy link
Collaborator Author

It's part of a larger suite of changes to switch to constructor based injection for all libp2p components - see the linked issue in libp2p/js-libp2p-components#6

dapplion
dapplion previously approved these changes Oct 14, 2022
@achingbrain
Copy link
Collaborator Author

Could this be merged if everyone's happy? [email protected] is out and this is needed to roll it all up to ipfs.

Copy link
Contributor

@dapplion dapplion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @wemeetagain @mpetrunic please review

@wemeetagain wemeetagain merged commit dd47517 into ChainSafe:master Oct 19, 2022
@achingbrain achingbrain deleted the fix/remove-components-dependency branch October 20, 2022 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants