-
Notifications
You must be signed in to change notification settings - Fork 24
[update]Update kotlin-wrappers -> pre.104 #23
Conversation
kotlin-wrappers now exports all its npm dependencies as api. Export @material-ui dependencies as well, and export all kotlin dependencies that are part of the libraries' public API. Remove superfluous dependency declarations where applicable.
Does the stack trace look like this?
|
These seem to be occurring because some NPM dependencies require an older version of React. As you say, this is not the correct state of affairs, but since the latest version of If you simply want to remove the warning, there is a way to add the following to the dependency of Gradle.
In my opinion, I don't think it's a big problem if it's a later version than Hooks support. So, it would be very helpful if you could add |
I don't think this is the reason. As you can notice, there are also warnings for ^16.13.1 (which at the time of writing is 16.13.1).
Note that there is also a line about material-ui/core, where the same issue applies. All of those dependency declarations from the warnings should be met by react 16.13.1. I believe the warnings are actually a bug in yarn with workspaces, because the dependency is correctly defined and pulled in by kotlin-react, and also ends up in the yarn.lock |
See yarn issue yarnpkg/yarn#4743 |
According to the official Node.js documentation, in v3 and later npm, the dependencies specified in peerDependencies will only be warned and will not be installed. https://docs.npmjs.com/files/package.json#peerdependencies That is, to resolve these warnings, you need to explicitly specify the version of React in package.json of kotlin-material-ui. |
Add
|
These are not peerDependencies. They are hard dependencies pulled in by kotlin-react and kotlin-material-ui. Check for example Kotlin-gradle-plugin includes these projects as yarn workspaces ( Adding these dependencies explicitly might prevent the warnings, but is technically not needed, because they are transitively added already. |
I understand, this certainly seems to be a bug in yarn workspaces. It seems to solve the problem if you can specify a commonly used library in the dependencies of As for this PR, I'm going to merge it for now. It would be great if you could create an issue for when someone finds a neat way to get rid of the warning. |
[update]Update kotlin-wrappers -> pre.104
Update to kotlin-wrappers pre.104. They have changed their setup to export all dependencies as api scope. This definitely makes sense for gradle-dependencies (like kotlin-react-dom -> kotlin-react), for npm it's probably fine as well.
However, it leads to some warnings in the initial kotlinNpmInstall task about missing peer dependencies. However, those dependencies are available in the end.
I have adjusted the build files to follow the kotlin-wrappers change: the @material-ui npm dependencies are now exported as api. I have updated them to the latest version.
All kotlin-wrappers libraries that are part of this library's public API are now correctly marked as api as well.
I have removed all superfluous dependency declarations where applicable.
I'm not totally happy with the warnings. Please let me know what you think about this.