Large strings constants are now wrapped in a function which is called whenever used. This works around a unique limitation of Closure, where it will **always** inline string literals at **every** usage, regardless of how large the string literal is or how many times it is used.The workaround is to use a function rather than a string literal. Closure has differently inlining semantics for functions, where it will check the length of the function and the number of times it is used before choosing to inline it. By using a function, `ngtsc` makes Closure more conservative about inlining large strings, and avoids blowing up the bundle size.This optimization is only used if the constant is a large string. A wrapping function is not included for other use cases, since it would just increase the bundle size and add unnecessary runtime performance overhead. PR Close #38253
…
Angular
Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages.
Quickstart
Changelog
Learn about the latest improvements.
Want to help?
Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the hotlist: community-help.
Description
Languages
TypeScript
68.6%
HTML
12.8%
JavaScript
8.4%
Pug
7%
Starlark
1.4%
Other
1.7%