Replies: 1 comment
-
Hello @yordis, I am having trouble to make my component library tree-shakeble using headlessui. I think is a similar issue, do you know how I can achieve tree-shakable using Dialog component for example? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there, I notice that you do the following as of today:
headlessui/packages/@headlessui-react/src/components/dialog/dialog.tsx
Line 421 in 452b2c2
Such things force me to use
Dialog
object, I have seen such practices before and they always backfire on us due to extra complexity re-exporting things or copying over, and tree-shaking (no problem as of today, yet).Given the context that ESM is already an object if people really want a single import
import * as Something ...
Recently I had to wrap
Dialog
since I had to add FullStoryclassName
by default.So now I am forced to keep mapping things into the next object rather than using ESM, so I can't do the following:
I can either do imperative things, hopefully getting it right by copying over the keys, or I can leverage ESM for it which already has built-in capabilities for re-exporting things.
Any thoughts?
Worth saying, I know how to fix the issue, but I would like to propose to back track out of such a decision made, from my experience, it adds a lot of complexity and burden on the consumers.
Beta Was this translation helpful? Give feedback.
All reactions