Add some missing internal peer dependencies#53275
Merged
Conversation
|
Size Change: 0 B Total Size: 1.44 MB ℹ️ View Unchanged
|
tyxla
approved these changes
Aug 4, 2023
Member
tyxla
left a comment
There was a problem hiding this comment.
The changes make sense to me! Thanks for the testing repo!
LGTM 🚀
Member
Author
|
Thanks for merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
If you install WordPress packages in another repo, you'll likely see these messages:
The problem is that a few of our internal packages don't handle some peer dependency requests. For example,
@wordpress/dataincludesuse-memo-one, which requests React. As a result,@wordpress/datasets react as a peer dependency. Now, any internal package using@wordpress/dataneeds to either provide React or set it as a peer dependency.While this is somewhat annoying, it's really important to have explicit dependencies. In these cases, we don't want to provide React ourselves, but we want a consumer to use their copy. So we have to add peer dependencies requests for react and react-dom in a lot of places.
The only other way to avoid this is to stop using packages which have peer dependency requests for React in our most commonly used packages. For example, removing
use-memo-onewould mean that@wordpress/data(and therefore a ton of other internal packages) doesn't need a peer dep on react.There are a few remaining peer dep issues, but those come from other repositories like deepsignal. Some other things we could do for follow-up:
stylelint-config-recommended-scssto get a peer dep fix on their end: Update stylelint config packages #53276Why?
So that we stop showing warnings in other repos!
How?
I have a little repo set up: https://github.com/noahtallen/test-yarn-gutenberg. This has some scripts which add dependencies on all
@wordpresspackages, detects peer issues, and autofixes them.Testing Instructions
Basically just verify these make sense! We've done this in many places already.