-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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: peer dependency warnings #10670
base: main
Are you sure you want to change the base?
Conversation
✅ [V2]Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
5b1df3e
to
2e68750
Compare
⚡️ Lighthouse report for the deploy preview of this PR
|
@@ -32,6 +32,7 @@ | |||
"@docusaurus/types": "3.6.1" | |||
}, | |||
"peerDependencies": { | |||
"@mdx-js/react": "^3.0.0", |
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.
For each of the peers added in this PR, there were previously warnings like:
➤ YN0002: │ @docusaurus/plugin-client-redirects@workspace:packages/docusaurus-plugin-client-redirects doesn't provide @mdx-js/react (p31cf2), requested by @docusaurus/core
➤ YN0002: │ @docusaurus/plugin-client-redirects@workspace:packages/docusaurus-plugin-client-redirects [86937] doesn't provide @mdx-js/react (pc71f5), requested by @docusaurus/core
I've added additional peer dependency definitions as necessary, and then the dependency itself to the top level package (e.g., website
).
Let's first figure out a good solution in #10668, because I don't like the idea of every package depending on MDX especially those that are supposed to work without any MDX plugins installed. |
Agree this is not ideal. This PR may fix the warning but not really the underlying problem we have in the first place. Not sure how to handle this yet, but I'm thinking about it 😅 |
Pre-flight checklist
Motivation
Fixes #10668.
Addresses
react
,react-dom
, &@mdx-js/react
dependency issues only - note that there are few others that I've left unaddressed here.Test Plan
To test this with a user project locally, it's necessary to bump the versions (e.g., with Verdaccio), since otherwise some of the transient dependencies will still point at the real published
3.6.1
versions and still log warnings.yarn test:build:website
npm_config_registry="http://localhost:4873" npm init [email protected]
npm_config_registry="http://localhost:4873" yarn
from the new projectNote: if using yarn 2+, you must set up the registry differently: https://verdaccio.org/docs/setup-yarn/#yarn-modern-2x
To test with this repo, just run
yarn
.Fresh project, with
yarn 1.22.22
Before
After (no difference)
Fresh project, with
yarn 3.5.0
Before
After (
react
,react-dom
, &@mdx-js/react
warnings resolved)This repo, with
yarn 1.22.22
Before
After (
@mdx-js/react
warning resolved)This repo, with
yarn 3.5.0
Before
After (
react
,react-dom
, &@mdx-js/react
warnings resolved)Test links
Deploy preview: https://deploy-preview-_____--docusaurus-2.netlify.app/
Related issues/PRs
#10668