-
Notifications
You must be signed in to change notification settings - Fork 4k
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 some missing internal peer dependencies #53275
Merged
Merged
Conversation
This file contains 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
noahtallen
requested review from
gziolo,
adamsilverstein,
ajitbohra,
atimmer and
nerrad
as code owners
August 2, 2023 21:23
Size Change: 0 B Total Size: 1.44 MB ℹ️ View Unchanged
|
tyxla
approved these changes
Aug 4, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes make sense to me! Thanks for the testing repo!
LGTM 🚀
Thanks for merging! |
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/data
includesuse-memo-one
, which requests React. As a result,@wordpress/data
sets react as a peer dependency. Now, any internal package using@wordpress/data
needs 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-one
would 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-scss
to 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
@wordpress
packages, detects peer issues, and autofixes them.Testing Instructions
Basically just verify these make sense! We've done this in many places already.