@angular/core 19.2.0-next.3 → 19.2.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 (43) hide show
  1. package/fesm2022/core.mjs +1410 -1233
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  4. package/fesm2022/primitives/signals.mjs +5 -5
  5. package/fesm2022/primitives/signals.mjs.map +1 -1
  6. package/fesm2022/rxjs-interop.mjs +1 -1
  7. package/fesm2022/testing.mjs +696 -5
  8. package/fesm2022/testing.mjs.map +1 -1
  9. package/index.d.ts +260 -51
  10. package/package.json +1 -1
  11. package/primitives/event-dispatch/index.d.ts +1 -1
  12. package/primitives/signals/index.d.ts +2 -2
  13. package/rxjs-interop/index.d.ts +1 -1
  14. package/schematics/bundles/apply_import_manager-a4e62ded.js +71 -0
  15. package/schematics/bundles/{checker-32db85a6.js → checker-2eecc677.js} +17 -16
  16. package/schematics/bundles/cleanup-unused-imports.js +17 -16
  17. package/schematics/bundles/{compiler_host-540e221c.js → compiler_host-f313eac9.js} +2 -2
  18. package/schematics/bundles/control-flow-migration.js +3 -3
  19. package/schematics/bundles/explicit-standalone-flag.js +5 -5
  20. package/schematics/bundles/{imports-abe29092.js → imports-31a38653.js} +1 -1
  21. package/schematics/bundles/{index-7ee8967e.js → index-3891dd55.js} +4 -4
  22. package/schematics/bundles/{index-d5020c9c.js → index-afc3f749.js} +9 -9
  23. package/schematics/bundles/inject-migration.js +10 -9
  24. package/schematics/bundles/{leading_space-d190b83b.js → leading_space-6e7a8ec6.js} +1 -1
  25. package/schematics/bundles/{migrate_ts_type_references-26986908.js → migrate_ts_type_references-1abf1f5f.js} +21 -21
  26. package/schematics/bundles/{nodes-a9f0b985.js → ng_decorators-6878e227.js} +2 -15
  27. package/schematics/bundles/nodes-ffdce442.js +27 -0
  28. package/schematics/bundles/output-migration.js +22 -21
  29. package/schematics/bundles/pending-tasks.js +5 -5
  30. package/schematics/bundles/{program-507de2f1.js → program-24da9092.js} +90 -45
  31. package/schematics/bundles/{apply_import_manager-f4d044b2.js → project_paths-64bc3947.js} +3 -57
  32. package/schematics/bundles/{project_tsconfig_paths-e9ccccbf.js → project_tsconfig_paths-6c9cde78.js} +1 -1
  33. package/schematics/bundles/property_name-42030525.js +31 -0
  34. package/schematics/bundles/provide-initializer.js +5 -5
  35. package/schematics/bundles/route-lazy-loading.js +9 -13
  36. package/schematics/bundles/self-closing-tags-migration.js +448 -0
  37. package/schematics/bundles/signal-input-migration.js +22 -21
  38. package/schematics/bundles/signal-queries-migration.js +28 -27
  39. package/schematics/bundles/signals.js +9 -8
  40. package/schematics/bundles/standalone-migration.js +14 -13
  41. package/schematics/collection.json +6 -0
  42. package/schematics/ng-generate/self-closing-tags-migration/schema.json +14 -0
  43. package/testing/index.d.ts +297 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.0-next.3
2
+ * @license Angular v19.2.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -14,6 +14,7 @@ import { SignalNode } from '@angular/core/primitives/signals';
14
14
  import { Subject } from 'rxjs';
15
15
  import { Subscribable } from 'rxjs';
16
16
  import { Subscription } from 'rxjs';
17
+ import { ValueEqualityFn as ValueEqualityFn_2 } from '@angular/core/primitives/signals';
17
18
  import { ɵProfiler as ɵProfiler_2 } from '@angular/core';
18
19
  import { SIGNAL as ɵSIGNAL } from '@angular/core/primitives/signals';
19
20
 
@@ -1303,6 +1304,22 @@ export declare interface BaseResourceOptions<T, R> {
1303
1304
  injector?: Injector;
1304
1305
  }
1305
1306
 
1307
+ /**
1308
+ * Base class which implements `.value` as a `WritableSignal` by delegating `.set` and `.update`.
1309
+ */
1310
+ declare abstract class BaseWritableResource<T> implements WritableResource<T> {
1311
+ readonly value: WritableSignal<T>;
1312
+ abstract readonly status: Signal<ResourceStatus>;
1313
+ abstract readonly error: Signal<unknown>;
1314
+ abstract reload(): boolean;
1315
+ constructor(value: Signal<T>);
1316
+ abstract set(value: T): void;
1317
+ update(updateFn: (value: T) => T): void;
1318
+ readonly isLoading: Signal<boolean>;
1319
+ hasValue(): this is ResourceRef<Exclude<T, undefined>>;
1320
+ asReadonly(): Resource<T>;
1321
+ }
1322
+
1306
1323
 
1307
1324
  /**
1308
1325
  * Transforms a value (typically a string) to a boolean.
@@ -3914,6 +3931,27 @@ declare type DirectiveDefList = (ɵDirectiveDef<any> | ɵComponentDef<any>)[];
3914
3931
  */
3915
3932
  declare type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDefList;
3916
3933
 
3934
+ /**
3935
+ * Represents a map between a class reference and the index at which its directive is available on
3936
+ * a specific TNode. The value can be either:
3937
+ * 1. A number means that there's only one selector-matched directive on the node and it
3938
+ * doesn't have any host directives.
3939
+ * 2. An array means that there's a selector-matched directive and it has host directives.
3940
+ * The array is structured as follows:
3941
+ * - 0: Index of the selector-matched directive.
3942
+ * - 1: Start index of the range within which the host directives are defined.
3943
+ * - 2: End of the host directive range.
3944
+ *
3945
+ * Example:
3946
+ * ```
3947
+ * Map {
3948
+ * [NoHostDirectives]: 5,
3949
+ * [HasHostDirectives]: [10, 6, 8],
3950
+ * }
3951
+ * ```
3952
+ */
3953
+ declare type DirectiveIndexMap = Map<Type<unknown>, number | [directiveIndex: number, hostDirectivesStart: number, hostDirectivesEnd: number]>;
3954
+
3917
3955
  /**
3918
3956
  * Map of inputs for a given directive/component.
3919
3957
  *
@@ -5191,6 +5229,26 @@ declare interface HostDirectiveDef<T = unknown> {
5191
5229
  */
5192
5230
  declare type HostDirectiveDefs = Map<ɵDirectiveDef<unknown>, HostDirectiveDef>;
5193
5231
 
5232
+ /**
5233
+ * Represents inputs coming from a host directive and exposed on a TNode.
5234
+ *
5235
+ * - The key is the public name of an input as it is exposed on the specific node.
5236
+ * - The value is an array where:
5237
+ * - i+0: Index of the host directive that should be written to.
5238
+ * - i+1: Public name of the input as it was defined on the host directive before aliasing.
5239
+ */
5240
+ declare type HostDirectiveInputs = Record<string, (number | string)[]>;
5241
+
5242
+ /**
5243
+ * Represents outputs coming from a host directive and exposed on a TNode.
5244
+ *
5245
+ * - The key is the public name of an output as it is exposed on the specific node.
5246
+ * - The value is an array where:
5247
+ * - i+0: Index of the host directive on which the output is defined..
5248
+ * - i+1: Public name of the output as it was defined on the host directive before aliasing.
5249
+ */
5250
+ declare type HostDirectiveOutputs = Record<string, (number | string)[]>;
5251
+
5194
5252
  /**
5195
5253
  * Type of the HostListener metadata.
5196
5254
  *
@@ -5680,9 +5738,8 @@ export declare type ImportProvidersSource = Type<unknown> | ModuleWithProviders<
5680
5738
  *
5681
5739
  * Within each sub-array:
5682
5740
  *
5683
- * i+0: attribute name
5684
- * i+1: minified/internal input name
5685
- * i+2: initial value
5741
+ * i+0: public name
5742
+ * i+1: initial value
5686
5743
  *
5687
5744
  * If a directive on a node does not have any input properties
5688
5745
  * that should be set from attributes, its index is set to null
@@ -5703,7 +5760,7 @@ declare type InitialInputData = (InitialInputs | null)[];
5703
5760
  *
5704
5761
  * e.g. ['role-min', 'minified-input', 'button']
5705
5762
  */
5706
- declare type InitialInputs = (string | InputFlags)[];
5763
+ declare type InitialInputs = string[];
5707
5764
 
5708
5765
  /**
5709
5766
  * Type of the Inject metadata.
@@ -7599,6 +7656,35 @@ declare const MULTIPLIER = "x";
7599
7656
 
7600
7657
  declare const NATIVE = 7;
7601
7658
 
7659
+ declare interface NavigateEventInit extends EventInit {
7660
+ navigationType?: ɵNavigationTypeString;
7661
+ canIntercept?: boolean;
7662
+ userInitiated?: boolean;
7663
+ hashChange?: boolean;
7664
+ destination: ɵNavigationDestination;
7665
+ signal: AbortSignal;
7666
+ formData?: FormData | null;
7667
+ downloadRequest?: string | null;
7668
+ info?: unknown;
7669
+ }
7670
+
7671
+ declare interface NavigationCurrentEntryChangeEventInit extends EventInit {
7672
+ navigationType?: ɵNavigationTypeString | null;
7673
+ from: ɵNavigationHistoryEntry;
7674
+ }
7675
+
7676
+
7677
+ declare interface NavigationEventMap {
7678
+ navigate: ɵNavigateEvent;
7679
+ navigatesuccess: Event;
7680
+ navigateerror: ErrorEvent;
7681
+ currententrychange: ɵNavigationCurrentEntryChangeEvent;
7682
+ }
7683
+
7684
+ declare interface NavigationHistoryEntryEventMap {
7685
+ dispose: Event;
7686
+ }
7687
+
7602
7688
  declare const NEXT = 4;
7603
7689
 
7604
7690
  declare interface NgGlobalPublishUtils {
@@ -8142,37 +8228,28 @@ export declare interface NgZoneOptions {
8142
8228
  export declare const NO_ERRORS_SCHEMA: SchemaMetadata;
8143
8229
 
8144
8230
  /**
8145
- * Store the runtime input for all directives applied to a node.
8146
- *
8147
- * This allows efficiently setting the same input on a directive that
8148
- * might apply to multiple directives.
8231
+ * Maps the public names of inputs applied to a specific node to the index of the
8232
+ * directive instance to which the input value should be written, for example:
8149
8233
  *
8150
- * i+0: directive instance index
8151
- * i+1: privateName
8152
- * i+2: input flags
8153
- *
8154
- * e.g.
8155
8234
  * ```
8156
8235
  * {
8157
- * "publicName": [0, 'change-minified', <bit-input-flags>]
8236
+ * "publicName": [0, 5]
8158
8237
  * }
8159
8238
  * ```
8160
8239
  */
8161
- declare type NodeInputBindings = Record<string, (number | string | InputFlags)[]>;
8240
+ declare type NodeInputBindings = Record<string, number[]>;
8162
8241
 
8163
8242
  /**
8164
- * Store the runtime output names for all the directives.
8165
- *
8166
- * i+0: directive instance index
8167
- * i+1: privateName
8243
+ * Maps the public names of outputs available on a specific node to the index
8244
+ * of the directive instance that defines the output, for example:
8168
8245
  *
8169
- * e.g.
8170
8246
  * ```
8171
8247
  * {
8172
- * "publicName": [0, 'change-minified']
8248
+ * "publicName": [0, 5]
8173
8249
  * }
8250
+ * ```
8174
8251
  */
8175
- declare type NodeOutputBindings = Record<string, (number | string)[]>;
8252
+ declare type NodeOutputBindings = Record<string, number[]>;
8176
8253
 
8177
8254
  declare const NODES = "n";
8178
8255
 
@@ -11072,17 +11149,29 @@ declare interface TNode {
11072
11149
  */
11073
11150
  localNames: (string | number)[] | null;
11074
11151
  /** Information about input properties that need to be set once from attribute data. */
11075
- initialInputs: InitialInputData | null | undefined;
11152
+ initialInputs: InitialInputData | null;
11076
11153
  /**
11077
11154
  * Input data for all directives on this node. `null` means that there are no directives with
11078
11155
  * inputs on this node.
11079
11156
  */
11080
11157
  inputs: NodeInputBindings | null;
11158
+ /**
11159
+ * Input data for host directives applied to the node.
11160
+ */
11161
+ hostDirectiveInputs: HostDirectiveInputs | null;
11081
11162
  /**
11082
11163
  * Output data for all directives on this node. `null` means that there are no directives with
11083
11164
  * outputs on this node.
11084
11165
  */
11085
11166
  outputs: NodeOutputBindings | null;
11167
+ /**
11168
+ * Input data for host directives applied to the node.
11169
+ */
11170
+ hostDirectiveOutputs: HostDirectiveOutputs | null;
11171
+ /**
11172
+ * Mapping between directive classes applied to the node and their indexes.
11173
+ */
11174
+ directiveToIndex: DirectiveIndexMap | null;
11086
11175
  /**
11087
11176
  * The TView attached to this node.
11088
11177
  *
@@ -12761,6 +12850,11 @@ export declare abstract class ViewRef extends ChangeDetectorRef {
12761
12850
  abstract onDestroy(callback: Function): void;
12762
12851
  }
12763
12852
 
12853
+ declare type WrappedRequest = {
12854
+ request: unknown;
12855
+ reload: number;
12856
+ };
12857
+
12764
12858
  /**
12765
12859
  * A `Resource` with a mutable value.
12766
12860
  *
@@ -13458,20 +13552,11 @@ export declare interface ɵDirectiveDef<T> {
13458
13552
  * A dictionary mapping the inputs' public name to their minified property names
13459
13553
  * (along with flags if there are any).
13460
13554
  */
13461
- readonly inputs: {
13462
- [P in keyof T]?: string | [minifiedName: string, flags: InputFlags];
13463
- };
13464
- /**
13465
- * A dictionary mapping the private names of inputs to their transformation functions.
13466
- * Note: the private names are used for the keys, rather than the public ones, because public
13467
- * names can be re-aliased in host directives which would invalidate the lookup.
13468
- *
13469
- * Note: Signal inputs will not have transforms captured here. This is because their
13470
- * transform function is already integrated into the `InputSignal`.
13471
- */
13472
- readonly inputTransforms: {
13473
- [classPropertyName: string]: InputTransformFunction;
13474
- } | null;
13555
+ readonly inputs: Record<string, [
13556
+ minifiedName: string,
13557
+ flags: InputFlags,
13558
+ transform: InputTransformFunction | null
13559
+ ]>;
13475
13560
  /**
13476
13561
  * Contains the raw input information produced by the compiler. Can be
13477
13562
  * used to do further processing after the `inputs` have been inverted.
@@ -13489,9 +13574,7 @@ export declare interface ɵDirectiveDef<T> {
13489
13574
  * are their aliases if any, or their original unminified property names
13490
13575
  * (as in `@Output('alias') propertyName: any;`).
13491
13576
  */
13492
- readonly outputs: {
13493
- [P in keyof T]?: string;
13494
- };
13577
+ readonly outputs: Record<string, string>;
13495
13578
  /**
13496
13579
  * Function to create and refresh content queries associated with a given directive.
13497
13580
  */
@@ -14118,6 +14201,108 @@ export declare class ɵMicrotaskEffectScheduler extends ZoneAwareEffectScheduler
14118
14201
  static ɵprov: unknown;
14119
14202
  }
14120
14203
 
14204
+ export declare class ɵNavigateEvent extends Event {
14205
+ constructor(type: string, eventInit?: NavigateEventInit);
14206
+ readonly navigationType: ɵNavigationTypeString;
14207
+ readonly canIntercept: boolean;
14208
+ readonly userInitiated: boolean;
14209
+ readonly hashChange: boolean;
14210
+ readonly destination: ɵNavigationDestination;
14211
+ readonly signal: AbortSignal;
14212
+ readonly formData: FormData | null;
14213
+ readonly downloadRequest: string | null;
14214
+ readonly info?: unknown;
14215
+ intercept(options?: ɵNavigationInterceptOptions): void;
14216
+ scroll(): void;
14217
+ }
14218
+
14219
+ export declare class ɵNavigation extends EventTarget {
14220
+ entries(): ɵNavigationHistoryEntry[];
14221
+ readonly currentEntry: ɵNavigationHistoryEntry | null;
14222
+ updateCurrentEntry(options: ɵNavigationUpdateCurrentEntryOptions): void;
14223
+ readonly transition: ɵNavigationTransition | null;
14224
+ readonly canGoBack: boolean;
14225
+ readonly canGoForward: boolean;
14226
+ navigate(url: string, options?: ɵNavigationNavigateOptions): ɵNavigationResult;
14227
+ reload(options?: ɵNavigationReloadOptions): ɵNavigationResult;
14228
+ traverseTo(key: string, options?: ɵNavigationOptions): ɵNavigationResult;
14229
+ back(options?: ɵNavigationOptions): ɵNavigationResult;
14230
+ forward(options?: ɵNavigationOptions): ɵNavigationResult;
14231
+ onnavigate: ((this: ɵNavigation, ev: ɵNavigateEvent) => any) | null;
14232
+ onnavigatesuccess: ((this: ɵNavigation, ev: Event) => any) | null;
14233
+ onnavigateerror: ((this: ɵNavigation, ev: ErrorEvent) => any) | null;
14234
+ oncurrententrychange: ((this: ɵNavigation, ev: ɵNavigationCurrentEntryChangeEvent) => any) | null;
14235
+ addEventListener<K extends keyof NavigationEventMap>(type: K, listener: (this: ɵNavigation, ev: NavigationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
14236
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
14237
+ removeEventListener<K extends keyof NavigationEventMap>(type: K, listener: (this: ɵNavigation, ev: NavigationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
14238
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
14239
+ }
14240
+
14241
+ export declare class ɵNavigationCurrentEntryChangeEvent extends Event {
14242
+ constructor(type: string, eventInit?: NavigationCurrentEntryChangeEventInit);
14243
+ readonly navigationType: ɵNavigationTypeString | null;
14244
+ readonly from: ɵNavigationHistoryEntry;
14245
+ }
14246
+
14247
+ export declare class ɵNavigationDestination {
14248
+ readonly url: string;
14249
+ readonly key: string | null;
14250
+ readonly id: string | null;
14251
+ readonly index: number;
14252
+ readonly sameDocument: boolean;
14253
+ getState(): unknown;
14254
+ }
14255
+
14256
+ export declare class ɵNavigationHistoryEntry extends EventTarget {
14257
+ readonly key: string;
14258
+ readonly id: string;
14259
+ readonly url: string | null;
14260
+ readonly index: number;
14261
+ readonly sameDocument: boolean;
14262
+ getState(): unknown;
14263
+ ondispose: ((this: ɵNavigationHistoryEntry, ev: Event) => any) | null;
14264
+ addEventListener<K extends keyof NavigationHistoryEntryEventMap>(type: K, listener: (this: ɵNavigationHistoryEntry, ev: NavigationHistoryEntryEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
14265
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
14266
+ removeEventListener<K extends keyof NavigationHistoryEntryEventMap>(type: K, listener: (this: ɵNavigationHistoryEntry, ev: NavigationHistoryEntryEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
14267
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
14268
+ }
14269
+
14270
+ export declare interface ɵNavigationInterceptOptions {
14271
+ handler?: () => Promise<void>;
14272
+ focusReset?: 'after-transition' | 'manual';
14273
+ scroll?: 'after-transition' | 'manual';
14274
+ }
14275
+
14276
+ export declare interface ɵNavigationNavigateOptions extends ɵNavigationOptions {
14277
+ state?: unknown;
14278
+ history?: 'auto' | 'push' | 'replace';
14279
+ }
14280
+
14281
+ export declare interface ɵNavigationOptions {
14282
+ info?: unknown;
14283
+ }
14284
+
14285
+ export declare interface ɵNavigationReloadOptions extends ɵNavigationOptions {
14286
+ state?: unknown;
14287
+ }
14288
+
14289
+ export declare interface ɵNavigationResult {
14290
+ committed: Promise<ɵNavigationHistoryEntry>;
14291
+ finished: Promise<ɵNavigationHistoryEntry>;
14292
+ }
14293
+
14294
+ export declare class ɵNavigationTransition {
14295
+ readonly navigationType: ɵNavigationTypeString;
14296
+ readonly from: ɵNavigationHistoryEntry;
14297
+ readonly finished: Promise<void>;
14298
+ }
14299
+
14300
+ export declare type ɵNavigationTypeString = 'reload' | 'push' | 'replace' | 'traverse';
14301
+
14302
+ export declare interface ɵNavigationUpdateCurrentEntryOptions {
14303
+ state: unknown;
14304
+ }
14305
+
14121
14306
 
14122
14307
  export declare const ɵNG_COMP_DEF: string;
14123
14308
 
@@ -14670,6 +14855,40 @@ export declare function ɵresolveComponentResources(resourceResolver: (url: stri
14670
14855
  text(): Promise<string>;
14671
14856
  }>): Promise<void>;
14672
14857
 
14858
+ /**
14859
+ * Implementation for `resource()` which uses a `linkedSignal` to manage the resource's state.
14860
+ */
14861
+ export declare class ɵResourceImpl<T, R> extends BaseWritableResource<T> implements ResourceRef<T> {
14862
+ private readonly loaderFn;
14863
+ private readonly defaultValue;
14864
+ private readonly equal;
14865
+ private readonly pendingTasks;
14866
+ /**
14867
+ * The current state of the resource. Status, value, and error are derived from this.
14868
+ */
14869
+ private readonly state;
14870
+ /**
14871
+ * Combines the current request with a reload counter which allows the resource to be reloaded on
14872
+ * imperative command.
14873
+ */
14874
+ protected readonly extRequest: WritableSignal<WrappedRequest>;
14875
+ private readonly effectRef;
14876
+ private pendingController;
14877
+ private resolvePendingTask;
14878
+ private destroyed;
14879
+ constructor(request: () => R, loaderFn: ResourceStreamingLoader<T, R>, defaultValue: T, equal: ValueEqualityFn_2<T> | undefined, injector: Injector);
14880
+ readonly status: Signal<ResourceStatus>;
14881
+ readonly error: Signal<unknown>;
14882
+ /**
14883
+ * Called either directly via `WritableResource.set` or via `.value.set()`.
14884
+ */
14885
+ set(value: T): void;
14886
+ reload(): boolean;
14887
+ destroy(): void;
14888
+ private loadEffect;
14889
+ private abortInProgressLoad;
14890
+ }
14891
+
14673
14892
  export declare function ɵrestoreComponentResolutionQueue(queue: Map<Type<any>, Component>): void;
14674
14893
 
14675
14894
  /**
@@ -16881,16 +17100,6 @@ export declare interface ɵɵInjectorDef<T> {
16881
17100
  imports: (InjectorType<any> | InjectorTypeWithProviders<any>)[];
16882
17101
  }
16883
17102
 
16884
- /**
16885
- * Decorates the directive definition with support for input transform functions.
16886
- *
16887
- * If the directive uses inheritance, the feature should be included before the
16888
- * `InheritDefinitionFeature` to ensure that the `inputTransforms` field is populated.
16889
- *
16890
- * @codeGenApi
16891
- */
16892
- export declare function ɵɵInputTransformsFeature<T>(definition: ɵDirectiveDef<T>): void;
16893
-
16894
17103
  /**
16895
17104
  * Throws an error indicating that a factory function could not be generated by the compiler for a
16896
17105
  * particular class.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "19.2.0-next.3",
3
+ "version": "19.2.0",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.0-next.3
2
+ * @license Angular v19.2.0
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 v19.2.0-next.3
2
+ * @license Angular v19.2.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -280,7 +280,7 @@ export declare function setAlternateWeakRefImpl(impl: unknown): void;
280
280
 
281
281
  export declare function setPostSignalSetFn(fn: (() => void) | null): (() => void) | null;
282
282
 
283
- export declare function setThrowInvalidWriteToSignalError(fn: () => never): void;
283
+ export declare function setThrowInvalidWriteToSignalError(fn: <T>(node: SignalNode<T>) => never): void;
284
284
 
285
285
  /**
286
286
  * Symbol used to tell `Signal`s apart from other functions.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.0-next.3
2
+ * @license Angular v19.2.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+ /**
3
+ * @license Angular v19.2.0
4
+ * (c) 2010-2024 Google LLC. https://angular.io/
5
+ * License: MIT
6
+ */
7
+ 'use strict';
8
+
9
+ var ts = require('typescript');
10
+ require('os');
11
+ var checker = require('./checker-2eecc677.js');
12
+ var project_paths = require('./project_paths-64bc3947.js');
13
+
14
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
+
16
+ var ts__default = /*#__PURE__*/_interopDefaultLegacy(ts);
17
+
18
+ /**
19
+ * Applies import manager changes, and writes them as replacements the
20
+ * given result array.
21
+ */
22
+ function applyImportManagerChanges(importManager, replacements, sourceFiles, info) {
23
+ const { newImports, updatedImports, deletedImports } = importManager.finalize();
24
+ const printer = ts__default["default"].createPrinter({});
25
+ const pathToFile = new Map(sourceFiles.map((s) => [s.fileName, s]));
26
+ // Capture new imports
27
+ newImports.forEach((newImports, fileName) => {
28
+ newImports.forEach((newImport) => {
29
+ const printedImport = printer.printNode(ts__default["default"].EmitHint.Unspecified, newImport, pathToFile.get(fileName));
30
+ replacements.push(new project_paths.Replacement(project_paths.projectFile(checker.absoluteFrom(fileName), info), new project_paths.TextUpdate({ position: 0, end: 0, toInsert: `${printedImport}\n` })));
31
+ });
32
+ });
33
+ // Capture updated imports
34
+ for (const [oldBindings, newBindings] of updatedImports.entries()) {
35
+ // The import will be generated as multi-line if it already is multi-line,
36
+ // or if the number of elements significantly increased and it previously
37
+ // consisted of very few specifiers.
38
+ const isMultiline = oldBindings.getText().includes('\n') ||
39
+ (newBindings.elements.length >= 6 && oldBindings.elements.length <= 3);
40
+ const hasSpaceBetweenBraces = oldBindings.getText().startsWith('{ ');
41
+ let formatFlags = ts__default["default"].ListFormat.NamedImportsOrExportsElements |
42
+ ts__default["default"].ListFormat.Indented |
43
+ ts__default["default"].ListFormat.Braces |
44
+ ts__default["default"].ListFormat.PreserveLines |
45
+ (isMultiline ? ts__default["default"].ListFormat.MultiLine : ts__default["default"].ListFormat.SingleLine);
46
+ if (hasSpaceBetweenBraces) {
47
+ formatFlags |= ts__default["default"].ListFormat.SpaceBetweenBraces;
48
+ }
49
+ else {
50
+ formatFlags &= ~ts__default["default"].ListFormat.SpaceBetweenBraces;
51
+ }
52
+ const printedBindings = printer.printList(formatFlags, newBindings.elements, oldBindings.getSourceFile());
53
+ replacements.push(new project_paths.Replacement(project_paths.projectFile(oldBindings.getSourceFile(), info), new project_paths.TextUpdate({
54
+ position: oldBindings.getStart(),
55
+ end: oldBindings.getEnd(),
56
+ // TS uses four spaces as indent. We migrate to two spaces as we
57
+ // assume this to be more common.
58
+ toInsert: printedBindings.replace(/^ {4}/gm, ' '),
59
+ })));
60
+ }
61
+ // Update removed imports
62
+ for (const removedImport of deletedImports) {
63
+ replacements.push(new project_paths.Replacement(project_paths.projectFile(removedImport.getSourceFile(), info), new project_paths.TextUpdate({
64
+ position: removedImport.getStart(),
65
+ end: removedImport.getEnd(),
66
+ toInsert: '',
67
+ })));
68
+ }
69
+ }
70
+
71
+ exports.applyImportManagerChanges = applyImportManagerChanges;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0-next.3
3
+ * @license Angular v19.2.0
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -2942,10 +2942,6 @@ class Identifiers {
2942
2942
  name: 'ɵɵHostDirectivesFeature',
2943
2943
  moduleName: CORE,
2944
2944
  };
2945
- static InputTransformsFeatureFeature = {
2946
- name: 'ɵɵInputTransformsFeature',
2947
- moduleName: CORE,
2948
- };
2949
2945
  static ExternalStylesFeature = {
2950
2946
  name: 'ɵɵExternalStylesFeature',
2951
2947
  moduleName: CORE,
@@ -28747,7 +28743,6 @@ function addFeatures(definitionMap, meta) {
28747
28743
  const features = [];
28748
28744
  const providers = meta.providers;
28749
28745
  const viewProviders = meta.viewProviders;
28750
- const inputKeys = Object.keys(meta.inputs);
28751
28746
  if (providers || viewProviders) {
28752
28747
  const args = [providers || new LiteralArrayExpr([])];
28753
28748
  if (viewProviders) {
@@ -28755,12 +28750,6 @@ function addFeatures(definitionMap, meta) {
28755
28750
  }
28756
28751
  features.push(importExpr(Identifiers.ProvidersFeature).callFn(args));
28757
28752
  }
28758
- for (const key of inputKeys) {
28759
- if (meta.inputs[key].transformFunction !== null) {
28760
- features.push(importExpr(Identifiers.InputTransformsFeatureFeature));
28761
- break;
28762
- }
28763
- }
28764
28753
  // Note: host directives feature needs to be inserted before the
28765
28754
  // inheritance feature to ensure the correct execution order.
28766
28755
  if (meta.hostDirectives?.length) {
@@ -30733,7 +30722,7 @@ function publishFacade(global) {
30733
30722
  * @description
30734
30723
  * Entry point for all public APIs of the compiler package.
30735
30724
  */
30736
- new Version('19.2.0-next.3');
30725
+ new Version('19.2.0');
30737
30726
 
30738
30727
  const _I18N_ATTR = 'i18n';
30739
30728
  const _I18N_ATTR_PREFIX = 'i18n-';
@@ -32141,7 +32130,7 @@ class NodeJSPathManipulation {
32141
32130
  // G3-ESM-MARKER: G3 uses CommonJS, but externally everything in ESM.
32142
32131
  // CommonJS/ESM interop for determining the current file name and containing dir.
32143
32132
  const isCommonJS = typeof __filename !== 'undefined';
32144
- const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || new URL('checker-32db85a6.js', document.baseURI).href));
32133
+ const currentFileUrl = isCommonJS ? null : (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || new URL('checker-2eecc677.js', document.baseURI).href));
32145
32134
  const currentFileName = isCommonJS ? __filename : url.fileURLToPath(currentFileUrl);
32146
32135
  /**
32147
32136
  * A wrapper around the Node.js file-system that supports readonly operations and path manipulation.
@@ -32771,6 +32760,11 @@ const patchedReferencedAliasesSymbol = Symbol('patchedReferencedAliases');
32771
32760
  * that have been referenced in a value-position by the transform, such the installed patch can
32772
32761
  * ensure that those import declarations are not elided.
32773
32762
  *
32763
+ * If `null` is returned then the transform operates in an isolated context, i.e. using the
32764
+ * `ts.transform` API. In such scenario there is no information whether an alias declaration
32765
+ * is referenced, so all alias declarations are naturally preserved and explicitly registering
32766
+ * an alias declaration as used isn't necessary.
32767
+ *
32774
32768
  * See below. Note that this uses sourcegraph as the TypeScript checker file doesn't display on
32775
32769
  * Github.
32776
32770
  * https://sourcegraph.com/github.com/microsoft/TypeScript@3eaa7c65f6f076a08a5f7f1946fd0df7c7430259/-/blob/src/compiler/checker.ts#L31219-31257
@@ -32782,6 +32776,11 @@ function loadIsReferencedAliasDeclarationPatch(context) {
32782
32776
  throwIncompatibleTransformationContextError();
32783
32777
  }
32784
32778
  const emitResolver = context.getEmitResolver();
32779
+ if (emitResolver === undefined) {
32780
+ // In isolated `ts.transform` operations no emit resolver is present, return null as `isReferencedAliasDeclaration`
32781
+ // will never be invoked.
32782
+ return null;
32783
+ }
32785
32784
  // The emit resolver may have been patched already, in which case we return the set of referenced
32786
32785
  // aliases that was created when the patch was first applied.
32787
32786
  // See https://github.com/angular/angular/issues/40276.
@@ -32907,7 +32906,7 @@ class DefaultImportTracker {
32907
32906
  if (clausesToPreserve === null) {
32908
32907
  clausesToPreserve = loadIsReferencedAliasDeclarationPatch(context);
32909
32908
  }
32910
- clausesToPreserve.add(clause);
32909
+ clausesToPreserve?.add(clause);
32911
32910
  }
32912
32911
  }
32913
32912
  return sourceFile;
@@ -36104,7 +36103,9 @@ function createTsTransformForImportManager(manager, extraStatementsForFiles) {
36104
36103
  // doesn't drop these thinking they are unused.
36105
36104
  if (reusedOriginalAliasDeclarations.size > 0) {
36106
36105
  const referencedAliasDeclarations = loadIsReferencedAliasDeclarationPatch(ctx);
36107
- reusedOriginalAliasDeclarations.forEach((aliasDecl) => referencedAliasDeclarations.add(aliasDecl));
36106
+ if (referencedAliasDeclarations !== null) {
36107
+ reusedOriginalAliasDeclarations.forEach((aliasDecl) => referencedAliasDeclarations.add(aliasDecl));
36108
+ }
36108
36109
  }
36109
36110
  // Update the set of affected files to include files that need extra statements to be inserted.
36110
36111
  if (extraStatementsForFiles !== undefined) {