@angular/core 19.1.0-next.4 → 19.1.0

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 (40) hide show
  1. package/LICENSE +1 -1
  2. package/fesm2022/core.mjs +85 -91
  3. package/fesm2022/core.mjs.map +1 -1
  4. package/fesm2022/primitives/event-dispatch.mjs +1 -24
  5. package/fesm2022/primitives/event-dispatch.mjs.map +1 -1
  6. package/fesm2022/primitives/signals.mjs +1 -1
  7. package/fesm2022/rxjs-interop.mjs +1 -1
  8. package/fesm2022/rxjs-interop.mjs.map +1 -1
  9. package/fesm2022/testing.mjs +4 -4
  10. package/index.d.ts +41 -36
  11. package/package.json +1 -1
  12. package/primitives/event-dispatch/index.d.ts +1 -1
  13. package/primitives/signals/index.d.ts +1 -1
  14. package/rxjs-interop/index.d.ts +1 -1
  15. package/schematics/bundles/apply_import_manager-5082ccea.js +732 -0
  16. package/schematics/bundles/{checker-884633eb.js → checker-aa999c96.js} +50 -25
  17. package/schematics/bundles/cleanup-unused-imports.js +295 -0
  18. package/schematics/bundles/{compiler_host-22f6513d.js → compiler_host-f0b570c8.js} +2 -2
  19. package/schematics/bundles/control-flow-migration.js +3 -3
  20. package/schematics/bundles/explicit-standalone-flag.js +5 -5
  21. package/schematics/bundles/{imports-abe29092.js → imports-31a38653.js} +1 -1
  22. package/schematics/bundles/index-02a11f43.js +30 -0
  23. package/schematics/bundles/{combine_units-4a95b1b9.js → index-15b61bae.js} +10 -723
  24. package/schematics/bundles/inject-migration.js +6 -6
  25. package/schematics/bundles/{leading_space-d190b83b.js → leading_space-6e7a8ec6.js} +1 -1
  26. package/schematics/bundles/{migrate_ts_type_references-4b11f3f2.js → migrate_ts_type_references-042ca765.js} +30 -29
  27. package/schematics/bundles/{nodes-a9f0b985.js → nodes-88c2157f.js} +2 -2
  28. package/schematics/bundles/output-migration.js +27 -26
  29. package/schematics/bundles/pending-tasks.js +5 -5
  30. package/schematics/bundles/{program-094352ba.js → program-393ca8f3.js} +106 -46
  31. package/schematics/bundles/{project_tsconfig_paths-e9ccccbf.js → project_tsconfig_paths-6c9cde78.js} +1 -1
  32. package/schematics/bundles/provide-initializer.js +5 -5
  33. package/schematics/bundles/route-lazy-loading.js +4 -4
  34. package/schematics/bundles/signal-input-migration.js +33 -32
  35. package/schematics/bundles/signal-queries-migration.js +56 -49
  36. package/schematics/bundles/signals.js +8 -7
  37. package/schematics/bundles/standalone-migration.js +12 -28
  38. package/schematics/collection.json +5 -0
  39. package/schematics/ng-generate/cleanup-unused-imports/schema.json +7 -0
  40. package/testing/index.d.ts +1 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2010-2024 Google LLC. https://angular.dev/license
3
+ Copyright (c) 2010-2025 Google LLC. https://angular.dev/license
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/fesm2022/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.1.0-next.4
2
+ * @license Angular v19.1.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1715,8 +1715,7 @@ function getPipeDef$1(type) {
1715
1715
  */
1716
1716
  function isStandalone(type) {
1717
1717
  const def = getComponentDef(type) || getDirectiveDef(type) || getPipeDef$1(type);
1718
- // TODO: standalone as default value (invert the condition)
1719
- return def !== null ? def.standalone : false;
1718
+ return def !== null && def.standalone;
1720
1719
  }
1721
1720
 
1722
1721
  /**
@@ -2936,18 +2935,6 @@ const MOVED_VIEWS = 9;
2936
2935
  * remove views from the DOM when they are no longer required.
2937
2936
  */
2938
2937
  const CONTAINER_HEADER_OFFSET = 10;
2939
- /** Flags associated with an LContainer (saved in LContainer[FLAGS]) */
2940
- var LContainerFlags;
2941
- (function (LContainerFlags) {
2942
- LContainerFlags[LContainerFlags["None"] = 0] = "None";
2943
- /**
2944
- * Flag to signify that this `LContainer` may have transplanted views which need to be change
2945
- * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.
2946
- *
2947
- * This flag, once set, is never unset for the `LContainer`.
2948
- */
2949
- LContainerFlags[LContainerFlags["HasTransplantedViews"] = 2] = "HasTransplantedViews";
2950
- })(LContainerFlags || (LContainerFlags = {}));
2951
2938
 
2952
2939
  /**
2953
2940
  * True if `value` is `LView`.
@@ -2985,6 +2972,7 @@ function hasI18n(lView) {
2985
2972
  return (lView[FLAGS] & 32 /* LViewFlags.HasI18n */) === 32 /* LViewFlags.HasI18n */;
2986
2973
  }
2987
2974
  function isDestroyed(lView) {
2975
+ // Determines whether a given LView is marked as destroyed.
2988
2976
  return (lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */;
2989
2977
  }
2990
2978
 
@@ -3465,7 +3453,7 @@ function markAncestorsForTraversal(lView) {
3465
3453
  * Stores a LView-specific destroy callback.
3466
3454
  */
3467
3455
  function storeLViewOnDestroy(lView, onDestroyCallback) {
3468
- if ((lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */) {
3456
+ if (isDestroyed(lView)) {
3469
3457
  throw new RuntimeError(911 /* RuntimeErrorCode.VIEW_ALREADY_DESTROYED */, ngDevMode && 'View has already been destroyed.');
3470
3458
  }
3471
3459
  if (lView[ON_DESTROY_HOOKS] === null) {
@@ -4410,7 +4398,7 @@ class NodeInjectorFactory {
4410
4398
  * Example:
4411
4399
  *
4412
4400
  * If we have a component and directive active an a single element as declared here
4413
- * ```
4401
+ * ```ts
4414
4402
  * component:
4415
4403
  * providers: [ {provide: String, useValue: 'component', multi: true} ],
4416
4404
  * viewProviders: [ {provide: String, useValue: 'componentView', multi: true} ],
@@ -4421,7 +4409,7 @@ class NodeInjectorFactory {
4421
4409
  *
4422
4410
  * Then the expected results are:
4423
4411
  *
4424
- * ```
4412
+ * ```ts
4425
4413
  * providers: ['component', 'directive']
4426
4414
  * viewProviders: ['component', 'componentView', 'directive']
4427
4415
  * ```
@@ -4444,7 +4432,7 @@ class NodeInjectorFactory {
4444
4432
  * Example:
4445
4433
  *
4446
4434
  * Given:
4447
- * ```
4435
+ * ```ts
4448
4436
  * providers: [ {provide: String, useValue: 'all', multi: true} ],
4449
4437
  * viewProviders: [ {provide: String, useValue: 'viewOnly', multi: true} ],
4450
4438
  * ```
@@ -6146,7 +6134,7 @@ class PendingTasks {
6146
6134
  /**
6147
6135
  * Runs an asynchronous function and blocks the application's stability until the function completes.
6148
6136
  *
6149
- * ```
6137
+ * ```ts
6150
6138
  * pendingTasks.run(async () => {
6151
6139
  * const userData = await fetch('/api/user');
6152
6140
  * this.userData.set(userData);
@@ -6156,7 +6144,7 @@ class PendingTasks {
6156
6144
  * Application stability is at least delayed until the next tick after the `run` method resolves
6157
6145
  * so it is safe to make additional updates to application state that would require UI synchronization:
6158
6146
  *
6159
- * ```
6147
+ * ```ts
6160
6148
  * const userData = await pendingTasks.run(() => fetch('/api/user'));
6161
6149
  * this.userData.set(userData);
6162
6150
  * ```
@@ -6181,7 +6169,8 @@ class PendingTasks {
6181
6169
  }
6182
6170
 
6183
6171
  class EventEmitter_ extends Subject {
6184
- __isAsync; // tslint:disable-line
6172
+ // tslint:disable-next-line:require-internal-with-underscore
6173
+ __isAsync;
6185
6174
  destroyRef = undefined;
6186
6175
  pendingTasks = undefined;
6187
6176
  constructor(isAsync = false) {
@@ -8474,15 +8463,8 @@ function retrieveTransferredState(doc, appId) {
8474
8463
  const REFERENCE_NODE_HOST = 'h';
8475
8464
  /** Encodes that the node lookup should start from the document body node. */
8476
8465
  const REFERENCE_NODE_BODY = 'b';
8477
- /**
8478
- * Describes navigation steps that the runtime logic need to perform,
8479
- * starting from a given (known) element.
8480
- */
8481
- var NodeNavigationStep;
8482
- (function (NodeNavigationStep) {
8483
- NodeNavigationStep["FirstChild"] = "f";
8484
- NodeNavigationStep["NextSibling"] = "n";
8485
- })(NodeNavigationStep || (NodeNavigationStep = {}));
8466
+ const NODE_NAVIGATION_STEP_FIRST_CHILD = 'f';
8467
+ const NODE_NAVIGATION_STEP_NEXT_SIBLING = 'n';
8486
8468
  /**
8487
8469
  * Keys within serialized view data structure to represent various
8488
8470
  * parts. See the `SerializedView` interface below for additional information.
@@ -11784,7 +11766,7 @@ function trackMovedView(declarationContainer, lView) {
11784
11766
  const parent = lView[PARENT];
11785
11767
  ngDevMode && assertDefined(parent, 'missing parent');
11786
11768
  if (isLView(parent)) {
11787
- declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;
11769
+ declarationContainer[FLAGS] |= 2 /* LContainerFlags.HasTransplantedViews */;
11788
11770
  }
11789
11771
  else {
11790
11772
  const insertedComponentLView = parent[PARENT][DECLARATION_COMPONENT_VIEW];
@@ -11795,7 +11777,7 @@ function trackMovedView(declarationContainer, lView) {
11795
11777
  // At this point the declaration-component is not same as insertion-component; this means that
11796
11778
  // this is a transplanted view. Mark the declared lView as having transplanted views so that
11797
11779
  // those views can participate in CD.
11798
- declarationContainer[FLAGS] |= LContainerFlags.HasTransplantedViews;
11780
+ declarationContainer[FLAGS] |= 2 /* LContainerFlags.HasTransplantedViews */;
11799
11781
  }
11800
11782
  }
11801
11783
  if (movedViews === null) {
@@ -11858,13 +11840,14 @@ function detachView(lContainer, removeIndex) {
11858
11840
  * @param lView The view to be destroyed.
11859
11841
  */
11860
11842
  function destroyLView(tView, lView) {
11861
- if (!(lView[FLAGS] & 256 /* LViewFlags.Destroyed */)) {
11862
- const renderer = lView[RENDERER];
11863
- if (renderer.destroyNode) {
11864
- applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
11865
- }
11866
- destroyViewTree(lView);
11843
+ if (isDestroyed(lView)) {
11844
+ return;
11845
+ }
11846
+ const renderer = lView[RENDERER];
11847
+ if (renderer.destroyNode) {
11848
+ applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
11867
11849
  }
11850
+ destroyViewTree(lView);
11868
11851
  }
11869
11852
  /**
11870
11853
  * Calls onDestroys hooks for all directives and pipes in a given view and then removes all
@@ -11875,7 +11858,7 @@ function destroyLView(tView, lView) {
11875
11858
  * @param lView The LView to clean up
11876
11859
  */
11877
11860
  function cleanUpView(tView, lView) {
11878
- if (lView[FLAGS] & 256 /* LViewFlags.Destroyed */) {
11861
+ if (isDestroyed(lView)) {
11879
11862
  return;
11880
11863
  }
11881
11864
  const prevConsumer = setActiveConsumer$1(null);
@@ -14861,9 +14844,9 @@ function checkNoChangesInternal(lView, mode, notifyErrorHandler = true) {
14861
14844
  */
14862
14845
  function refreshView(tView, lView, templateFn, context) {
14863
14846
  ngDevMode && assertEqual(isCreationMode(lView), false, 'Should be run in update mode');
14864
- const flags = lView[FLAGS];
14865
- if ((flags & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */)
14847
+ if (isDestroyed(lView))
14866
14848
  return;
14849
+ const flags = lView[FLAGS];
14867
14850
  // Check no changes mode is a dev only mode used to verify that bindings have not changed
14868
14851
  // since they were assigned. We do not want to execute lifecycle hooks in that mode.
14869
14852
  const isInCheckNoChangesPass = ngDevMode && isInCheckNoChangesMode();
@@ -15047,7 +15030,7 @@ function detectChangesInEmbeddedViews(lView, mode) {
15047
15030
  */
15048
15031
  function markTransplantedViewsForRefresh(lView) {
15049
15032
  for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) {
15050
- if (!(lContainer[FLAGS] & LContainerFlags.HasTransplantedViews))
15033
+ if (!(lContainer[FLAGS] & 2 /* LContainerFlags.HasTransplantedViews */))
15051
15034
  continue;
15052
15035
  const movedViews = lContainer[MOVED_VIEWS];
15053
15036
  ngDevMode && assertDefined(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS');
@@ -15229,7 +15212,7 @@ class ViewRef$1 {
15229
15212
  this._lView[CONTEXT] = value;
15230
15213
  }
15231
15214
  get destroyed() {
15232
- return (this._lView[FLAGS] & 256 /* LViewFlags.Destroyed */) === 256 /* LViewFlags.Destroyed */;
15215
+ return isDestroyed(this._lView);
15233
15216
  }
15234
15217
  destroy() {
15235
15218
  if (this._appRef) {
@@ -16228,7 +16211,7 @@ function loadIcuContainerVisitor() {
16228
16211
  * to determine which root belong to the ICU.
16229
16212
  *
16230
16213
  * Example of usage.
16231
- * ```
16214
+ * ```ts
16232
16215
  * const nextRNode = icuContainerIteratorStart(tIcuContainerNode, lView);
16233
16216
  * let rNode: RNode|null;
16234
16217
  * while(rNode = nextRNode()) {
@@ -16459,7 +16442,7 @@ function stringifyNavigationInstructions(instructions) {
16459
16442
  const step = instructions[i];
16460
16443
  const repeat = instructions[i + 1];
16461
16444
  for (let r = 0; r < repeat; r++) {
16462
- container.push(step === NodeNavigationStep.FirstChild ? 'firstChild' : 'nextSibling');
16445
+ container.push(step === NODE_NAVIGATION_STEP_FIRST_CHILD ? 'firstChild' : 'nextSibling');
16463
16446
  }
16464
16447
  }
16465
16448
  return container.join('.');
@@ -16478,10 +16461,10 @@ function navigateToNode(from, instructions) {
16478
16461
  throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions));
16479
16462
  }
16480
16463
  switch (step) {
16481
- case NodeNavigationStep.FirstChild:
16464
+ case NODE_NAVIGATION_STEP_FIRST_CHILD:
16482
16465
  node = node.firstChild;
16483
16466
  break;
16484
- case NodeNavigationStep.NextSibling:
16467
+ case NODE_NAVIGATION_STEP_NEXT_SIBLING:
16485
16468
  node = node.nextSibling;
16486
16469
  break;
16487
16470
  }
@@ -16539,7 +16522,7 @@ function navigateBetween(start, finish) {
16539
16522
  // First navigate to `finish`'s parent
16540
16523
  ...parentPath,
16541
16524
  // Then to its first child.
16542
- NodeNavigationStep.FirstChild,
16525
+ NODE_NAVIGATION_STEP_FIRST_CHILD,
16543
16526
  // And finally from that node to `finish` (maybe a no-op if we're already there).
16544
16527
  ...childPath,
16545
16528
  ];
@@ -16553,7 +16536,7 @@ function navigateBetweenSiblings(start, finish) {
16553
16536
  const nav = [];
16554
16537
  let node = null;
16555
16538
  for (node = start; node != null && node !== finish; node = node.nextSibling) {
16556
- nav.push(NodeNavigationStep.NextSibling);
16539
+ nav.push(NODE_NAVIGATION_STEP_NEXT_SIBLING);
16557
16540
  }
16558
16541
  // If the `node` becomes `null` or `undefined` at the end, that means that we
16559
16542
  // didn't find the `end` node, thus return `null` (which would trigger serialization
@@ -18110,7 +18093,7 @@ function createRootComponent(componentView, rootComponentDef, rootDirectives, ho
18110
18093
  function setRootNodeAttributes(hostRenderer, componentDef, hostRNode, rootSelectorOrNode) {
18111
18094
  if (rootSelectorOrNode) {
18112
18095
  // The placeholder will be replaced with the actual version at build time.
18113
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', '19.1.0-next.4']);
18096
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', '19.1.0']);
18114
18097
  }
18115
18098
  else {
18116
18099
  // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
@@ -19709,7 +19692,6 @@ class NgModuleRef extends NgModuleRef$1 {
19709
19692
  _parent;
19710
19693
  // tslint:disable-next-line:require-internal-with-underscore
19711
19694
  _bootstrapComponents = [];
19712
- // tslint:disable-next-line:require-internal-with-underscore
19713
19695
  _r3Injector;
19714
19696
  instance;
19715
19697
  destroyCbs = [];
@@ -21197,7 +21179,8 @@ class CachedInjectorService {
21197
21179
  *
21198
21180
  * This token is only injected in devMode
21199
21181
  */
21200
- const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = new InjectionToken('DEFER_BLOCK_DEPENDENCY_INTERCEPTOR');
21182
+ const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR =
21183
+ /* @__PURE__ */ new InjectionToken('DEFER_BLOCK_DEPENDENCY_INTERCEPTOR');
21201
21184
  /**
21202
21185
  * **INTERNAL**, token used for configuring defer block behavior.
21203
21186
  */
@@ -21589,7 +21572,6 @@ class Console {
21589
21572
  }
21590
21573
  // Note: for reporting errors use `DOM.logError()` as it is platform specific
21591
21574
  warn(message) {
21592
- // tslint:disable-next-line:no-console
21593
21575
  console.warn(message);
21594
21576
  }
21595
21577
  static ɵfac = function Console_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Console)(); };
@@ -23311,6 +23293,15 @@ class ZoneAwareEffectScheduler {
23311
23293
  schedule(handle) {
23312
23294
  this.enqueue(handle);
23313
23295
  }
23296
+ remove(handle) {
23297
+ const zone = handle.zone;
23298
+ const queue = this.queues.get(zone);
23299
+ if (!queue.has(handle)) {
23300
+ return;
23301
+ }
23302
+ queue.delete(handle);
23303
+ this.queuedEffectCount--;
23304
+ }
23314
23305
  enqueue(handle) {
23315
23306
  const zone = handle.zone;
23316
23307
  if (!this.queues.has(zone)) {
@@ -23639,7 +23630,7 @@ class ApplicationRef {
23639
23630
  * {@example core/ts/platform/platform.ts region='domNode'}
23640
23631
  */
23641
23632
  bootstrap(componentOrFactory, rootSelectorOrNode) {
23642
- (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
23633
+ (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);
23643
23634
  const isComponentFactory = componentOrFactory instanceof ComponentFactory$1;
23644
23635
  const initStatus = this._injector.get(ApplicationInitStatus);
23645
23636
  if (!initStatus.done) {
@@ -23709,7 +23700,7 @@ class ApplicationRef {
23709
23700
  snapshot.dispose();
23710
23701
  return;
23711
23702
  }
23712
- (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
23703
+ (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);
23713
23704
  if (this._runningTick) {
23714
23705
  throw new RuntimeError(101 /* RuntimeErrorCode.RECURSIVE_APPLICATION_REF_TICK */, ngDevMode && 'ApplicationRef.tick is called recursively');
23715
23706
  }
@@ -23840,7 +23831,7 @@ class ApplicationRef {
23840
23831
  * This will throw if the view is already attached to a ViewContainer.
23841
23832
  */
23842
23833
  attachView(viewRef) {
23843
- (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
23834
+ (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);
23844
23835
  const view = viewRef;
23845
23836
  this._views.push(view);
23846
23837
  view.attachToAppRef(this);
@@ -23849,7 +23840,7 @@ class ApplicationRef {
23849
23840
  * Detaches a view from dirty checking again.
23850
23841
  */
23851
23842
  detachView(viewRef) {
23852
- (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
23843
+ (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);
23853
23844
  const view = viewRef;
23854
23845
  remove(this._views, view);
23855
23846
  view.detachFromAppRef();
@@ -23893,7 +23884,7 @@ class ApplicationRef {
23893
23884
  * @returns A function which unregisters a listener.
23894
23885
  */
23895
23886
  onDestroy(callback) {
23896
- (typeof ngDevMode === 'undefined' || ngDevMode) && this.warnIfDestroyed();
23887
+ (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed);
23897
23888
  this._destroyListeners.push(callback);
23898
23889
  return () => remove(this._destroyListeners, callback);
23899
23890
  }
@@ -23920,11 +23911,6 @@ class ApplicationRef {
23920
23911
  get viewCount() {
23921
23912
  return this._views.length;
23922
23913
  }
23923
- warnIfDestroyed() {
23924
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._destroyed) {
23925
- console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
23926
- }
23927
- }
23928
23914
  static ɵfac = function ApplicationRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApplicationRef)(); };
23929
23915
  static ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
23930
23916
  }
@@ -23932,6 +23918,11 @@ class ApplicationRef {
23932
23918
  type: Injectable,
23933
23919
  args: [{ providedIn: 'root' }]
23934
23920
  }], () => [], null); })();
23921
+ function warnIfDestroyed(destroyed) {
23922
+ if (destroyed) {
23923
+ console.warn(formatRuntimeError(406 /* RuntimeErrorCode.APPLICATION_REF_ALREADY_DESTROYED */, 'This instance of the `ApplicationRef` has already been destroyed.'));
23924
+ }
23925
+ }
23935
23926
  function remove(list, el) {
23936
23927
  const index = list.indexOf(el);
23937
23928
  if (index > -1) {
@@ -24092,7 +24083,7 @@ function triggerResourceLoading(tDetails, lView, tNode) {
24092
24083
  tDetails.loadingState = DeferDependenciesLoadingState.FAILED;
24093
24084
  if (tDetails.errorTmplIndex === null) {
24094
24085
  const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : '';
24095
- const error = new RuntimeError(750 /* RuntimeErrorCode.DEFER_LOADING_FAILED */, ngDevMode &&
24086
+ const error = new RuntimeError(-750 /* RuntimeErrorCode.DEFER_LOADING_FAILED */, ngDevMode &&
24096
24087
  'Loading dependencies for `@defer` block failed, ' +
24097
24088
  `but no \`@error\` block was configured${templateLocation}. ` +
24098
24089
  'Consider using the `@error` block to render an error state.');
@@ -27677,7 +27668,6 @@ function reconcile(liveCollection, newCollection, trackByFn) {
27677
27668
  'Duplicated keys were: \n' +
27678
27669
  duplicatedKeysMsg.join(', \n') +
27679
27670
  '.');
27680
- // tslint:disable-next-line:no-console
27681
27671
  console.warn(message);
27682
27672
  }
27683
27673
  }
@@ -28505,10 +28495,8 @@ if (typeof ngI18nClosureMode === 'undefined') {
28505
28495
  // Make sure to refer to ngI18nClosureMode as ['ngI18nClosureMode'] for closure.
28506
28496
  // NOTE: we need to have it in IIFE so that the tree-shaker is happy.
28507
28497
  (function () {
28508
- // tslint:disable-next-line:no-toplevel-property-access
28509
28498
  _global['ngI18nClosureMode'] =
28510
28499
  // TODO(FW-1250): validate that this actually, you know, works.
28511
- // tslint:disable-next-line:no-toplevel-property-access
28512
28500
  typeof goog !== 'undefined' && typeof goog.getMsg === 'function';
28513
28501
  })();
28514
28502
  }
@@ -33474,29 +33462,29 @@ function ɵɵreplaceMetadata(type, applyMetadata, namespaces, locals) {
33474
33462
  }
33475
33463
  /**
33476
33464
  * Finds all LViews matching a specific component definition and recreates them.
33477
- * @param def Component definition to search for.
33465
+ * @param oldDef Component definition to search for.
33478
33466
  * @param rootLView View from which to start the search.
33479
33467
  */
33480
- function recreateMatchingLViews(def, rootLView) {
33468
+ function recreateMatchingLViews(oldDef, rootLView) {
33481
33469
  ngDevMode &&
33482
- assertDefined(def.tView, 'Expected a component definition that has been instantiated at least once');
33470
+ assertDefined(oldDef.tView, 'Expected a component definition that has been instantiated at least once');
33483
33471
  const tView = rootLView[TVIEW];
33484
33472
  // Use `tView` to match the LView since `instanceof` can
33485
33473
  // produce false positives when using inheritance.
33486
- if (tView === def.tView) {
33487
- ngDevMode && assertComponentDef(def.type);
33488
- recreateLView(getComponentDef(def.type), rootLView);
33474
+ if (tView === oldDef.tView) {
33475
+ ngDevMode && assertComponentDef(oldDef.type);
33476
+ recreateLView(getComponentDef(oldDef.type), oldDef, rootLView);
33489
33477
  return;
33490
33478
  }
33491
33479
  for (let i = HEADER_OFFSET; i < tView.bindingStartIndex; i++) {
33492
33480
  const current = rootLView[i];
33493
33481
  if (isLContainer(current)) {
33494
33482
  for (let i = CONTAINER_HEADER_OFFSET; i < current.length; i++) {
33495
- recreateMatchingLViews(def, current[i]);
33483
+ recreateMatchingLViews(oldDef, current[i]);
33496
33484
  }
33497
33485
  }
33498
33486
  else if (isLView(current)) {
33499
- recreateMatchingLViews(def, current);
33487
+ recreateMatchingLViews(oldDef, current);
33500
33488
  }
33501
33489
  }
33502
33490
  }
@@ -33509,15 +33497,17 @@ function recreateMatchingLViews(def, rootLView) {
33509
33497
  */
33510
33498
  function clearRendererCache(factory, def) {
33511
33499
  // Cast to read a private field.
33512
- // NOTE: This must be kept synchronized with the renderer factory implementation in platform-browser.
33513
- factory.rendererByCompId?.delete(def.id);
33500
+ // NOTE: This must be kept synchronized with the renderer factory implementation in
33501
+ // platform-browser and platform-browser/animations.
33502
+ factory.componentReplaced?.(def.id);
33514
33503
  }
33515
33504
  /**
33516
33505
  * Recreates an LView in-place from a new component definition.
33517
- * @param def Definition from which to recreate the view.
33506
+ * @param newDef Definition from which to recreate the view.
33507
+ * @param oldDef Previous component definition being swapped out.
33518
33508
  * @param lView View to be recreated.
33519
33509
  */
33520
- function recreateLView(def, lView) {
33510
+ function recreateLView(newDef, oldDef, lView) {
33521
33511
  const instance = lView[CONTEXT];
33522
33512
  const host = lView[HOST];
33523
33513
  // In theory the parent can also be an LContainer, but it appears like that's
@@ -33526,14 +33516,15 @@ function recreateLView(def, lView) {
33526
33516
  ngDevMode && assertLView(parentLView);
33527
33517
  const tNode = lView[T_HOST];
33528
33518
  ngDevMode && assertTNodeType(tNode, 2 /* TNodeType.Element */);
33519
+ ngDevMode && assertNotEqual(newDef, oldDef, 'Expected different component definition');
33529
33520
  // Recreate the TView since the template might've changed.
33530
- const newTView = getOrCreateComponentTView(def);
33521
+ const newTView = getOrCreateComponentTView(newDef);
33531
33522
  // Always force the creation of a new renderer to ensure state captured during construction
33532
33523
  // stays consistent with the new component definition by clearing any old cached factories.
33533
33524
  const rendererFactory = lView[ENVIRONMENT].rendererFactory;
33534
- clearRendererCache(rendererFactory, def);
33525
+ clearRendererCache(rendererFactory, oldDef);
33535
33526
  // Create a new LView from the new TView, but reusing the existing TNode and DOM node.
33536
- const newLView = createLView(parentLView, newTView, instance, getInitialLViewFlagsFromDef(def), host, tNode, null, rendererFactory.createRenderer(host, def), null, null, null);
33527
+ const newLView = createLView(parentLView, newTView, instance, getInitialLViewFlagsFromDef(newDef), host, tNode, null, rendererFactory.createRenderer(host, newDef), null, null, null);
33537
33528
  // Detach the LView from its current place in the tree so we don't
33538
33529
  // start traversing any siblings and modifying their structure.
33539
33530
  replaceLViewInTree(parentLView, lView, newLView, tNode.index);
@@ -34976,7 +34967,7 @@ class Version {
34976
34967
  /**
34977
34968
  * @publicApi
34978
34969
  */
34979
- const VERSION = new Version('19.1.0-next.4');
34970
+ const VERSION = new Version('19.1.0');
34980
34971
 
34981
34972
  /**
34982
34973
  * Combination of NgModuleFactory and ComponentFactories.
@@ -38249,7 +38240,7 @@ class IterableDiffers {
38249
38240
  * which will only be applied to the injector for this component and its children.
38250
38241
  * This step is all that's required to make a new {@link IterableDiffer} available.
38251
38242
  *
38252
- * ```
38243
+ * ```ts
38253
38244
  * @Component({
38254
38245
  * viewProviders: [
38255
38246
  * IterableDiffers.extend([new ImmutableListDiffer()])
@@ -38323,7 +38314,7 @@ class KeyValueDiffers {
38323
38314
  * which will only be applied to the injector for this component and its children.
38324
38315
  * This step is all that's required to make a new {@link KeyValueDiffer} available.
38325
38316
  *
38326
- * ```
38317
+ * ```ts
38327
38318
  * @Component({
38328
38319
  * viewProviders: [
38329
38320
  * KeyValueDiffers.extend([new ImmutableMapDiffer()])
@@ -39445,7 +39436,6 @@ function serializeLContainer(lContainer, tNode, lView, parentDeferBlockId, conte
39445
39436
  collectNativeNodesInLContainer(lContainer, rootNodes);
39446
39437
  // Add defer block into info context.deferBlocks
39447
39438
  const deferBlockInfo = {
39448
- [DEFER_PARENT_BLOCK_ID]: parentDeferBlockId,
39449
39439
  [NUM_ROOT_NODES]: rootNodes.length,
39450
39440
  [DEFER_BLOCK_STATE$1]: lDetails[DEFER_BLOCK_STATE],
39451
39441
  };
@@ -39453,6 +39443,10 @@ function serializeLContainer(lContainer, tNode, lView, parentDeferBlockId, conte
39453
39443
  if (serializedTriggers.length > 0) {
39454
39444
  deferBlockInfo[DEFER_HYDRATE_TRIGGERS] = serializedTriggers;
39455
39445
  }
39446
+ if (parentDeferBlockId !== null) {
39447
+ // Serialize parent id only when it's present.
39448
+ deferBlockInfo[DEFER_PARENT_BLOCK_ID] = parentDeferBlockId;
39449
+ }
39456
39450
  context.deferBlocks.set(deferBlockId, deferBlockInfo);
39457
39451
  const node = unwrapRNode(lContainer);
39458
39452
  if (node !== undefined) {
@@ -40027,7 +40021,6 @@ function withDomHydration() {
40027
40021
  'thus hydration was not enabled. ' +
40028
40022
  'Make sure the `provideClientHydration()` is included into the list ' +
40029
40023
  'of providers in the server part of the application configuration.');
40030
- // tslint:disable-next-line:no-console
40031
40024
  console.warn(message);
40032
40025
  }
40033
40026
  },
@@ -40888,6 +40881,7 @@ const ROOT_EFFECT_NODE =
40888
40881
  consumerDestroy$1(this);
40889
40882
  this.onDestroyFn();
40890
40883
  this.maybeCleanup();
40884
+ this.scheduler.remove(this);
40891
40885
  },
40892
40886
  }))();
40893
40887
  const VIEW_EFFECT_NODE =
@@ -41492,7 +41486,7 @@ function mergeApplicationConfig(...configs) {
41492
41486
  *
41493
41487
  * @developerPreview
41494
41488
  */
41495
- const REQUEST = new InjectionToken('REQUEST', {
41489
+ const REQUEST = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'REQUEST' : '', {
41496
41490
  providedIn: 'platform',
41497
41491
  factory: () => null,
41498
41492
  });
@@ -41514,7 +41508,7 @@ const REQUEST = new InjectionToken('REQUEST', {
41514
41508
  *
41515
41509
  * @developerPreview
41516
41510
  */
41517
- const RESPONSE_INIT = new InjectionToken('RESPONSE_INIT', {
41511
+ const RESPONSE_INIT = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'RESPONSE_INIT' : '', {
41518
41512
  providedIn: 'platform',
41519
41513
  factory: () => null,
41520
41514
  });
@@ -41528,7 +41522,7 @@ const RESPONSE_INIT = new InjectionToken('RESPONSE_INIT', {
41528
41522
  *
41529
41523
  * @developerPreview
41530
41524
  */
41531
- const REQUEST_CONTEXT = new InjectionToken('REQUEST_CONTEXT', {
41525
+ const REQUEST_CONTEXT = new InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'REQUEST_CONTEXT' : '', {
41532
41526
  providedIn: 'platform',
41533
41527
  factory: () => null,
41534
41528
  });