Skip to content

Commit 6eb9fe6

Browse files
Merge pull request #5285 from material-components:size
PiperOrigin-RevId: 591037361
2 parents bad478d + 3638187 commit 6eb9fe6

File tree

10 files changed

+749
-90
lines changed

10 files changed

+749
-90
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Update size
2+
3+
on:
4+
push:
5+
branches: main
6+
workflow_dispatch:
7+
# allows triggering from the github UI
8+
jobs:
9+
check-for-doc-changes:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 20
17+
cache: npm
18+
- uses: google/wireit@setup-github-actions-caching/v1
19+
20+
- name: Install Dependencies
21+
run: npm ci
22+
23+
- name: Update Size
24+
run: npm run update-size
25+
26+
- name: Check if update-size produces git diff
27+
id: ifChange
28+
run: git diff --exit-code || echo "::set-output name=changed::yes"
29+
30+
- name: Create or update PR
31+
if: steps.ifChange.outputs.changed == 'yes'
32+
uses: peter-evans/create-pull-request@v5
33+
with:
34+
token: ${{ secrets.LIT_ROBOT_ACCESS_TOKEN }}
35+
commit-message: 'chore: update sizes'
36+
author: lit-robot <lit-robot@google.com>
37+
committer: lit-robot <lit-robot@google.com>
38+
title: 'chore: update sizes'
39+
body: This PR was auto generated by the update-size-on-main GitHub action.
40+
reviewers: e111077,asyncliz
41+
branch: auto-update-size
42+
# Don't automatically add Ready for Google label until we're ready
43+
# since this will be noisy.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ Google's open-source design system.
1616
- [Introduction](docs/intro.md)
1717
- [Roadmap](docs/roadmap.md)
1818
- [Quick start](docs/quick-start.md)
19+
- [Bundle sizes](docs/size.md)
1920
- [Component docs](docs/components/)
2021
- [Browser support and FAQ](docs/support.md)

docs/size.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Sizes
2+
3+
<!-- go/mwc-size -->
4+
5+
<!--*
6+
# Document freshness: For more information, see go/fresh-source.
7+
freshness: { owner: 'lizmitchell' reviewed: '2023-12-13' }
8+
*-->
9+
10+
<!-- [TOC] -->
11+
12+
This doc tracks important size metrics for Material Web Components.
13+
14+
Sizes are tracked in bundles. A bundle is a single `.js` file for one or more
15+
components that includes all of the JavaScript and CSS needed, minus external
16+
dependencies. We track three metrics:
17+
18+
- **gzip** - minified and compressed. This impacts download size, which can
19+
take longer over slow networks.
20+
21+
- **minified** - minified and unpacked. This impacts the time it takes a page
22+
to be interactive, which can take longer on some devices.
23+
24+
- **% CSS** - the amount of CSS compared to JavaScript. The bundle includes
25+
both JS and CSS, so this helps track changes to JS logic and CSS styles
26+
separately.
27+
28+
<!-- Autogenerated below, do not update! -->
29+
<!-- MWC_UPDATE_TRACKING_START -->
30+
31+
<sub>Last updated 2023-12-13.</sub>
32+
33+
<!-- mdformat off(autogenerated might break rendering in catalog) -->
34+
35+
| Component | gzip | minified | *% CSS* | Import |
36+
| --- | --- | --- | --- | --- |
37+
| **All** | **70.1kb** | 451.9kb | *66% CSS* | `@material/web/all.js` |
38+
| **Common** | **51.5kb** | 282.2kb | *54% CSS* | `@material/web/common.js` |
39+
| **Button** | **8.0kb** | 46.3kb | *66% CSS* | |
40+
| | 6.7kb | 27.4kb | *49% CSS* | `@material/web/button/elevated-button.js` |
41+
| | 6.6kb | 27.3kb | *49% CSS* | `@material/web/button/filled-button.js` |
42+
| | 6.7kb | 27.7kb | *49% CSS* | `@material/web/button/filled-tonal-button.js` |
43+
| | 6.4kb | 25.7kb | *48% CSS* | `@material/web/button/outlined-button.js` |
44+
| | 6.2kb | 24.2kb | *45% CSS* | `@material/web/button/text-button.js` |
45+
| **Checkbox** | **7.0kb** | 28.5kb | *43% CSS* | `@material/web/checkbox/checkbox.js` |
46+
| **Chips** | **10.0kb** | 60.4kb | *64% CSS* | |
47+
| | 4.8kb | 16.4kb | *22% CSS* | `@material/web/chips/chip-set.js` |
48+
| | 6.3kb | 26.8kb | *51% CSS* | `@material/web/chips/assist-chip.js` |
49+
| | 7.9kb | 37.0kb | *55% CSS* | `@material/web/chips/filter-chip.js` |
50+
| | 7.3kb | 33.7kb | *54% CSS* | `@material/web/chips/input-chip.js` |
51+
| | 6.4kb | 27.2kb | *51% CSS* | `@material/web/chips/suggestion-chip.js` |
52+
| **Dialog** | **4.2kb** | 15.2kb | *36% CSS* | `@material/web/dialog/dialog.js` |
53+
| **Divider** | **0.7kb** | 1.4kb | *39% CSS* | `@material/web/divider/divider.js` |
54+
| **Elevation** | **0.7kb** | 1.7kb | *62% CSS* | `@material/web/elevation/elevation.js` |
55+
| **Fab** | **6.9kb** | 37.1kb | *67% CSS* | |
56+
| | 6.6kb | 32.8kb | *64% CSS* | `@material/web/fab/fab.js` |
57+
| | 5.8kb | 24.6kb | *51% CSS* | `@material/web/fab/branded-fab.js` |
58+
| **Field** | **6.0kb** | 40.5kb | *83% CSS* | |
59+
| | 4.6kb | 24.8kb | *75% CSS* | `@material/web/field/filled-field.js` |
60+
| | 5.0kb | 27.1kb | *76% CSS* | `@material/web/field/outlined-field.js` |
61+
| **Focus** | **1.6kb** | 5.2kb | *46% CSS* | `@material/web/focus/md-focus-ring.js` |
62+
| **Icon** | **0.7kb** | 1.3kb | *46% CSS* | `@material/web/icon/icon.js` |
63+
| **Icon button** | **7.3kb** | 42.0kb | *65% CSS* | |
64+
| | 5.8kb | 23.1kb | *42% CSS* | `@material/web/iconbutton/icon-button.js` |
65+
| | 6.0kb | 25.0kb | *45% CSS* | `@material/web/iconbutton/filled-icon-button.js` |
66+
| | 6.0kb | 25.5kb | *46% CSS* | `@material/web/iconbutton/filled-tonal-icon-button.js` |
67+
| | 6.0kb | 24.6kb | *45% CSS* | `@material/web/iconbutton/outlined-icon-button.js` |
68+
| **List** | **6.9kb** | 27.2kb | *35% CSS* | |
69+
| | 1.6kb | 4.5kb | *5% CSS* | `@material/web/list/list.js` |
70+
| | 5.8kb | 23.0kb | *40% CSS* | `@material/web/list/list-item.js` |
71+
| **Menu** | **13.5kb** | 53.9kb | *23% CSS* | |
72+
| | 7.9kb | 28.8kb | *17% CSS* | `@material/web/menu/menu.js` |
73+
| | 6.5kb | 25.6kb | *37% CSS* | `@material/web/menu/menu-item.js` |
74+
| | 8.4kb | 31.9kb | *11% CSS* | `@material/web/menu/sub-menu.js` |
75+
| **Progress** | **3.5kb** | 13.9kb | *70% CSS* | |
76+
| | 2.6kb | 8.6kb | *64% CSS* | `@material/web/progress/linear-progress.js` |
77+
| | 2.2kb | 7.4kb | *57% CSS* | `@material/web/progress/circular-progress.js` |
78+
| **Radio** | **6.9kb** | 26.0kb | *31% CSS* | `@material/web/radio/radio.js` |
79+
| **Ripple** | **2.8kb** | 7.9kb | *14% CSS* | `@material/web/ripple/ripple.js` |
80+
| **Select** | **25.6kb** | 142.5kb | *57% CSS* | |
81+
| | 17.8kb | 89.3kb | *48% CSS* | `@material/web/select/filled-select.js` |
82+
| | 18.1kb | 89.9kb | *48% CSS* | `@material/web/select/outlined-select.js` |
83+
| | 6.6kb | 26.6kb | *36% CSS* | `@material/web/select/select-option.js` |
84+
| **Slider** | **9.7kb** | 45.0kb | *49% CSS* | `@material/web/slider/slider.js` |
85+
| **Switch** | **7.8kb** | 34.8kb | *53% CSS* | `@material/web/switch/switch.js` |
86+
| **Tabs** | **7.9kb** | 35.1kb | *50% CSS* | |
87+
| | 6.2kb | 21.9kb | *25% CSS* | `@material/web/tabs/tabs.js` |
88+
| | 6.3kb | 25.6kb | *48% CSS* | `@material/web/tabs/primary-tab.js` |
89+
| | 6.2kb | 25.2kb | *48% CSS* | `@material/web/tabs/secondary-tab.js` |
90+
| **Text field** | **13.7kb** | 93.0kb | *74% CSS* | |
91+
| | 10.7kb | 60.8kb | *62% CSS* | `@material/web/textfield/filled-text-field.js` |
92+
| | 10.9kb | 61.3kb | *62% CSS* | `@material/web/textfield/outlined-text-field.js` |
93+
94+
<!-- mdformat on(autogenerated might break rendering in catalog) -->
95+
96+
<!-- MWC_UPDATE_TRACKING_END -->

0 commit comments

Comments
 (0)