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 tree-shaking #2475

Closed
2 tasks done
mimarz opened this issue Sep 20, 2024 · 1 comment
Closed
2 tasks done

Fix tree-shaking #2475

mimarz opened this issue Sep 20, 2024 · 1 comment
Labels
🐛 bug Something isn't working ☂️ epic Issues ready react @digdir/designsystemet-react

Comments

@mimarz
Copy link
Collaborator

mimarz commented Sep 20, 2024

We currently have a bug where tree-shaking for vite (and probably webpack) is not working as intended.

We first discovered this issue with new Accordion using @u-elements/details being tree-shaked away and be broken.

This looked to be fixed by removing sideEffect:false, but that only disabled tree-shaking so that all components and its dependencies was bundled along.

We need to further investigate and test remedies to this.

Tasks

Preview Give feedback
  1. ⚙️ technical 🕵️ investigate
  2. react ⚙️ technical 🕵️ investigate
    unekinn

Notes

Notes:
With "sideEffects": false:
image

Without"sideEffects": false:
image

With sideEffect:false:

image image

Without:

image image
@mimarz mimarz converted this from a draft issue Sep 20, 2024
@mimarz mimarz added 🐛 bug Something isn't working react @digdir/designsystemet-react ☂️ epic Issues ready labels Sep 20, 2024
@mimarz
Copy link
Collaborator Author

mimarz commented Sep 20, 2024

Tested with next.34 and its now working as intended.

image image

@mimarz mimarz closed this as completed Sep 20, 2024
@github-project-automation github-project-automation bot moved this from ☂ Epics to ✅ Done in Team Design System Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working ☂️ epic Issues ready react @digdir/designsystemet-react
Projects
Status: ✅ Done
Development

No branches or pull requests

1 participant