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

Add peerDependencies to packages #1402

Closed
wants to merge 2 commits into from
Closed

Add peerDependencies to packages #1402

wants to merge 2 commits into from

Conversation

ryanio
Copy link
Contributor

@ryanio ryanio commented Aug 13, 2021

Fixes #1200

I would appreciate a double check of every listed peerDep, that it is used in the public interface of the package.

I didn't add any for client since it is an executable that you pass in command line args, I don't think it has any peerDeps then, is this reasoning correct?

npm 7 installs peer dependencies by default so this goes great with our new developer setup, and should ease end user library incompatibilities as explained in the linked issue.

@codecov
Copy link

codecov bot commented Aug 13, 2021

Codecov Report

Merging #1402 (0e6d1d2) into master (e2a0a4d) will decrease coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

Flag Coverage Δ
block 86.60% <ø> (ø)
blockchain 83.43% <ø> (ø)
client 83.38% <ø> (-0.67%) ⬇️
common 94.17% <ø> (-0.23%) ⬇️
devp2p 83.39% <ø> (+0.07%) ⬆️
ethash 82.83% <ø> (ø)
tx 88.24% <ø> (ø)
vm 79.34% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@acolytec3 acolytec3 self-requested a review August 14, 2021 12:06
Copy link
Contributor

@acolytec3 acolytec3 left a comment

Choose a reason for hiding this comment

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

Here's the additional ones I think we need:
blockchain <-- block, @types/levelup
ethereum-js/util <-- Do we need rlp since the whole module is exported as part of util/externals?
vm <-- merkle-patricia-tree as it's the type for one of the VMOpts properties

General question - do we need @types/bn.js as a peerDependency wherever we have bn.js?

@holgerd77
Copy link
Member

Hmm, can we please finish the discussion on this before opening PRs here?

I have got several issues here:

  1. This would re-introduce on the sideline the need for breaking releases on all libraries, I thought we had some at least preliminary agreement that we only want to do VM, Blockchain(, Block)?
  2. If I get this right this would require npm 7 for having peer dependencies automatically installed. Also thought that we had some somewhat agreeing discussion here: we can do some requirement like this in our own dev setup, but put this requirement on the library users is a totally other (and very likely not acceptable) thing (have no stats, but likely only a very tiny minority will have already upgraded to npm v7)
  3. Last but not least, will just cite from my thread on #strategy: "Apart from what Patricio mentioned in the initial issue there had been not much complain about these kind of inconsistencies from other users, the UX is eventually questionable with the need to manually install dependencies (do I get this right?) and this is generally some strong intervention in our current installation process." -> so this is a very heavy change for a not yet very strongly proven benefit

I've switched the PR label here to "needs discussion" and "blocked".

Some general note here for reviewers: apart from the discussion outcome this is a super-delicate PR. Please only review and do not merge until we have a very clear agreement here.

@ryanio
Copy link
Contributor Author

ryanio commented Aug 16, 2021

my apologies for getting ahead of the discussion

we can do some requirement like this in our own dev setup, but put this requirement on the library users is a totally other (and very likely not acceptable) thing (have no stats, but likely only a very tiny minority will have already upgraded to npm v7)

yeah, I forgot that's really important. I'll close this PR for now and we can reopen if we'd like to continue in the future.

@holgerd77
Copy link
Member

No problem. 😄

This will likely be valuable for some future integration, have added an additional note to the breaking release issue on the PR. For now rather too early, but we might want to re-check on the subsequent round of breaking releases next year or so.

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

Successfully merging this pull request may close these issues.

Incompatible Library versions (TypeScript errors) / Peer dependency switch
3 participants