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

chore: Expose metrics as separate file export #106

Merged
merged 1 commit into from
Nov 4, 2024
Merged

Conversation

just-boris
Copy link
Member

@just-boris just-boris commented Nov 4, 2024

Issue #, if available:

Description of changes:

Reduce loaded size when importing metrics

import { Metrics } from '@cloudscape-design/component-toolkit/internal'; // 3.8 Kb
import { Metrics } from '@cloudscape-design/component-toolkit/internal/metrics'; // 0.7 Kb

Why is this happening – @cloudscape-design/component-toolkit/internal also loads ResizeObserver polyfill which is a side effect, but side effects do not tree shake

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@just-boris just-boris requested a review from a team as a code owner November 4, 2024 12:03
@just-boris just-boris requested review from pan-kot and removed request for a team November 4, 2024 12:03
Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.22%. Comparing base (e7584f4) to head (b55d2ba).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #106   +/-   ##
=======================================
  Coverage   99.22%   99.22%           
=======================================
  Files          27       27           
  Lines         642      642           
  Branches      169      172    +3     
=======================================
  Hits          637      637           
  Misses          5        5           

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

@just-boris just-boris added this pull request to the merge queue Nov 4, 2024
Merged via the queue into main with commit c8a5c73 Nov 4, 2024
37 checks passed
@just-boris just-boris deleted the metrics-export branch November 4, 2024 12:38
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