08a4f10ee7
This commit transforms the setClassMetadata calls generated by ngtsc from: ```typescript /*@__PURE__*/ setClassMetadata(...); ``` to: ```typescript /*@__PURE__*/ (function() { setClassMetadata(...); })(); ``` Without the IIFE, terser won't remove these function calls because the function calls have arguments that themselves are function calls or other impure expressions. In order to make the whole block be DCE-ed by terser, we wrap it into IIFE and mark the IIFE as pure. It should be noted that this change doesn't have any impact on CLI* with build-optimizer, which removes the whole setClassMetadata block within the webpack loader, so terser or webpack itself don't get to see it at all. This is done to prevent cross-chunk retention issues caused by webpack's internal module registry. * actually we do expect a short-term size regression while https://github.com/angular/angular-cli/pull/16228 is merged and released in the next rc of the CLI. But long term this change does nothing to CLI + build-optimizer configuration and is done primarly to correct the seemingly correct but non-function PURE annotation that builds not using build-optimizer could rely on. PR Close #33337
68 lines
1.6 KiB
JSON
68 lines
1.6 KiB
JSON
{
|
|
"cli-hello-world": {
|
|
"master": {
|
|
"uncompressed": {
|
|
"runtime-es2015": 1485,
|
|
"main-es2015": 141575,
|
|
"polyfills-es2015": 36808
|
|
}
|
|
}
|
|
},
|
|
"cli-hello-world-ivy-minimal": {
|
|
"master": {
|
|
"uncompressed": {
|
|
"runtime-es2015": 1485,
|
|
"main-es2015": 15267,
|
|
"polyfills-es2015": 36808
|
|
}
|
|
}
|
|
},
|
|
"cli-hello-world-ivy-compat": {
|
|
"master": {
|
|
"uncompressed": {
|
|
"runtime-es2015": 1485,
|
|
"main-es2015": 147719,
|
|
"polyfills-es2015": 36808
|
|
}
|
|
}
|
|
},
|
|
"cli-hello-world-ivy-i18n": {
|
|
"master": {
|
|
"uncompressed": {
|
|
"runtime-es2015": 1485,
|
|
"main-es2015": 138032,
|
|
"polyfills-es2015": 37494
|
|
}
|
|
}
|
|
},
|
|
"cli-hello-world-lazy": {
|
|
"master": {
|
|
"uncompressed": {
|
|
"runtime-es2015": 2289,
|
|
"main-es2015": 312772,
|
|
"polyfills-es2015": 36808,
|
|
"5-es2015": 751
|
|
}
|
|
}
|
|
},
|
|
"cli-hello-world-lazy-rollup": {
|
|
"master": {
|
|
"uncompressed": {
|
|
"runtime-es2015": 2289,
|
|
"main-es2015": 227998,
|
|
"polyfills-es2015": 36808,
|
|
"5-es2015": 779
|
|
}
|
|
}
|
|
},
|
|
"hello_world__closure": {
|
|
"master": {
|
|
"uncompressed": {
|
|
"bundle": "TODO(i): temporarily increase the payload size limit from 105779 - this is due to a closure issue related to ESM reexports that still needs to be investigated",
|
|
"bundle": "TODO(i): we should define ngDevMode to false in Closure, but --define only works in the global scope.",
|
|
"bundle": 177447
|
|
}
|
|
}
|
|
}
|
|
}
|