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

Missing peerDependencies for yarn@2 compatibility #24419

Closed
1 task done
irudoy opened this issue May 23, 2020 · 5 comments · Fixed by react-component/util#110
Closed
1 task done

Missing peerDependencies for yarn@2 compatibility #24419

irudoy opened this issue May 23, 2020 · 5 comments · Fixed by react-component/util#110

Comments

@irudoy
Copy link
Contributor

irudoy commented May 23, 2020

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

https://github.com/ant-design/ant-design

Steps to reproduce

yarn set version berry
yarn add antd

What is expected?

No warnings

What is actually happening?

Warnings like that:

➤ YN0002: │ rc-animate@npm:2.10.3 doesn't provide react@^15.0.0 || ^16.0.0 requested by rc-util@npm:4.20.1
Environment Info
antd 4.2.4
React any
System any
Browser any

Similar issue for one particular package: react-component/animate#99
And another: react-component/input-number#241

The problem: https://yarnpkg.com/advanced/error-codes#yn0002---missing_peer_dependency
Detailed explanation: https://dev.to/arcanis/implicit-transitive-peer-dependencies-ed0

The list of packageExtensions that resolves all warnings in my case, might be helpful

packageExtensions:
  antd@*:
    peerDependencies:
      dayjs: "^1.8.18"
    peerDependenciesMeta:
      dayjs:
        optional: true
  "@ant-design/icons@*":
    peerDependencies:
      react-dom: "15.0.0 || ^16.0.0"
  rc-animate@*:
    peerDependencies:
      react: "15.0.0 || ^16.0.0"
      react-dom: "15.0.0 || ^16.0.0"
  rc-collapse@*:
    peerDependencies:
      react: "15.0.0 || ^16.0.0"
      react-dom: "15.0.0 || ^16.0.0"
  rc-dialog@*:
    peerDependencies:
      react: "15.0.0 || ^16.0.0"
      react-dom: "15.0.0 || ^16.0.0"
  rc-input-number@*:
    peerDependencies:
      react: "15.0.0 || ^16.0.0"
      react-dom: "15.0.0 || ^16.0.0"
  rc-slider@*:
    peerDependencies:
      react: "15.0.0 || ^16.0.0"
      react-dom: "15.0.0 || ^16.0.0"
  rc-tabs@*:
    peerDependencies:
      react: "15.0.0 || ^16.0.0"
  rc-drawer@*:
    peerDependencies:
      react-dom: "15.0.0 || ^16.0.0"
  rc-field-form@*:
    peerDependencies:
      react-dom: "15.0.0 || ^16.0.0"
  rc-mentions@*:
    peerDependencies:
      react-dom: "15.0.0 || ^16.0.0"
@irudoy
Copy link
Contributor Author

irudoy commented May 24, 2020

@zombieJ thanks for immediate resolution. But how about adding dayjs to peerDependencies of antd package? Yarn@2 also reporting on this. Found an issue related: #23435

We can make it optional like this:

"peerDependenciesMeta": {
  "dayjs": {
    "optional": true
  }
}

https://yarnpkg.com/configuration/manifest#peerDependenciesMeta

@irudoy
Copy link
Contributor Author

irudoy commented May 24, 2020

Also, an issue wasn't resolved completely. Some other packages still reporting:

➤ YN0002: │ rc-slider@npm:9.2.4 doesn't provide react@^15.0.0 || ^16.0.0 requested by rc-tooltip@npm:4.0.3
➤ YN0002: │ rc-slider@npm:9.2.4 doesn't provide react-dom@^15.0.0 || ^16.0.0 requested by rc-tooltip@npm:4.0.3
➤ YN0002: │ rc-tabs@npm:10.1.1 doesn't provide react@^0.14.3 || ^15.0.0 || ^16.0.0 requested by rc-hammerjs@npm:0.6.9
➤ YN0002: │ rc-mentions@npm:1.1.0 [bf298] doesn't provide react-dom@* requested by rc-menu@npm:8.1.0
➤ YN0002: │ rc-mentions@npm:1.1.0 [bf298] doesn't provide react-dom@* requested by rc-trigger@npm:4.1.0

@irudoy
Copy link
Contributor Author

irudoy commented May 25, 2020

Should I create a new issue or this one will be reopened?

@afc163 afc163 reopened this May 26, 2020
@afc163 afc163 reopened this May 26, 2020
afc163 added a commit to react-component/menu that referenced this issue May 26, 2020
afc163 added a commit to react-component/trigger that referenced this issue May 26, 2020
@afc163 afc163 closed this as completed May 26, 2020
afc163 added a commit to react-component/react-hammerjs that referenced this issue May 26, 2020
@irudoy
Copy link
Contributor Author

irudoy commented May 27, 2020

Thanks for fixes. But yarn still throwing warns for dayjs (#24419 (comment))

@afc163
Copy link
Member

afc163 commented May 27, 2020

@irudoy PR is welcome~

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

Successfully merging a pull request may close this issue.

2 participants