You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.
Currently the template cache generator will add every html/css resource that is referenced by a component in your application. This has a number of problems:
HTML/CSS are loaded on initial load for the whole application. Even if it is only used in a couple of split points. This bloats the initial download when the developer is trying to explicitly remove code from the main application.
HTML/CSS for components which may not be used in the application are downloaded in the application. Tree shaking may have eliminated the code for the component, but since the resources are in a map tree shaking could not remove these resources. Many times these resources are actually bigger than code for the component itself. If a developer uses a widget library and doesn't use all of the components he will increase the download size of the application with HTML/CSS that they aren't using.
The text was updated successfully, but these errors were encountered:
A possible solution to this is to move away from the Map used to cache HTML/CSS resources and instead inline the HTML/CSS into constants used directly by the components. This will allow the components to still share HTML/CSS when it makes sense, but also allow the compiler to TreeShake the resources.
Thoughts? I have time to work on a solution whatever we agree is the best approach. This would be a transformer moving away from the binary tool we have now.
Currently the template cache generator will add every html/css resource that is referenced by a component in your application. This has a number of problems:
The text was updated successfully, but these errors were encountered: