csandman / chakra-react-select

A Chakra UI themed wrapper for the popular library React Select
https://www.npmjs.com/package/chakra-react-select
MIT License
775 stars 33 forks source link

Switch to tsup #294

Closed csandman closed 11 months ago

csandman commented 11 months ago

Switch to using tsup for bundling the dist files. This has the main benefit of bundling the ESM version of the files using the real .mjs file extension, which allows for the exports field in the package.json to work properly. It also appears to solve the problem mentioned in #260, where the id prop coming from Chakra's useFormControl hook were not defined on the server. I'm not exactly sure why this fixes it, but I'll take it.

This change was initially motivated by the fact that Chakra UI also switched to using tsup for their bundling: https://github.com/chakra-ui/chakra-ui/blob/754d9d4/packages/components/tsup.config.ts

Here are the results from arethetypeswrong:

Before

https://arethetypeswrong.github.io/?p=chakra-react-select%404.7.5

image

After

image
codesandbox-ci[bot] commented 11 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 836f4de26262e3d98b6d8dee526c5c9886e07bc2:

Sandbox Source
chakra-react-select demo Configuration
chakra-react-select TS demo Configuration
chakra-react-select + next.js Configuration
chakra-react-select + next.js + typescript Configuration