-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Add missing package dependencies #73258
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 missing package dependencies #73258
Conversation
Build code transformations can introduce dependencies on packages such as `react`. These need to be declared if the package is to function correctly with yarn's p'n'p or pnpm with hoisting disabled. Fixes WordPress#73257
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
It seems unlikely the failing test is due to this PR, but I don't have the ability to re-run it. |
|
I have this question #73257 (comment) |
|
Given what you discovered at #73257 (comment) , I wonder if a better fix is to configure the JSX import source in the builds to point to A problem I foresee with the approach as currently proposed is that it requires that someone define |
That doc mentions
It means that we may need to set the export paths for those sub paths from the |
Yes, that sounds to me like something we should do 👍 If |
|
#73391 is an attempt to deal with it. |
|
👍 |
|
Just to close the loop on the previous discussion, I was under the mistaken impression that |
|
How can we make these sorts of issues easier to discover? Maybe we should have some linting that requires a package to define React as a peer dependency if it defines |
I think it's more it should be a peer dependency if there's JSX |
That sounds more correct and also more difficult to test for 😅 I suppose we could check for the existence |
|
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
What?
Closes #73257
Add missing dependencies on
react.Why?
Build code transformations can introduce dependencies on packages such as
react. These need to be declared if the package is to function correctly with yarn's p'n'p or pnpm with hoisting disabled.How?
Add missing dependencies on
react.Testing Instructions
yarn add <package>@file:/path/to/gutenberg/packages/<package>orpnpm add <package>@file:/path/to/gutenberg/packages/<package>to point yarn or pnpm at the locally built version of the package.