@angular/core 18.2.6 → 18.2.8

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 (39) hide show
  1. package/LICENSE +21 -0
  2. package/esm2022/src/core_private_export.mjs +2 -3
  3. package/esm2022/src/core_reactivity_export_internal.mjs +2 -1
  4. package/esm2022/src/event_delegation_utils.mjs +2 -57
  5. package/esm2022/src/hydration/event_replay.mjs +3 -7
  6. package/esm2022/src/hydration/tokens.mjs +1 -5
  7. package/esm2022/src/image_performance_warning.mjs +25 -7
  8. package/esm2022/src/linker/view_ref.mjs +1 -1
  9. package/esm2022/src/platform/bootstrap.mjs +8 -4
  10. package/esm2022/src/platform/platform_ref.mjs +6 -2
  11. package/esm2022/src/render3/after_render/hooks.mjs +3 -2
  12. package/esm2022/src/render3/after_render/manager.mjs +6 -3
  13. package/esm2022/src/render3/component_ref.mjs +1 -1
  14. package/esm2022/src/render3/view_ref.mjs +1 -1
  15. package/esm2022/src/version.mjs +1 -1
  16. package/esm2022/testing/src/application_error_handler.mjs +3 -3
  17. package/esm2022/testing/src/component_fixture.mjs +1 -1
  18. package/esm2022/testing/src/logger.mjs +3 -3
  19. package/fesm2022/core.mjs +50 -111
  20. package/fesm2022/core.mjs.map +1 -1
  21. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  22. package/fesm2022/primitives/signals.mjs +1 -1
  23. package/fesm2022/rxjs-interop.mjs +1 -1
  24. package/fesm2022/testing.mjs +4 -4
  25. package/fesm2022/testing.mjs.map +1 -1
  26. package/index.d.ts +38 -63
  27. package/package.json +1 -1
  28. package/primitives/event-dispatch/index.d.ts +1 -1
  29. package/primitives/signals/index.d.ts +1 -1
  30. package/rxjs-interop/index.d.ts +1 -1
  31. package/schematics/migrations/after-render-phase/bundle.js +330 -288
  32. package/schematics/migrations/http-providers/bundle.js +333 -291
  33. package/schematics/migrations/invalid-two-way-bindings/bundle.js +224 -182
  34. package/schematics/ng-generate/control-flow-migration/bundle.js +333 -291
  35. package/schematics/ng-generate/inject-migration/bundle.js +344 -295
  36. package/schematics/ng-generate/route-lazy-loading/bundle.js +332 -290
  37. package/schematics/ng-generate/standalone-migration/bundle.js +523 -476
  38. package/testing/index.d.ts +3 -1
  39. package/esm2022/src/event_dispatch/event_delegation.mjs +0 -43
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.2.6
2
+ * @license Angular v18.2.8
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -10,12 +10,12 @@ import { EnvironmentProviders as EnvironmentProviders_2 } from '@angular/core';
10
10
  import { EventContract } from '@angular/core/primitives/event-dispatch';
11
11
  import { Observable } from 'rxjs';
12
12
  import { ReactiveNode } from '@angular/core/primitives/signals';
13
- import { SIGNAL } from '@angular/core/primitives/signals';
14
13
  import { SignalNode } from '@angular/core/primitives/signals';
15
14
  import { Subject } from 'rxjs';
16
15
  import { Subscribable } from 'rxjs';
17
16
  import { Subscription } from 'rxjs';
18
17
  import { ɵProfiler as ɵProfiler_2 } from '@angular/core';
18
+ import { SIGNAL as ɵSIGNAL } from '@angular/core/primitives/signals';
19
19
 
20
20
  /**
21
21
  * @description
@@ -405,6 +405,13 @@ export declare interface AfterRenderOptions {
405
405
  * If this is not provided, the current injection context will be used instead (via `inject`).
406
406
  */
407
407
  injector?: Injector;
408
+ /**
409
+ * Whether the hook should require manual cleanup.
410
+ *
411
+ * If this is `false` (the default) the hook will automatically register itself to be cleaned up
412
+ * with the current `DestroyRef`.
413
+ */
414
+ manualCleanup?: boolean;
408
415
  /**
409
416
  * The phase the callback should be invoked in.
410
417
  *
@@ -511,7 +518,7 @@ declare class AfterRenderSequence implements AfterRenderRef {
511
518
  */
512
519
  pipelinedValue: unknown;
513
520
  private unregisterOnDestroy;
514
- constructor(impl: AfterRenderImpl, hooks: AfterRenderHooks, once: boolean, destroyRef: DestroyRef);
521
+ constructor(impl: AfterRenderImpl, hooks: AfterRenderHooks, once: boolean, destroyRef: DestroyRef | null);
515
522
  afterRun(): void;
516
523
  destroy(): void;
517
524
  }
@@ -4598,21 +4605,6 @@ export declare interface GetTestability {
4598
4605
  * */
4599
4606
  declare const GLOBAL_PUBLISH_EXPANDO_KEY = "ng";
4600
4607
 
4601
- /**
4602
- * This class is the delegate for `EventDelegationPlugin`. It represents the
4603
- * noop version of this class, with the enabled version set when
4604
- * `provideGlobalEventDelegation` is called.
4605
- */
4606
- declare class GlobalEventDelegation implements OnDestroy {
4607
- private eventContractDetails;
4608
- ngOnDestroy(): void;
4609
- supports(eventType: string): boolean;
4610
- addEventListener(element: HTMLElement, eventType: string, handler: Function): Function;
4611
- removeEventListener(element: HTMLElement, eventType: string, callback: Function): void;
4612
- static ɵfac: i0.ɵɵFactoryDeclaration<GlobalEventDelegation, never>;
4613
- static ɵprov: i0.ɵɵInjectableDeclaration<GlobalEventDelegation>;
4614
- }
4615
-
4616
4608
  /**
4617
4609
  * The goal here is to make sure that the browser DOM API is the Renderer.
4618
4610
  * We do this by defining a subset of DOM API to be the renderer and then
@@ -6173,27 +6165,6 @@ export declare type InputOptionsWithTransform<T, TransformT> = Required<Pick<Inp
6173
6165
  export declare interface InputSignal<T> extends InputSignalWithTransform<T, T> {
6174
6166
  }
6175
6167
 
6176
- /**
6177
- * Reactive node type for an input signal. An input signal extends a signal.
6178
- * There are special properties to enable transforms and required inputs.
6179
- */
6180
- declare interface InputSignalNode<T, TransformT> extends SignalNode<T> {
6181
- /**
6182
- * User-configured transform that will run whenever a new value is applied
6183
- * to the input signal node.
6184
- */
6185
- transformFn: ((value: TransformT) => T) | undefined;
6186
- /**
6187
- * Applies a new value to the input signal. Expects transforms to be run
6188
- * manually before.
6189
- *
6190
- * This function is called by the framework runtime code whenever a binding
6191
- * changes. The value can in practice be anything at runtime, but for typing
6192
- * purposes we assume it's a valid `T` value. Type-checking will enforce that.
6193
- */
6194
- applyValueToInputSignal<T, TransformT>(node: InputSignalNode<T, TransformT>, value: T): void;
6195
- }
6196
-
6197
6168
  /**
6198
6169
  * `InputSignalWithTransform` represents a special `Signal` for a
6199
6170
  * directive/component input with a `transform` function.
@@ -6219,7 +6190,7 @@ declare interface InputSignalNode<T, TransformT> extends SignalNode<T> {
6219
6190
  * @developerPreview
6220
6191
  */
6221
6192
  export declare interface InputSignalWithTransform<T, TransformT> extends Signal<T> {
6222
- [SIGNAL]: InputSignalNode<T, TransformT>;
6193
+ [ɵSIGNAL]: ɵInputSignalNode<T, TransformT>;
6223
6194
  [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: T;
6224
6195
  [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: TransformT;
6225
6196
  }
@@ -7269,7 +7240,7 @@ export declare interface ModelOptions {
7269
7240
  * @developerPreview
7270
7241
  */
7271
7242
  export declare interface ModelSignal<T> extends WritableSignal<T>, InputSignal<T>, OutputRef<T> {
7272
- [SIGNAL]: InputSignalNode<T, T>;
7243
+ [ɵSIGNAL]: ɵInputSignalNode<T, T>;
7273
7244
  }
7274
7245
 
7275
7246
  /**
@@ -9573,7 +9544,7 @@ export declare function setTestabilityGetter(getter: GetTestability): void;
9573
9544
  * Ordinary values can be turned into `Signal`s with the `signal` function.
9574
9545
  */
9575
9546
  export declare type Signal<T> = (() => T) & {
9576
- [SIGNAL]: unknown;
9547
+ [ɵSIGNAL]: unknown;
9577
9548
  };
9578
9549
 
9579
9550
  /**
@@ -12012,16 +11983,6 @@ export declare abstract class ViewRef extends ChangeDetectorRef {
12012
11983
  abstract onDestroy(callback: Function): void;
12013
11984
  }
12014
11985
 
12015
- /**
12016
- * Interface for tracking root `ViewRef`s in `ApplicationRef`.
12017
- *
12018
- * NOTE: Importing `ApplicationRef` here directly creates circular dependency, which is why we have
12019
- * a subset of the `ApplicationRef` interface `ViewRefTracker` here.
12020
- */
12021
- declare interface ViewRefTracker {
12022
- detachView(viewRef: ViewRef): void;
12023
- }
12024
-
12025
11986
  /**
12026
11987
  * A `Signal` with a value that can be mutated via a setter interface.
12027
11988
  */
@@ -12805,7 +12766,7 @@ export declare interface ɵDirectiveDef<T> {
12805
12766
  findHostDirectiveDefs: ((currentDef: ɵDirectiveDef<unknown>, matchedDefs: ɵDirectiveDef<unknown>[], hostDirectiveDefs: HostDirectiveDefs) => void) | null;
12806
12767
  /** Additional directives to be applied whenever the directive has been matched. */
12807
12768
  hostDirectives: HostDirectiveDef[] | null;
12808
- setInput: (<U extends T>(this: ɵDirectiveDef<U>, instance: U, inputSignalNode: null | InputSignalNode<unknown, unknown>, value: any, publicName: string, privateName: string) => void) | null;
12769
+ setInput: (<U extends T>(this: ɵDirectiveDef<U>, instance: U, inputSignalNode: null | ɵInputSignalNode<unknown, unknown>, value: any, publicName: string, privateName: string) => void) | null;
12809
12770
  }
12810
12771
 
12811
12772
  /**
@@ -12998,8 +12959,6 @@ export declare function ɵgetUnknownPropertyStrictMode(): boolean;
12998
12959
 
12999
12960
  export declare const ɵglobal: any;
13000
12961
 
13001
- export declare const ɵGLOBAL_EVENT_DELEGATION: InjectionToken<GlobalEventDelegation>;
13002
-
13003
12962
  /**
13004
12963
  * Default debug tools available under `window.ng`.
13005
12964
  */
@@ -13084,6 +13043,27 @@ declare const ɵINPUT_SIGNAL_BRAND_READ_TYPE: unique symbol;
13084
13043
 
13085
13044
  export declare const ɵINPUT_SIGNAL_BRAND_WRITE_TYPE: unique symbol;
13086
13045
 
13046
+ /**
13047
+ * Reactive node type for an input signal. An input signal extends a signal.
13048
+ * There are special properties to enable transforms and required inputs.
13049
+ */
13050
+ export declare interface ɵInputSignalNode<T, TransformT> extends SignalNode<T> {
13051
+ /**
13052
+ * User-configured transform that will run whenever a new value is applied
13053
+ * to the input signal node.
13054
+ */
13055
+ transformFn: ((value: TransformT) => T) | undefined;
13056
+ /**
13057
+ * Applies a new value to the input signal. Expects transforms to be run
13058
+ * manually before.
13059
+ *
13060
+ * This function is called by the framework runtime code whenever a binding
13061
+ * changes. The value can in practice be anything at runtime, but for typing
13062
+ * purposes we assume it's a valid `T` value. Type-checking will enforce that.
13063
+ */
13064
+ applyValueToInputSignal<T, TransformT>(node: ɵInputSignalNode<T, TransformT>, value: T): void;
13065
+ }
13066
+
13087
13067
  /**
13088
13068
  * `InjectionToken` used to configure how to call the `ErrorHandler`.
13089
13069
  *
@@ -13530,13 +13510,6 @@ export declare const enum ɵProfilerEvent {
13530
13510
  */
13531
13511
  export declare const ɵPROVIDED_NG_ZONE: InjectionToken<boolean>;
13532
13512
 
13533
- /**
13534
- * Returns a set of providers required to setup support for event delegation.
13535
- * @param multiContract - Experimental support to provide one event contract
13536
- * when there are multiple binaries on the page.
13537
- */
13538
- export declare function ɵprovideGlobalEventDelegation(multiContract?: boolean): Provider[];
13539
-
13540
13513
  /**
13541
13514
  * An object that contains information about a provider that has been configured
13542
13515
  *
@@ -13972,6 +13945,8 @@ export declare function ɵsetUnknownElementStrictMode(shouldThrow: boolean): voi
13972
13945
  */
13973
13946
  export declare function ɵsetUnknownPropertyStrictMode(shouldThrow: boolean): void;
13974
13947
 
13948
+ export { ɵSIGNAL }
13949
+
13975
13950
  /**
13976
13951
  * Marker used in a comment node to ensure hydration content integrity
13977
13952
  */
@@ -14275,7 +14250,7 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorR
14275
14250
  checkNoChanges(): void;
14276
14251
  attachToViewContainerRef(): void;
14277
14252
  detachFromAppRef(): void;
14278
- attachToAppRef(appRef: ViewRefTracker): void;
14253
+ attachToAppRef(appRef: ApplicationRef): void;
14279
14254
  }
14280
14255
 
14281
14256
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "18.2.6",
3
+ "version": "18.2.8",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.2.6
2
+ * @license Angular v18.2.8
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.2.6
2
+ * @license Angular v18.2.8
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v18.2.6
2
+ * @license Angular v18.2.8
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */