angular/packages/core/src
Doug Parker cdda51a3b2 feat(core): support bootstrapping Angular applications underneath shadow roots
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.
2026-04-10 21:44:08 +03:00
..
animation feat(core): re-introduce nested leave animations scoped to component boundaries 2026-03-13 13:01:55 -06:00
application feat(core): bootstrap via ApplicationRef with config 2026-04-07 12:48:53 -07:00
authoring docs: Adds @see links and update defer reference 2026-03-09 16:59:39 -07:00
change_detection docs: update change detection strategy references 2026-03-27 15:43:43 +01:00
compiler refactor(forms): move control logic into FormField directive 2026-01-29 13:17:40 -08:00
debug refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
defer refactor(core): address review comments on NG0750 error message 2026-04-02 14:55:42 -07:00
di fix(core): ensure definitions compile 2026-03-10 09:58:18 -07:00
hydration fix(core): resolver function not matching expected type 2026-03-20 15:18:29 -07:00
i18n docs: add @see links to API docs for better discoverability 2026-01-05 12:12:24 -05:00
interface refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
internal refactor(core): add tracing for component creation 2026-03-06 09:48:23 -08:00
linker fix(core): handle missing serialized container hydration data 2026-04-07 11:22:03 -07:00
metadata docs: update change detection strategy references 2026-03-27 15:43:43 +01:00
platform fix(core): return StaticProvider for providePlatformInitializer 2025-12-15 15:16:37 -08:00
reflection build: rename defaults2.bzl to defaults.bzl (#63383) 2025-08-25 15:45:01 -07:00
render fix(core): prevent animations renderer from impacting animate.leave (#63921) 2025-09-19 21:26:18 +00:00
render3 feat(core): support bootstrapping Angular applications underneath shadow roots 2026-04-10 21:44:08 +03:00
resource feat(forms): add debounce option to validateAsync and validateHttp 2026-03-25 14:17:52 -07:00
sanitization fix(core): prevent binding unsafe attributes on SVG animation elements (#67797) 2026-04-01 11:43:58 +02:00
testability fix(core): cleanup testability subscriptions (#61261) 2025-05-21 12:06:23 +00:00
util refactor: ensure modules with 'declare global' are correctly handled by Rollup 2026-03-12 14:58:00 -06:00
view refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
zone docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
authoring.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
cached_injector_service.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
change_detection.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
console.ts refactor: remove unnecessary TSLint rule flags (#59365) 2025-01-07 16:06:21 +00:00
core.externs.js refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core.ts refactor(core): remove createNgModuleRef 2026-03-05 12:02:27 -08:00
core_private_export.ts refactor(core): move SharedStylesHost interface into @angular/core with a dedicated InjectionToken 2026-04-10 21:44:08 +03:00
core_reactivity_export.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
core_reactivity_export_internal.ts refactor(core): expose isWritableSignal to the publicApi 2025-10-29 20:31:41 +00:00
core_render3_private_export.ts refactor(core): abstract control flow discovery utilities (#66167) 2026-03-16 14:17:25 -07:00
di.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
document.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
error_details_base_url.ts refactor(core): update error message links to versioned docs (#66374) 2026-01-09 22:33:51 +00:00
error_handler.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
errors.ts feat(core): allow debouncing signals 2026-03-09 13:21:52 -07:00
event_delegation_utils.ts refactor(core): correct all typeof ngDevMode comparison patterns introduced by #63875 2025-12-08 10:30:01 -08:00
event_emitter.ts docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
image_performance_warning.ts refactor(core): update error message links to versioned docs (#66374) 2026-01-09 22:33:51 +00:00
linker.ts refactor(core): remove ComponentFactoryResolver & ComponentFactory from the api surface"" 2026-04-07 09:30:25 -07:00
metadata.ts refactor(core): move interfaces around (#64535) 2025-10-20 17:49:39 +00:00
ng_reflect.ts refactor(core): remove redundant providedIn: 'root' from injection tokens 2025-11-04 00:31:52 +00:00
pending_tasks.ts docs: Adds links to relevant guides for APIs in core package 2025-11-17 08:47:35 -08:00
pending_tasks_internal.ts feat(core): Add stability debugging utility 2025-12-17 15:43:05 -08:00
profiler.ts refactor(core): implement missing OnDestroy for schedulers 2026-01-02 08:19:57 +01:00
r3_symbols.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
render.ts feat(core): add event listener options to renderer (#59092) 2024-12-10 13:39:47 -08:00
transfer_state.ts refactor: replace getDocument() with inject(DOCUMENT) 2025-11-25 13:04:58 -05:00
type_checking.ts refactor(core): expose function to assert type of variables (#62648) 2025-07-16 12:40:25 +02:00
version.ts refactor(core): mark VERSION as @__PURE__ for better tree-shaking (#63400) 2025-08-27 11:39:06 -07:00
zone.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00