-
Notifications
You must be signed in to change notification settings - Fork 40
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: use standard side effects #2469
Conversation
|
Preview deployments for this pull request: Storybook - |
Coverage Report
File CoverageNo changed files found. |
Not this rabbithole again 🐰 |
Indeed, this was Eirik's initial finding. My hunch was that maybe I suspect we might need to specify all files which have side-effectful imports of |
A second note, setting |
yes we do have some circular dependencies. |
I thought it was need as long as we live in a world with cjs and esm modules? I think most component libraries out there have this in their package.json, due to this reason. I did fix our circular dependencies during summer, but looks like we got some new ones now 🙈 |
Here's the current circular dependencies in I'd prefer to set up a check in CI to keep these from popping up
|
As a comparison, here is a report from
|
Hmm, this definitely needs more testing. I suggest we make a separate issue for this to properly document this. I would say the root problem here is tree-shaking not working correctly, as to whats the root cause of it remains to be discovered and fixed. With or without |
I think it is necessary for optimal tree shaking, but in the last library I worked on it made a smaller difference than turning tree shaking off entirely. At least with vite. This stuff is complex 😢 Anyhow. If possible, we should keep customElements.define("u-details", UHTMLDetailsElement);
customElements.define("u-summary", UHTMLSummaryElement); We could conceivably ask our consumers to do the |
@eirikbacker Can you check if the code works if we replace
If it works, it's annoying to maintain manually. I experimented a bit and managed this magic incantation which finds files that depend on
output: [
"components/Accordion/AccordionItem.tsx"
] |
Created an issue at #2474 |
Closing this as we have identified other workarounds and testing downstream shows we still need |
"sideEffects": false
frompackage.json
of@digirdir/designsystemet-react
Vite building with non-standard

"sideEffects": false
:Vite building when removing non-standard

"sideEffects": false
: