fix(compiler): share identical stylesheets between components in the same file (#38213)

Prior to this commit, duplicated styles defined in multiple components in the same file were not
shared between components, thus causing extra payload size. This commit updates compiler logic to
use `ConstantPool` for the styles (while generating the `styles` array on component def), which
enables styles sharing when needed (when duplicates styles are present).

Resolves #38204.

PR Close #38213
This commit is contained in:
Andrew Kushnir
2020-07-23 18:51:55 -07:00
committed by Michael Prentice
parent 4f842e23df
commit 6881149540
5 changed files with 70 additions and 6 deletions

View File

@ -12,7 +12,7 @@
"master": {
"uncompressed": {
"runtime-es2015": 2987,
"main-es2015": 450596,
"main-es2015": 448419,
"polyfills-es2015": 52630
}
}