mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This is a minimal implmentation which just focuses on registering parent shadow roots in `SharedStylesHost` correctly. We don't currently reference count usage of host values, meaning that as soon as we call `removeHost`, all styles are removed from it, even if other components relied on them. Therefore there is no good way to know whether styles are still needed or not, leaving us with the choice of either leaking them longer than necessary or destroying them while another component still needs them. The compromise I'm using here is to delete styles when destroying a component under a shadow root (based on the assumption that only one component will exist per shadow root) and to leave styles when destroying a component in the main document (based on the assumption that dialogs being destroyed should not impact the main application). Neither assumption is totally safe to make, but we're hoping this is a viable balance for the moment. In the future we should look into lifting these restrictions to better support those use cases while properly reference counting usage of hosts in `SharedStylesHost`. I also added some small tests to confirm that SSR styles are not duplicated, as an earlier implementation accidentally duplicated them. This should ensure we don't repeat that mistake.
4 lines
58 B
JSON
4 lines
58 B
JSON
{
|
|
"dist/main.js": 93814,
|
|
"dist/polyfills.js": 35677
|
|
}
|