Commit ea54426
refactor(platform-browser): further reduce runtime code size of shared style host (angular#57951)
The `SharedStylesHost` class has been refactored to further reduce
the runtime code size. SSR generated component styles are now added directly
into the usage records to avoid the need for additional data structures and
lookups when adding a component style. The code reduction in a prerelease
newly generated Angular CLI application for production is ~190 bytes.
Before:
```
Initial chunk files | Names | Raw size | Estimated transfer size
main-3X2VHGTM.js | main | 208.26 kB | 56.30 kB
polyfills-FFHMD2TL.js | polyfills | 34.52 kB | 11.28 kB
styles-5INURTSO.css | styles | 0 bytes | 0 bytes
| Initial total | 242.78 kB | 67.58 kB
```
After:
```
Initial chunk files | Names | Raw size | Estimated transfer size
main-MGOZ6Q4F.js | main | 208.07 kB | 56.26 kB
polyfills-FFHMD2TL.js | polyfills | 34.52 kB | 11.28 kB
styles-5INURTSO.css | styles | 0 bytes | 0 bytes
| Initial total | 242.59 kB | 67.54 kB
```
PR Close angular#579511 parent 187c3b2 commit ea54426
File tree
11 files changed
+89
-71
lines changed- packages
- core/test/bundling
- animations-standalone
- animations
- cyclic_import
- defer
- forms_reactive
- forms_template_driven
- hydration
- router
- standalone_bootstrap
- todo
- platform-browser/src/dom
11 files changed
+89
-71
lines changedLines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
821 | 824 | | |
822 | 825 | | |
823 | 826 | | |
| |||
1347 | 1350 | | |
1348 | 1351 | | |
1349 | 1352 | | |
1350 | | - | |
| 1353 | + | |
1351 | 1354 | | |
1352 | 1355 | | |
1353 | | - | |
| 1356 | + | |
1354 | 1357 | | |
1355 | 1358 | | |
1356 | 1359 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
887 | 890 | | |
888 | 891 | | |
889 | 892 | | |
| |||
1425 | 1428 | | |
1426 | 1429 | | |
1427 | 1430 | | |
1428 | | - | |
| 1431 | + | |
1429 | 1432 | | |
1430 | 1433 | | |
1431 | | - | |
| 1434 | + | |
1432 | 1435 | | |
1433 | 1436 | | |
1434 | 1437 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
677 | 677 | | |
678 | 678 | | |
679 | 679 | | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
680 | 683 | | |
681 | 684 | | |
682 | 685 | | |
| |||
1152 | 1155 | | |
1153 | 1156 | | |
1154 | 1157 | | |
1155 | | - | |
| 1158 | + | |
1156 | 1159 | | |
1157 | 1160 | | |
1158 | 1161 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
758 | 761 | | |
759 | 762 | | |
760 | 763 | | |
| |||
2397 | 2400 | | |
2398 | 2401 | | |
2399 | 2402 | | |
2400 | | - | |
| 2403 | + | |
2401 | 2404 | | |
2402 | 2405 | | |
2403 | 2406 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
977 | 980 | | |
978 | 981 | | |
979 | 982 | | |
| |||
1719 | 1722 | | |
1720 | 1723 | | |
1721 | 1724 | | |
1722 | | - | |
| 1725 | + | |
1723 | 1726 | | |
1724 | 1727 | | |
1725 | 1728 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
938 | 938 | | |
939 | 939 | | |
940 | 940 | | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
941 | 944 | | |
942 | 945 | | |
943 | 946 | | |
| |||
1686 | 1689 | | |
1687 | 1690 | | |
1688 | 1691 | | |
1689 | | - | |
| 1692 | + | |
1690 | 1693 | | |
1691 | 1694 | | |
1692 | 1695 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
737 | 737 | | |
738 | 738 | | |
739 | 739 | | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
740 | 743 | | |
741 | 744 | | |
742 | 745 | | |
| |||
1259 | 1262 | | |
1260 | 1263 | | |
1261 | 1264 | | |
1262 | | - | |
1263 | | - | |
1264 | | - | |
1265 | 1265 | | |
1266 | 1266 | | |
1267 | 1267 | | |
1268 | 1268 | | |
1269 | 1269 | | |
1270 | 1270 | | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
1271 | 1274 | | |
1272 | 1275 | | |
1273 | 1276 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1115 | 1118 | | |
1116 | 1119 | | |
1117 | 1120 | | |
| |||
1956 | 1959 | | |
1957 | 1960 | | |
1958 | 1961 | | |
1959 | | - | |
| 1962 | + | |
1960 | 1963 | | |
1961 | 1964 | | |
1962 | 1965 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
605 | 605 | | |
606 | 606 | | |
607 | 607 | | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
608 | 611 | | |
609 | 612 | | |
610 | 613 | | |
| |||
1011 | 1014 | | |
1012 | 1015 | | |
1013 | 1016 | | |
1014 | | - | |
| 1017 | + | |
1015 | 1018 | | |
1016 | 1019 | | |
1017 | 1020 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
797 | 800 | | |
798 | 801 | | |
799 | 802 | | |
| |||
1368 | 1371 | | |
1369 | 1372 | | |
1370 | 1373 | | |
1371 | | - | |
| 1374 | + | |
1372 | 1375 | | |
1373 | 1376 | | |
1374 | 1377 | | |
| |||
0 commit comments