@angular/core 19.2.1 → 20.0.0-next.1

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 (42) hide show
  1. package/fesm2022/core.mjs +6420 -6161
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/di.mjs +1 -1
  4. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  5. package/fesm2022/primitives/signals.mjs +1 -1
  6. package/fesm2022/rxjs-interop.mjs +1 -1
  7. package/fesm2022/testing.mjs +15 -4
  8. package/fesm2022/testing.mjs.map +1 -1
  9. package/index.d.ts +114 -25
  10. package/package.json +7 -1
  11. package/primitives/di/index.d.ts +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-b8d6885d.js → apply_import_manager-e2a7fe5b.js} +3 -3
  16. package/schematics/bundles/{checker-89987c98.js → checker-af521da6.js} +452 -231
  17. package/schematics/bundles/cleanup-unused-imports.js +6 -6
  18. package/schematics/bundles/{compiler_host-2398e4ca.js → compiler_host-5a29293c.js} +2 -2
  19. package/schematics/bundles/control-flow-migration.js +3 -3
  20. package/schematics/bundles/explicit-standalone-flag.js +3 -3
  21. package/schematics/bundles/imports-047fbbc8.js +1 -1
  22. package/schematics/bundles/{index-e0b2e4a7.js → index-1bef3025.js} +4 -4
  23. package/schematics/bundles/{index-10911843.js → index-ef1bffbb.js} +4 -4
  24. package/schematics/bundles/inject-migration.js +3 -3
  25. package/schematics/bundles/leading_space-f8944434.js +1 -1
  26. package/schematics/bundles/{migrate_ts_type_references-52508cd4.js → migrate_ts_type_references-2a3e9e6b.js} +15 -13
  27. package/schematics/bundles/ng_decorators-b0d8b324.js +1 -1
  28. package/schematics/bundles/nodes-7758dbf6.js +1 -1
  29. package/schematics/bundles/output-migration.js +6 -6
  30. package/schematics/bundles/pending-tasks.js +3 -3
  31. package/schematics/bundles/{program-0e1d4f10.js → program-a449f9bf.js} +149 -149
  32. package/schematics/bundles/{project_paths-c48796dd.js → project_paths-17dc204d.js} +3 -3
  33. package/schematics/bundles/project_tsconfig_paths-b558633b.js +1 -1
  34. package/schematics/bundles/property_name-ac18447e.js +1 -1
  35. package/schematics/bundles/provide-initializer.js +3 -3
  36. package/schematics/bundles/route-lazy-loading.js +3 -3
  37. package/schematics/bundles/self-closing-tags-migration.js +4 -4
  38. package/schematics/bundles/signal-input-migration.js +7 -7
  39. package/schematics/bundles/signal-queries-migration.js +7 -7
  40. package/schematics/bundles/signals.js +7 -7
  41. package/schematics/bundles/standalone-migration.js +5 -5
  42. package/testing/index.d.ts +1 -1
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.1
2
+ * @license Angular v20.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1319,6 +1319,26 @@ declare abstract class BaseWritableResource<T> implements WritableResource<T> {
1319
1319
  asReadonly(): Resource<T>;
1320
1320
  }
1321
1321
 
1322
+ /** Symbol used to store and retrieve metadata about a binding. */
1323
+ declare const BINDING: unique symbol;
1324
+
1325
+ /**
1326
+ * A dynamically-defined binding targeting.
1327
+ * For example, `inputBinding('value', () => 123)` creates an input binding.
1328
+ */
1329
+ declare interface Binding {
1330
+ readonly [BINDING]: {
1331
+ readonly kind: string;
1332
+ readonly requiredVars: number;
1333
+ };
1334
+ /** Target to which to apply the binding. */
1335
+ readonly target?: unknown;
1336
+ /** Callback that will be invoked during creation. */
1337
+ create?(): void;
1338
+ /** Callback that will be invoked during updates. */
1339
+ update?(): void;
1340
+ }
1341
+
1322
1342
 
1323
1343
  /**
1324
1344
  * Transforms a value (typically a string) to a boolean.
@@ -2117,7 +2137,7 @@ declare abstract class ComponentFactory<C> {
2117
2137
  /**
2118
2138
  * Creates a new component.
2119
2139
  */
2120
- abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, environmentInjector?: EnvironmentInjector | NgModuleRef<any>): ComponentRef<C>;
2140
+ abstract create(injector: Injector, projectableNodes?: any[][], rootSelectorOrNode?: string | any, environmentInjector?: EnvironmentInjector | NgModuleRef<any>, directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[], bindings?: Binding[]): ComponentRef<C>;
2121
2141
  }
2122
2142
  export { ComponentFactory }
2123
2143
  export { ComponentFactory as ɵComponentFactory }
@@ -2649,6 +2669,8 @@ declare const CONTEXT = 8;
2649
2669
  * `[[element1, element2]]`: projects `element1` and `element2` into the same `<ng-content>`.
2650
2670
  * `[[element1, element2], [element3]]`: projects `element1` and `element2` into one `<ng-content>`,
2651
2671
  * and `element3` into a separate `<ng-content>`.
2672
+ * * `directives` (optional): Directives that should be applied to the component.
2673
+ * * `binding` (optional): Bindings to apply to the root component.
2652
2674
  * @returns ComponentRef instance that represents a given Component.
2653
2675
  *
2654
2676
  * @publicApi
@@ -2658,6 +2680,8 @@ export declare function createComponent<C>(component: Type<C>, options: {
2658
2680
  hostElement?: Element;
2659
2681
  elementInjector?: Injector;
2660
2682
  projectableNodes?: Node[][];
2683
+ directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[];
2684
+ bindings?: Binding[];
2661
2685
  }): ComponentRef<C>;
2662
2686
 
2663
2687
  /**
@@ -3397,6 +3421,15 @@ declare interface DepsTrackerApi {
3397
3421
  isOrphanComponent(cmp: ɵComponentType<any>): boolean;
3398
3422
  }
3399
3423
 
3424
+ /**
3425
+ * An Injector that the owner can destroy and trigger the DestroyRef.destroy hooks.
3426
+ *
3427
+ * @publicApi
3428
+ */
3429
+ export declare interface DestroyableInjector extends Injector {
3430
+ destroy(): void;
3431
+ }
3432
+
3400
3433
  /**
3401
3434
  * Array of destroy hooks that should be executed for a view and their directive indices.
3402
3435
  *
@@ -4014,6 +4047,16 @@ declare type DirectiveInputs<T> = {
4014
4047
  ];
4015
4048
  };
4016
4049
 
4050
+ /**
4051
+ * Represents a dynamically-created directive with bindings targeting it specifically.
4052
+ */
4053
+ declare interface DirectiveWithBindings<T> {
4054
+ /** Directive type that should be created. */
4055
+ type: Type<T>;
4056
+ /** Bindings that should be applied to the specific directive. */
4057
+ bindings: Binding[];
4058
+ }
4059
+
4017
4060
  declare const DISCONNECTED_NODES = "d";
4018
4061
 
4019
4062
  /**
@@ -4291,6 +4334,8 @@ export declare const ENVIRONMENT_INITIALIZER: InjectionToken<readonly (() => voi
4291
4334
  /**
4292
4335
  * An `Injector` that's part of the environment injector hierarchy, which exists outside of the
4293
4336
  * component tree.
4337
+ *
4338
+ * @publicApi
4294
4339
  */
4295
4340
  export declare abstract class EnvironmentInjector implements Injector {
4296
4341
  /**
@@ -6213,7 +6258,7 @@ export declare abstract class Injector {
6213
6258
  providers: Array<Provider | StaticProvider>;
6214
6259
  parent?: Injector;
6215
6260
  name?: string;
6216
- }): Injector;
6261
+ }): DestroyableInjector;
6217
6262
  /** @nocollapse */
6218
6263
  static ɵprov: unknown;
6219
6264
  }
@@ -6326,6 +6371,26 @@ export declare const Input: InputDecorator;
6326
6371
  */
6327
6372
  export declare const input: InputFunction;
6328
6373
 
6374
+ /**
6375
+ * Creates an input binding.
6376
+ * @param publicName Public name of the input to bind to.
6377
+ * @param value Callback that returns the current value for the binding. Can be either a signal or
6378
+ * a plain getter function.
6379
+ *
6380
+ * ### Usage Example
6381
+ * In this example we create an instance of the `MyButton` component and bind the value of
6382
+ * the `isDisabled` signal to its `disabled` input.
6383
+ *
6384
+ * ```
6385
+ * const isDisabled = signal(false);
6386
+ *
6387
+ * createComponent(MyButton, {
6388
+ * bindings: [inputBinding('disabled', isDisabled)]
6389
+ * });
6390
+ * ```
6391
+ */
6392
+ export declare function inputBinding(publicName: string, value: () => unknown): Binding;
6393
+
6329
6394
  /**
6330
6395
  * @publicApi
6331
6396
  */
@@ -8455,6 +8520,29 @@ export declare const Output: OutputDecorator;
8455
8520
  */
8456
8521
  export declare function output<T = void>(opts?: OutputOptions): OutputEmitterRef<T>;
8457
8522
 
8523
+ /**
8524
+ * Creates an output binding.
8525
+ * @param eventName Public name of the output to listen to.
8526
+ * @param listener Function to be called when the output emits.
8527
+ *
8528
+ * ### Usage example
8529
+ * In this example we create an instance of the `MyCheckbox` component and listen
8530
+ * to its `onChange` event.
8531
+ *
8532
+ * ```
8533
+ * interface CheckboxChange {
8534
+ * value: string;
8535
+ * }
8536
+ *
8537
+ * createComponent(MyCheckbox, {
8538
+ * bindings: [
8539
+ * outputBinding<CheckboxChange>('onChange', event => console.log(event.value))
8540
+ * ],
8541
+ * });
8542
+ * ```
8543
+ */
8544
+ export declare function outputBinding<T>(eventName: string, listener: (event: T) => unknown): Binding;
8545
+
8458
8546
  /**
8459
8547
  * Type of the Output decorator / constructor function.
8460
8548
  *
@@ -8577,8 +8665,9 @@ declare const PARENT = 3;
8577
8665
  * @developerPreview
8578
8666
  */
8579
8667
  export declare class PendingTasks {
8580
- private internalPendingTasks;
8581
- private scheduler;
8668
+ private readonly internalPendingTasks;
8669
+ private readonly scheduler;
8670
+ private readonly errorHandler;
8582
8671
  /**
8583
8672
  * Adds a new task that should block application's stability.
8584
8673
  * @returns A cleanup function that removes a task when called.
@@ -8594,17 +8683,9 @@ export declare class PendingTasks {
8594
8683
  * });
8595
8684
  * ```
8596
8685
  *
8597
- * Application stability is at least delayed until the next tick after the `run` method resolves
8598
- * so it is safe to make additional updates to application state that would require UI synchronization:
8599
- *
8600
- * ```ts
8601
- * const userData = await pendingTasks.run(() => fetch('/api/user'));
8602
- * this.userData.set(userData);
8603
- * ```
8604
- *
8605
8686
  * @param fn The asynchronous function to execute
8606
8687
  */
8607
- run<T>(fn: () => Promise<T>): Promise<T>;
8688
+ run<T>(fn: () => Promise<T>): void;
8608
8689
  /** @nocollapse */
8609
8690
  static ɵprov: unknown;
8610
8691
  }
@@ -12699,6 +12780,8 @@ export declare abstract class ViewContainerRef {
12699
12780
  * replace the `ngModuleRef` parameter.
12700
12781
  * * projectableNodes: list of DOM nodes that should be projected through
12701
12782
  * [`<ng-content>`](api/core/ng-content) of the new component instance.
12783
+ * * directives: Directives that should be applied to the component.
12784
+ * * bindings: Bindings that should be applied to the component.
12702
12785
  *
12703
12786
  * @returns The new `ComponentRef` which contains the component instance and the host view.
12704
12787
  */
@@ -12708,6 +12791,8 @@ export declare abstract class ViewContainerRef {
12708
12791
  ngModuleRef?: NgModuleRef<unknown>;
12709
12792
  environmentInjector?: EnvironmentInjector | NgModuleRef<unknown>;
12710
12793
  projectableNodes?: Node[][];
12794
+ directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[];
12795
+ bindings?: Binding[];
12711
12796
  }): ComponentRef<C>;
12712
12797
  /**
12713
12798
  * Instantiates a single component and inserts its host view into this container.
@@ -12720,6 +12805,8 @@ export declare abstract class ViewContainerRef {
12720
12805
  * [`<ng-content>`](api/core/ng-content) of the new component instance.
12721
12806
  * @param ngModuleRef An instance of the NgModuleRef that represent an NgModule.
12722
12807
  * This information is used to retrieve corresponding NgModule injector.
12808
+ * @param directives Directives that should be applied to the component.
12809
+ * @param bindings Bindings that should be applied to the component.
12723
12810
  *
12724
12811
  * @returns The new `ComponentRef` which contains the component instance and the host view.
12725
12812
  *
@@ -12727,7 +12814,7 @@ export declare abstract class ViewContainerRef {
12727
12814
  * Use different signature of the `createComponent` method, which allows passing
12728
12815
  * Component class directly.
12729
12816
  */
12730
- abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: EnvironmentInjector | NgModuleRef<any>): ComponentRef<C>;
12817
+ abstract createComponent<C>(componentFactory: ComponentFactory<C>, index?: number, injector?: Injector, projectableNodes?: any[][], environmentInjector?: EnvironmentInjector | NgModuleRef<any>, directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[], bindings?: Binding[]): ComponentRef<C>;
12731
12818
  /**
12732
12819
  * Inserts a view into this container.
12733
12820
  * @param viewRef The view to insert.
@@ -13521,7 +13608,7 @@ export declare enum ɵDeferBlockState {
13521
13608
  /** The deps tracker to be used in the current Angular app in dev mode. */
13522
13609
  export declare const ɵdepsTracker: DepsTracker;
13523
13610
 
13524
- export declare function ɵdetectChangesInViewIfRequired(lView: LView, notifyErrorHandler: boolean, isFirstPass: boolean, zonelessEnabled: boolean): void;
13611
+ export declare function ɵdetectChangesInViewIfRequired(lView: LView, isFirstPass: boolean, zonelessEnabled: boolean): void;
13525
13612
 
13526
13613
 
13527
13614
  export declare function ɵdevModeEqual(a: any, b: any): boolean;
@@ -14022,9 +14109,6 @@ export declare interface ɵInputSignalNode<T, TransformT> extends SignalNode<T>
14022
14109
 
14023
14110
  /**
14024
14111
  * `InjectionToken` used to configure how to call the `ErrorHandler`.
14025
- *
14026
- * `NgZone` is provided by default today so the default (and only) implementation for this
14027
- * is calling `ErrorHandler.handleError` outside of the Angular zone.
14028
14112
  */
14029
14113
  export declare const ɵINTERNAL_APPLICATION_ERROR_HANDLER: InjectionToken<(e: any) => void>;
14030
14114
 
@@ -14531,7 +14615,7 @@ export declare interface ɵPipeDef<T> {
14531
14615
  * Profiler function which the runtime will invoke before and after user code.
14532
14616
  */
14533
14617
  export declare interface ɵProfiler {
14534
- (event: ɵProfilerEvent, instance?: {} | null, hookOrListener?: (e?: any) => any): void;
14618
+ (event: ɵProfilerEvent, instance?: {} | null, eventFn?: Function): void;
14535
14619
  }
14536
14620
 
14537
14621
  /**
@@ -14747,7 +14831,7 @@ export declare class ɵRender3ComponentFactory<T> extends ComponentFactory<T> {
14747
14831
  * @param ngModule The NgModuleRef to which the factory is bound.
14748
14832
  */
14749
14833
  constructor(componentDef: ɵComponentDef<any>, ngModule?: NgModuleRef<any> | undefined);
14750
- create(injector: Injector, projectableNodes?: any[][] | undefined, rootSelectorOrNode?: any, environmentInjector?: NgModuleRef<any> | EnvironmentInjector | undefined): ComponentRef<T>;
14834
+ create(injector: Injector, projectableNodes?: any[][] | undefined, rootSelectorOrNode?: any, environmentInjector?: NgModuleRef<any> | EnvironmentInjector | undefined, directives?: (Type<unknown> | DirectiveWithBindings<unknown>)[], componentBindings?: Binding[]): ComponentRef<T>;
14751
14835
  }
14752
14836
 
14753
14837
  /**
@@ -14759,7 +14843,8 @@ export declare class ɵRender3ComponentFactory<T> extends ComponentFactory<T> {
14759
14843
  *
14760
14844
  */
14761
14845
  export declare class ɵRender3ComponentRef<T> extends ComponentRef<T> {
14762
- private _rootLView;
14846
+ private readonly _rootLView;
14847
+ private readonly _hasInputBindings;
14763
14848
  instance: T;
14764
14849
  hostView: ɵViewRef<T>;
14765
14850
  changeDetectorRef: ChangeDetectorRef;
@@ -14767,7 +14852,7 @@ export declare class ɵRender3ComponentRef<T> extends ComponentRef<T> {
14767
14852
  location: ElementRef;
14768
14853
  private previousInputValues;
14769
14854
  private _tNode;
14770
- constructor(componentType: Type<T>, _rootLView: LView);
14855
+ constructor(componentType: Type<T>, _rootLView: LView, _hasInputBindings: boolean);
14771
14856
  setInput(name: string, value: unknown): void;
14772
14857
  get injector(): Injector;
14773
14858
  destroy(): void;
@@ -14962,6 +15047,9 @@ export declare const enum ɵRuntimeErrorCode {
14962
15047
  HOST_DIRECTIVE_CONFLICTING_ALIAS = 312,
14963
15048
  MULTIPLE_MATCHING_PIPES = 313,
14964
15049
  UNINITIALIZED_LET_ACCESS = 314,
15050
+ NO_BINDING_TARGET = 315,
15051
+ INVALID_BINDING_TARGET = 316,
15052
+ INVALID_SET_INPUT_CALL = 317,
14965
15053
  MULTIPLE_PLATFORMS = 400,
14966
15054
  PLATFORM_NOT_FOUND = 401,
14967
15055
  MISSING_REQUIRED_INJECTABLE_IN_BOOTSTRAP = 402,
@@ -15002,6 +15090,8 @@ export declare const enum ɵRuntimeErrorCode {
15002
15090
  COMPONENT_ID_COLLISION = -912,
15003
15091
  IMAGE_PERFORMANCE_WARNING = -913,
15004
15092
  UNEXPECTED_ZONEJS_PRESENT_IN_ZONELESS_MODE = 914,
15093
+ MISSING_NG_MODULE_DEFINITION = 915,
15094
+ MISSING_DIRECTIVE_DEFINITION = 916,
15005
15095
  REQUIRED_INPUT_NO_VALUE = -950,
15006
15096
  REQUIRED_QUERY_NO_VALUE = -951,
15007
15097
  REQUIRED_MODEL_NO_VALUE = 952,
@@ -15296,7 +15386,6 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorR
15296
15386
  * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
15297
15387
  */
15298
15388
  private _cdRefInjectingView?;
15299
- readonly notifyErrorHandler: boolean;
15300
15389
  private _appRef;
15301
15390
  private _attachedToViewContainer;
15302
15391
  get rootNodes(): any[];
@@ -15319,7 +15408,7 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorR
15319
15408
  *
15320
15409
  * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
15321
15410
  */
15322
- _cdRefInjectingView?: LView | undefined, notifyErrorHandler?: boolean);
15411
+ _cdRefInjectingView?: LView | undefined);
15323
15412
  get context(): T;
15324
15413
  /**
15325
15414
  * @deprecated Replacing the full context object is not supported. Modify the context
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "19.2.1",
3
+ "version": "20.0.0-next.1",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -46,9 +46,15 @@
46
46
  "tslib": "^2.3.0"
47
47
  },
48
48
  "peerDependencies": {
49
+ "@angular/compiler": "20.0.0-next.1",
49
50
  "rxjs": "^6.5.3 || ^7.4.0",
50
51
  "zone.js": "~0.15.0"
51
52
  },
53
+ "peerDependenciesMeta": {
54
+ "@angular/compiler": {
55
+ "optional": true
56
+ }
57
+ },
52
58
  "repository": {
53
59
  "type": "git",
54
60
  "url": "https://github.com/angular/angular.git",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.1
2
+ * @license Angular v20.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.1
2
+ * @license Angular v20.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.1
2
+ * @license Angular v20.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.1
2
+ * @license Angular v20.0.0-next.1
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.1
3
+ * @license Angular v20.0.0-next.1
4
4
  * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -8,8 +8,8 @@
8
8
 
9
9
  var ts = require('typescript');
10
10
  require('os');
11
- var checker = require('./checker-89987c98.js');
12
- var project_paths = require('./project_paths-c48796dd.js');
11
+ var checker = require('./checker-af521da6.js');
12
+ var project_paths = require('./project_paths-17dc204d.js');
13
13
 
14
14
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
15