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

fix: Replace all @chakra/* dependencies with @chakra-ui/react + remove unnecessary react imports #323

Merged
merged 19 commits into from
Sep 5, 2024

Conversation

csandman
Copy link
Owner

@csandman csandman commented Jun 29, 2024

There has been a lot of back and forth on whether this package should use @chakra-ui/react as it's peer dependency, or just the individual sub-packages it relies on. Originally, it just used the root package as it's peer dependency, but after a suggestion, that was swapped out with the individual packages: #56

However, since then there have been a lot of complaints (mostly by people who use yarn as their package manager) about not having all of the included peer dependencies in their package.json:

Ultimately, I've realized that for most people, having @chakra-ui/react as the actual peer dependency works best for the majority of users, including myself, as most people are using the package in it's entirety as a dependency, instead of the sub-packages.

However, all of the imports are still being pulled in from the sub-packages. I'm not sure if this is the ideal approach, but it's possible this will still allow those who only have the sub-packages installed to use this component if they ignore the peer dependency.

"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"skipLibCheck": true,
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was necessary to add this in order to prevent Chakra UI from causing the tsc to fail. Not an ideal solution.

@@ -39,28 +39,16 @@
"start": "nodemon --watch src --exec npm run build -e ts,tsx"
},
"dependencies": {
"react-select": "5.8.0"
"react-select": "5.8.x"
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized I don't need to be so strict as to not allow other patch versions of react-select, so this just opens it up for the others.

@csandman csandman marked this pull request as ready for review July 27, 2024 00:27
@csandman csandman changed the base branch from main to v5 July 27, 2024 00:28
Repository owner deleted a comment from github-actions bot Sep 5, 2024
Copy link

github-actions bot commented Sep 5, 2024

📊 Package size report   -3.09%↓

File Before After
dist/index.js 16.4 kB 0.01%↑16.4 kB
dist/index.js.map 77.4 kB -5.19%↓73.3 kB
dist/index.mjs 15.0 kB 0.02%↑15.0 kB
dist/index.mjs.map 77.4 kB -5.21%↓73.3 kB
package.json 3.4 kB -16.3%↓2.9 kB
Total (Includes all files) 278.1 kB -3.09%↓269.5 kB
Tarball size 62.5 kB -3.84%↓60.1 kB
Unchanged files
File Size
dist/index.d.mts 19.9 kB
dist/index.d.ts 19.9 kB
LICENSE.md 1.1 kB
README.md 47.6 kB

🤖 This report was automatically generated by pkg-size-action

Repository owner deleted a comment from codesandbox-ci bot Sep 5, 2024
@csandman csandman merged commit 7af52d5 into v5 Sep 5, 2024
2 checks passed
@csandman csandman deleted the fix/replace-chakra-dependencies branch September 5, 2024 03:00
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 this pull request may close these issues.

1 participant