@angular/core 19.2.8 → 19.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/event_dispatcher.d-DlbccpYq.d.ts +1 -1
  2. package/fesm2022/core.mjs +57 -34
  3. package/fesm2022/core.mjs.map +1 -1
  4. package/fesm2022/primitives/di.mjs +1 -1
  5. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  6. package/fesm2022/primitives/signals.mjs +1 -1
  7. package/fesm2022/rxjs-interop.mjs +1 -1
  8. package/fesm2022/testing.mjs +30 -11
  9. package/fesm2022/testing.mjs.map +1 -1
  10. package/fesm2022/untracked-BKcld_ew.mjs +1 -1
  11. package/index.d.ts +13 -4
  12. package/navigation_types.d-fAxd92YV.d.ts +1 -1
  13. package/package.json +1 -1
  14. package/primitives/di/index.d.ts +1 -1
  15. package/primitives/event-dispatch/index.d.ts +1 -1
  16. package/primitives/signals/index.d.ts +1 -1
  17. package/rxjs-interop/index.d.ts +1 -1
  18. package/schematics/bundles/apply_import_manager-COqnCltX.js +1 -1
  19. package/schematics/bundles/checker-BNmiXJIJ.js +2 -2
  20. package/schematics/bundles/cleanup-unused-imports.js +1 -1
  21. package/schematics/bundles/compiler_host-BafHjBMK.js +1 -1
  22. package/schematics/bundles/control-flow-migration.js +1 -1
  23. package/schematics/bundles/explicit-standalone-flag.js +1 -1
  24. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  25. package/schematics/bundles/index-CAJ-Rm56.js +11 -11
  26. package/schematics/bundles/index-rvZ5aROS.js +1 -1
  27. package/schematics/bundles/inject-migration.js +1 -1
  28. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  29. package/schematics/bundles/migrate_ts_type_references-BIV-FPWl.js +1 -1
  30. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  31. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  32. package/schematics/bundles/output-migration.js +1 -1
  33. package/schematics/bundles/pending-tasks.js +1 -1
  34. package/schematics/bundles/project_paths-A9I0g_ID.js +1 -1
  35. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  36. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  37. package/schematics/bundles/provide-initializer.js +1 -1
  38. package/schematics/bundles/route-lazy-loading.js +1 -1
  39. package/schematics/bundles/self-closing-tags-migration.js +1 -1
  40. package/schematics/bundles/signal-input-migration.js +1 -1
  41. package/schematics/bundles/signal-queries-migration.js +1 -1
  42. package/schematics/bundles/signals.js +1 -1
  43. package/schematics/bundles/standalone-migration.js +1 -1
  44. package/testing/index.d.ts +5 -3
  45. package/weak_ref.d-DWHPG08n.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.8
2
+ * @license Angular v19.2.9
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/fesm2022/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.8
2
+ * @license Angular v19.2.9
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -5902,8 +5902,26 @@ class NodeInjectorDestroyRef extends DestroyRef {
5902
5902
  this._lView = _lView;
5903
5903
  }
5904
5904
  onDestroy(callback) {
5905
- storeLViewOnDestroy(this._lView, callback);
5906
- return () => removeLViewOnDestroy(this._lView, callback);
5905
+ const lView = this._lView;
5906
+ // Checking if `lView` is already destroyed before storing the `callback` enhances
5907
+ // safety and integrity for applications.
5908
+ // If `lView` is destroyed, we call the `callback` immediately to ensure that
5909
+ // any necessary cleanup is handled gracefully.
5910
+ // With this approach, we're providing better reliability in managing resources.
5911
+ // One of the use cases is `takeUntilDestroyed`, which aims to replace `takeUntil`
5912
+ // in existing applications. While `takeUntil` can be safely called once the view
5913
+ // is destroyed — resulting in no errors and finalizing the subscription depending
5914
+ // on whether a subject or replay subject is used, replacing it with
5915
+ // `takeUntilDestroyed` introduces a breaking change, as it throws an error if
5916
+ // the `lView` is destroyed (https://github.com/angular/angular/issues/54527).
5917
+ if (isDestroyed(lView)) {
5918
+ callback();
5919
+ // We return a "noop" callback, which, when executed, does nothing because
5920
+ // we haven't stored anything on the `lView`, and thus there's nothing to remove.
5921
+ return () => { };
5922
+ }
5923
+ storeLViewOnDestroy(lView, callback);
5924
+ return () => removeLViewOnDestroy(lView, callback);
5907
5925
  }
5908
5926
  }
5909
5927
  function injectDestroyRef() {
@@ -6097,9 +6115,13 @@ class EventEmitter_ extends Subject {
6097
6115
  return (value) => {
6098
6116
  const taskId = this.pendingTasks?.add();
6099
6117
  setTimeout(() => {
6100
- fn(value);
6101
- if (taskId !== undefined) {
6102
- this.pendingTasks?.remove(taskId);
6118
+ try {
6119
+ fn(value);
6120
+ }
6121
+ finally {
6122
+ if (taskId !== undefined) {
6123
+ this.pendingTasks?.remove(taskId);
6124
+ }
6103
6125
  }
6104
6126
  });
6105
6127
  };
@@ -6917,12 +6939,13 @@ function createElementRef(tNode, lView) {
6917
6939
  // and could do better codegen in the future.
6918
6940
  class ElementRef {
6919
6941
  /**
6920
- * <div class="callout is-critical">
6942
+ * <div class="docs-alert docs-alert-important">
6921
6943
  * <header>Use with caution</header>
6922
6944
  * <p>
6923
6945
  * Use this API as the last resort when direct access to DOM is needed. Use templating and
6924
- * data-binding provided by Angular instead. Alternatively you can take a look at
6925
- * {@link Renderer2} which provides an API that can be safely used.
6946
+ * data-binding provided by Angular instead. If used, it is recommended in combination with
6947
+ * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls DomSanitizer}
6948
+ * for maxiumum security;
6926
6949
  * </p>
6927
6950
  * </div>
6928
6951
  */
@@ -16849,6 +16872,14 @@ class RendererFactory2 {
16849
16872
  * renders a template into DOM. You can use custom rendering to intercept
16850
16873
  * rendering calls, or to render to something other than DOM.
16851
16874
  *
16875
+ * <div class="docs-alert docs-alert-important">
16876
+ * <p>
16877
+ * Please be aware that usage of `Renderer2`, in context of accessing DOM elements, provides no
16878
+ * extra security which makes it equivalent to
16879
+ * {@link /best-practices/security#direct-use-of-the-dom-apis-and-explicit-sanitization-calls Security vulnerabilities}.
16880
+ * </p>
16881
+ * </div>
16882
+ *
16852
16883
  * Create your custom renderer using `RendererFactory2`.
16853
16884
  *
16854
16885
  * Use a custom renderer to bypass Angular's templating and
@@ -17913,7 +17944,7 @@ class ComponentFactory extends ComponentFactory$1 {
17913
17944
  const cmpDef = this.componentDef;
17914
17945
  ngDevMode && verifyNotAnOrphanComponent(cmpDef);
17915
17946
  const tAttributes = rootSelectorOrNode
17916
- ? ['ng-version', '19.2.8']
17947
+ ? ['ng-version', '19.2.9']
17917
17948
  : // Extract attributes and classes from the first selector only to match VE behavior.
17918
17949
  extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
17919
17950
  // Create the root view. Uses empty TView and ContentTemplate.
@@ -30108,15 +30139,12 @@ function isOutputSubscribable(value) {
30108
30139
  return (value != null && typeof value.subscribe === 'function');
30109
30140
  }
30110
30141
 
30111
- /**
30112
- * Contains a reference to a function that disables event replay feature
30113
- * for server-side rendered applications. This function is overridden with
30114
- * an actual implementation when the event replay feature is enabled via
30115
- * `withEventReplay()` call.
30116
- */
30117
- let stashEventListener = (el, eventName, listenerFn) => { };
30118
- function setStashFn(fn) {
30119
- stashEventListener = fn;
30142
+ const stashEventListeners = new Map();
30143
+ function setStashFn(appId, fn) {
30144
+ stashEventListeners.set(appId, fn);
30145
+ }
30146
+ function clearStashFn(appId) {
30147
+ stashEventListeners.delete(appId);
30120
30148
  }
30121
30149
  /**
30122
30150
  * Adds an event listener to the current node.
@@ -30255,7 +30283,9 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
30255
30283
  }
30256
30284
  else {
30257
30285
  listenerFn = wrapListener(tNode, lView, listenerFn);
30258
- stashEventListener(target, eventName, listenerFn);
30286
+ const appId = lView[INJECTOR].get(APP_ID);
30287
+ const stashEventListener = stashEventListeners.get(appId);
30288
+ stashEventListener?.(target, eventName, listenerFn);
30259
30289
  const cleanupFn = renderer.listen(target, eventName, listenerFn);
30260
30290
  ngDevMode && ngDevMode.rendererAddEventListener++;
30261
30291
  lCleanup.push(listenerFn, cleanupFn);
@@ -34653,7 +34683,7 @@ class Version {
34653
34683
  /**
34654
34684
  * @publicApi
34655
34685
  */
34656
- const VERSION = new Version('19.2.8');
34686
+ const VERSION = new Version('19.2.9');
34657
34687
 
34658
34688
  /**
34659
34689
  * Combination of NgModuleFactory and ComponentFactories.
@@ -38156,7 +38186,8 @@ function withEventReplay() {
38156
38186
  if (!appsWithEventReplay.has(appRef)) {
38157
38187
  const jsActionMap = inject(JSACTION_BLOCK_ELEMENT_MAP);
38158
38188
  if (shouldEnableEventReplay(injector)) {
38159
- setStashFn((rEl, eventName, listenerFn) => {
38189
+ const appId = injector.get(APP_ID);
38190
+ setStashFn(appId, (rEl, eventName, listenerFn) => {
38160
38191
  // If a user binds to a ng-container and uses a directive that binds using a host listener,
38161
38192
  // this element could be a comment node. So we need to ensure we have an actual element
38162
38193
  // node before stashing anything.
@@ -38172,7 +38203,6 @@ function withEventReplay() {
38172
38203
  }, {
38173
38204
  provide: APP_BOOTSTRAP_LISTENER,
38174
38205
  useFactory: () => {
38175
- const appId = inject(APP_ID);
38176
38206
  const appRef = inject(ApplicationRef);
38177
38207
  const { injector } = appRef;
38178
38208
  return () => {
@@ -38187,6 +38217,7 @@ function withEventReplay() {
38187
38217
  appsWithEventReplay.delete(appRef);
38188
38218
  // Ensure that we're always safe calling this in the browser.
38189
38219
  if (typeof ngServerMode !== 'undefined' && !ngServerMode) {
38220
+ const appId = injector.get(APP_ID);
38190
38221
  // `_ejsa` should be deleted when the app is destroyed, ensuring that
38191
38222
  // no elements are still captured in the global list and are not prevented
38192
38223
  // from being garbage collected.
@@ -38194,7 +38225,7 @@ function withEventReplay() {
38194
38225
  // Clean up the reference to the function set by the environment initializer,
38195
38226
  // as the function closure may capture injected elements and prevent them
38196
38227
  // from being properly garbage collected.
38197
- setStashFn(() => { });
38228
+ clearStashFn(appId);
38198
38229
  }
38199
38230
  });
38200
38231
  // Kick off event replay logic once hydration for the initial part
@@ -39587,14 +39618,6 @@ function effect(effectFn, options) {
39587
39618
  }
39588
39619
  return effectRef;
39589
39620
  }
39590
- /**
39591
- * Not public API, which guarantees `EffectScheduler` only ever comes from the application root
39592
- * injector.
39593
- */
39594
- /* @__PURE__ */ new InjectionToken('', {
39595
- providedIn: 'root',
39596
- factory: () => inject(EffectScheduler),
39597
- });
39598
39621
  const BASE_EFFECT_NODE =
39599
39622
  /* @__PURE__ */ (() => ({
39600
39623
  ...REACTIVE_NODE,
@@ -40198,8 +40221,8 @@ function ɵɵngDeclarePipe(decl) {
40198
40221
  return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
40199
40222
  }
40200
40223
 
40201
- const NOT_SET = Symbol('NOT_SET');
40202
- const EMPTY_CLEANUP_SET = new Set();
40224
+ const NOT_SET = /* @__PURE__ */ Symbol('NOT_SET');
40225
+ const EMPTY_CLEANUP_SET = /* @__PURE__ */ new Set();
40203
40226
  const AFTER_RENDER_PHASE_EFFECT_NODE = /* @__PURE__ */ (() => ({
40204
40227
  ...SIGNAL_NODE,
40205
40228
  consumerIsAlwaysLive: true,