Commit 6721512
committed
refactor(platform-browser): further reduce runtime code size of shared style host
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
```1 parent 9dbe6fc commit 6721512
11 files changed
Lines changed: 89 additions & 71 deletions
File tree
- packages
- core/test/bundling
- animations-standalone
- animations
- cyclic_import
- defer
- forms_reactive
- forms_template_driven
- hydration
- router
- standalone_bootstrap
- todo
- platform-browser/src/dom
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
827 | 827 | | |
828 | 828 | | |
829 | 829 | | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
830 | 833 | | |
831 | 834 | | |
832 | 835 | | |
| |||
1356 | 1359 | | |
1357 | 1360 | | |
1358 | 1361 | | |
1359 | | - | |
| 1362 | + | |
1360 | 1363 | | |
1361 | 1364 | | |
1362 | | - | |
| 1365 | + | |
1363 | 1366 | | |
1364 | 1367 | | |
1365 | 1368 | | |
| |||
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
893 | 896 | | |
894 | 897 | | |
895 | 898 | | |
| |||
1431 | 1434 | | |
1432 | 1435 | | |
1433 | 1436 | | |
1434 | | - | |
| 1437 | + | |
1435 | 1438 | | |
1436 | 1439 | | |
1437 | | - | |
| 1440 | + | |
1438 | 1441 | | |
1439 | 1442 | | |
1440 | 1443 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
686 | 689 | | |
687 | 690 | | |
688 | 691 | | |
| |||
1158 | 1161 | | |
1159 | 1162 | | |
1160 | 1163 | | |
1161 | | - | |
| 1164 | + | |
1162 | 1165 | | |
1163 | 1166 | | |
1164 | 1167 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
761 | 761 | | |
762 | 762 | | |
763 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
764 | 767 | | |
765 | 768 | | |
766 | 769 | | |
| |||
2406 | 2409 | | |
2407 | 2410 | | |
2408 | 2411 | | |
2409 | | - | |
| 2412 | + | |
2410 | 2413 | | |
2411 | 2414 | | |
2412 | 2415 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
983 | 986 | | |
984 | 987 | | |
985 | 988 | | |
| |||
1725 | 1728 | | |
1726 | 1729 | | |
1727 | 1730 | | |
1728 | | - | |
| 1731 | + | |
1729 | 1732 | | |
1730 | 1733 | | |
1731 | 1734 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
947 | 950 | | |
948 | 951 | | |
949 | 952 | | |
| |||
1692 | 1695 | | |
1693 | 1696 | | |
1694 | 1697 | | |
1695 | | - | |
| 1698 | + | |
1696 | 1699 | | |
1697 | 1700 | | |
1698 | 1701 | | |
| |||
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
749 | 752 | | |
750 | 753 | | |
751 | 754 | | |
| |||
1268 | 1271 | | |
1269 | 1272 | | |
1270 | 1273 | | |
1271 | | - | |
1272 | | - | |
1273 | | - | |
1274 | 1274 | | |
1275 | 1275 | | |
1276 | 1276 | | |
1277 | 1277 | | |
1278 | 1278 | | |
1279 | 1279 | | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1280 | 1283 | | |
1281 | 1284 | | |
1282 | 1285 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1121 | 1121 | | |
1122 | 1122 | | |
1123 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1124 | 1127 | | |
1125 | 1128 | | |
1126 | 1129 | | |
| |||
1965 | 1968 | | |
1966 | 1969 | | |
1967 | 1970 | | |
1968 | | - | |
| 1971 | + | |
1969 | 1972 | | |
1970 | 1973 | | |
1971 | 1974 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
617 | 620 | | |
618 | 621 | | |
619 | 622 | | |
| |||
1020 | 1023 | | |
1021 | 1024 | | |
1022 | 1025 | | |
1023 | | - | |
| 1026 | + | |
1024 | 1027 | | |
1025 | 1028 | | |
1026 | 1029 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
800 | 800 | | |
801 | 801 | | |
802 | 802 | | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
803 | 806 | | |
804 | 807 | | |
805 | 808 | | |
| |||
1374 | 1377 | | |
1375 | 1378 | | |
1376 | 1379 | | |
1377 | | - | |
| 1380 | + | |
1378 | 1381 | | |
1379 | 1382 | | |
1380 | 1383 | | |
| |||
0 commit comments