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

feat(components): support tree shaking (VIV-1672) #1875

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

RichardHelm
Copy link
Contributor

Adds sideEffects property to package.json which allows bundlers to tree-shake unused components.
Example bundle with just button being used goes from 1.35 MiB to 95 KiB.

Vivid component code is itself is considered by bundlers to have side-effects, which is why it is not tree-shakable out of the box. This property allows bundlers to skip going into the component files in the first place, so they don't get included anymore.

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d61b119) to head (a17f54b).
Report is 1048 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##              main     #1875     +/-   ##
===========================================
  Coverage   100.00%   100.00%             
===========================================
  Files          123       341    +218     
  Lines         1562      6209   +4647     
  Branches       108       781    +673     
===========================================
+ Hits          1562      6209   +4647     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@YonatanKra YonatanKra left a comment

Choose a reason for hiding this comment

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

Nice work!

@YonatanKra YonatanKra self-assigned this Aug 11, 2024
@RichardHelm RichardHelm merged commit 0aa396c into main Aug 12, 2024
15 checks passed
@RichardHelm RichardHelm deleted the VIV-1672-support-tree-shaking branch August 12, 2024 09:14
@github-actions github-actions bot mentioned this pull request Aug 12, 2024
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.

2 participants