@angular/core 19.2.7 → 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 +59 -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 +17 -6
  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-2VufvTsB.js → apply_import_manager-COqnCltX.js} +2 -2
  19. package/schematics/bundles/checker-BNmiXJIJ.js +2 -2
  20. package/schematics/bundles/cleanup-unused-imports.js +4 -4
  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-DMhRS_CK.js → index-CAJ-Rm56.js} +43 -20
  26. package/schematics/bundles/{index-DJTfI03d.js → index-rvZ5aROS.js} +3 -3
  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-CgtT9yyW.js → migrate_ts_type_references-BIV-FPWl.js} +4 -4
  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 +5 -5
  33. package/schematics/bundles/pending-tasks.js +1 -1
  34. package/schematics/bundles/{project_paths-C-UAB3jT.js → project_paths-A9I0g_ID.js} +2 -2
  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 +3 -3
  40. package/schematics/bundles/signal-input-migration.js +6 -6
  41. package/schematics/bundles/signal-queries-migration.js +6 -6
  42. package/schematics/bundles/signals.js +6 -6
  43. package/schematics/bundles/standalone-migration.js +2 -2
  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.7
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.7
2
+ * @license Angular v19.2.9
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1666,6 +1666,8 @@ function isStandalone(type) {
1666
1666
  /**
1667
1667
  * Wrap an array of `Provider`s into `EnvironmentProviders`, preventing them from being accidentally
1668
1668
  * referenced in `@Component` in a component injector.
1669
+ *
1670
+ * @publicApi
1669
1671
  */
1670
1672
  function makeEnvironmentProviders(providers) {
1671
1673
  return {
@@ -5900,8 +5902,26 @@ class NodeInjectorDestroyRef extends DestroyRef {
5900
5902
  this._lView = _lView;
5901
5903
  }
5902
5904
  onDestroy(callback) {
5903
- storeLViewOnDestroy(this._lView, callback);
5904
- 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);
5905
5925
  }
5906
5926
  }
5907
5927
  function injectDestroyRef() {
@@ -6095,9 +6115,13 @@ class EventEmitter_ extends Subject {
6095
6115
  return (value) => {
6096
6116
  const taskId = this.pendingTasks?.add();
6097
6117
  setTimeout(() => {
6098
- fn(value);
6099
- if (taskId !== undefined) {
6100
- this.pendingTasks?.remove(taskId);
6118
+ try {
6119
+ fn(value);
6120
+ }
6121
+ finally {
6122
+ if (taskId !== undefined) {
6123
+ this.pendingTasks?.remove(taskId);
6124
+ }
6101
6125
  }
6102
6126
  });
6103
6127
  };
@@ -6915,12 +6939,13 @@ function createElementRef(tNode, lView) {
6915
6939
  // and could do better codegen in the future.
6916
6940
  class ElementRef {
6917
6941
  /**
6918
- * <div class="callout is-critical">
6942
+ * <div class="docs-alert docs-alert-important">
6919
6943
  * <header>Use with caution</header>
6920
6944
  * <p>
6921
6945
  * Use this API as the last resort when direct access to DOM is needed. Use templating and
6922
- * data-binding provided by Angular instead. Alternatively you can take a look at
6923
- * {@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;
6924
6949
  * </p>
6925
6950
  * </div>
6926
6951
  */
@@ -16847,6 +16872,14 @@ class RendererFactory2 {
16847
16872
  * renders a template into DOM. You can use custom rendering to intercept
16848
16873
  * rendering calls, or to render to something other than DOM.
16849
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
+ *
16850
16883
  * Create your custom renderer using `RendererFactory2`.
16851
16884
  *
16852
16885
  * Use a custom renderer to bypass Angular's templating and
@@ -17911,7 +17944,7 @@ class ComponentFactory extends ComponentFactory$1 {
17911
17944
  const cmpDef = this.componentDef;
17912
17945
  ngDevMode && verifyNotAnOrphanComponent(cmpDef);
17913
17946
  const tAttributes = rootSelectorOrNode
17914
- ? ['ng-version', '19.2.7']
17947
+ ? ['ng-version', '19.2.9']
17915
17948
  : // Extract attributes and classes from the first selector only to match VE behavior.
17916
17949
  extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
17917
17950
  // Create the root view. Uses empty TView and ContentTemplate.
@@ -30106,15 +30139,12 @@ function isOutputSubscribable(value) {
30106
30139
  return (value != null && typeof value.subscribe === 'function');
30107
30140
  }
30108
30141
 
30109
- /**
30110
- * Contains a reference to a function that disables event replay feature
30111
- * for server-side rendered applications. This function is overridden with
30112
- * an actual implementation when the event replay feature is enabled via
30113
- * `withEventReplay()` call.
30114
- */
30115
- let stashEventListener = (el, eventName, listenerFn) => { };
30116
- function setStashFn(fn) {
30117
- 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);
30118
30148
  }
30119
30149
  /**
30120
30150
  * Adds an event listener to the current node.
@@ -30253,7 +30283,9 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
30253
30283
  }
30254
30284
  else {
30255
30285
  listenerFn = wrapListener(tNode, lView, listenerFn);
30256
- stashEventListener(target, eventName, listenerFn);
30286
+ const appId = lView[INJECTOR].get(APP_ID);
30287
+ const stashEventListener = stashEventListeners.get(appId);
30288
+ stashEventListener?.(target, eventName, listenerFn);
30257
30289
  const cleanupFn = renderer.listen(target, eventName, listenerFn);
30258
30290
  ngDevMode && ngDevMode.rendererAddEventListener++;
30259
30291
  lCleanup.push(listenerFn, cleanupFn);
@@ -34651,7 +34683,7 @@ class Version {
34651
34683
  /**
34652
34684
  * @publicApi
34653
34685
  */
34654
- const VERSION = new Version('19.2.7');
34686
+ const VERSION = new Version('19.2.9');
34655
34687
 
34656
34688
  /**
34657
34689
  * Combination of NgModuleFactory and ComponentFactories.
@@ -38154,7 +38186,8 @@ function withEventReplay() {
38154
38186
  if (!appsWithEventReplay.has(appRef)) {
38155
38187
  const jsActionMap = inject(JSACTION_BLOCK_ELEMENT_MAP);
38156
38188
  if (shouldEnableEventReplay(injector)) {
38157
- setStashFn((rEl, eventName, listenerFn) => {
38189
+ const appId = injector.get(APP_ID);
38190
+ setStashFn(appId, (rEl, eventName, listenerFn) => {
38158
38191
  // If a user binds to a ng-container and uses a directive that binds using a host listener,
38159
38192
  // this element could be a comment node. So we need to ensure we have an actual element
38160
38193
  // node before stashing anything.
@@ -38170,7 +38203,6 @@ function withEventReplay() {
38170
38203
  }, {
38171
38204
  provide: APP_BOOTSTRAP_LISTENER,
38172
38205
  useFactory: () => {
38173
- const appId = inject(APP_ID);
38174
38206
  const appRef = inject(ApplicationRef);
38175
38207
  const { injector } = appRef;
38176
38208
  return () => {
@@ -38185,6 +38217,7 @@ function withEventReplay() {
38185
38217
  appsWithEventReplay.delete(appRef);
38186
38218
  // Ensure that we're always safe calling this in the browser.
38187
38219
  if (typeof ngServerMode !== 'undefined' && !ngServerMode) {
38220
+ const appId = injector.get(APP_ID);
38188
38221
  // `_ejsa` should be deleted when the app is destroyed, ensuring that
38189
38222
  // no elements are still captured in the global list and are not prevented
38190
38223
  // from being garbage collected.
@@ -38192,7 +38225,7 @@ function withEventReplay() {
38192
38225
  // Clean up the reference to the function set by the environment initializer,
38193
38226
  // as the function closure may capture injected elements and prevent them
38194
38227
  // from being properly garbage collected.
38195
- setStashFn(() => { });
38228
+ clearStashFn(appId);
38196
38229
  }
38197
38230
  });
38198
38231
  // Kick off event replay logic once hydration for the initial part
@@ -39585,14 +39618,6 @@ function effect(effectFn, options) {
39585
39618
  }
39586
39619
  return effectRef;
39587
39620
  }
39588
- /**
39589
- * Not public API, which guarantees `EffectScheduler` only ever comes from the application root
39590
- * injector.
39591
- */
39592
- /* @__PURE__ */ new InjectionToken('', {
39593
- providedIn: 'root',
39594
- factory: () => inject(EffectScheduler),
39595
- });
39596
39621
  const BASE_EFFECT_NODE =
39597
39622
  /* @__PURE__ */ (() => ({
39598
39623
  ...REACTIVE_NODE,
@@ -40196,8 +40221,8 @@ function ɵɵngDeclarePipe(decl) {
40196
40221
  return compiler.compilePipeDeclaration(angularCoreEnv, `ng:///${decl.type.name}/ɵpipe.js`, decl);
40197
40222
  }
40198
40223
 
40199
- const NOT_SET = Symbol('NOT_SET');
40200
- const EMPTY_CLEANUP_SET = new Set();
40224
+ const NOT_SET = /* @__PURE__ */ Symbol('NOT_SET');
40225
+ const EMPTY_CLEANUP_SET = /* @__PURE__ */ new Set();
40201
40226
  const AFTER_RENDER_PHASE_EFFECT_NODE = /* @__PURE__ */ (() => ({
40202
40227
  ...SIGNAL_NODE,
40203
40228
  consumerIsAlwaysLive: true,