Dependencies #56
Replies: 3 comments 5 replies
-
I tested out your changes and I think its a good idea! I would accept a PR for this if it included only the changes for the However, I notice all of the peer dependencies are pinned at absolute versions, which would inevitably lead to a project installing duplicate chakra dependencies at different versions if someone has a different version of "peerDependencies": {
"@chakra-ui/form-control": "^1.0.0",
"@chakra-ui/icon": "^2.0.0",
"@chakra-ui/layout": "^1.0.0",
"@chakra-ui/menu": "^1.0.0",
"@chakra-ui/spinner": "^1.0.0",
"@chakra-ui/system": "^1.0.0",
"react": ">=16.8.6",
"react-dom": ">=16.8.6"
}, The safest option would of course be to check every version of these sub packages to see if any version causes bugs, but if the semver is done correctly for Chakra UI, this should be mostly safe. And I'd rather avoid making the end user install extra package versions for that remote possibility. And of course if any issues with specific versions do crop up, I can always pin them more specifically later. I'm open to discussion on this however, if you have any more insight on the topic! On a different note, I'm curious about the other changes in the PR you closed. Did you look into passing a custom And besides the customization changes that are specific to your UI library, are there any other "correctness" changes that you think should be merged into this package? There were a lot of small changes in there, so I couldn't tell from a quick glance if there was anything else that would good to merge in. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
Well, ever since I made this change my head has been spinning. I thought it would be all fine because most of the newer versions of npm install peer dependencies automatically, but I forgot about yarn. And because most people using this package probably have For a while I was considering reverting to having a peer dependency of // @chakra-ui/close-button package.json
{
"dependencies": {
"@chakra-ui/icon": "3.0.0",
"@chakra-ui/utils": "2.0.0"
},
"devDependencies": {
"@chakra-ui/system": "2.0.0",
"react": "^18.0.0"
},
"peerDependencies": {
"@chakra-ui/system": ">=2.0.0-next.0",
"react": ">=18"
}
} And it finally clicked! I realized this solves the issue perfectly without adding any additional bloat, because npm and yarn will de-duplicate dependencies anyway! Since making this change, the installation process is so much simpler for everyone and it doesn't break your use case. And I realized this just in the nick of time, because since Chakra UI released their v2, my installation was entirely broken because of using These changes are both in |
Beta Was this translation helpful? Give feedback.
-
Hi @csandman!
This pkg is great, thanks for creating it! I'm using in my custom Chakra-Ui library, which I import into a couple of my applications. I had to customize a few of them because of the designs, and needing to create custom components, etc.
Currently, I am not using the entire
@chakra-ui/react
pkg as apeerDependency
in my packages. I just realized you have it set as apeerDependency
. I forked the repo, but was wondering if it would be possible to only replace the necessary packages you are using? Update thepeerDependencies
&devDependencies
? I created a branch and updated the affected files, but figured a discussion before contributing a PR would be preferable.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions