@angular/core 17.1.1 → 17.1.3

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 (61) hide show
  1. package/esm2022/src/application/application_init.mjs +2 -2
  2. package/esm2022/src/application/application_ref.mjs +55 -17
  3. package/esm2022/src/application/application_tokens.mjs +9 -9
  4. package/esm2022/src/authoring/input.mjs +1 -1
  5. package/esm2022/src/authoring/input_signal.mjs +1 -1
  6. package/esm2022/src/authoring/input_type_checking.mjs +1 -1
  7. package/esm2022/src/authoring.mjs +1 -1
  8. package/esm2022/src/change_detection/scheduling/zoneless_scheduling_impl.mjs +51 -18
  9. package/esm2022/src/core_private_export.mjs +2 -2
  10. package/esm2022/src/defer/instructions.mjs +16 -7
  11. package/esm2022/src/di/forward_ref.mjs +1 -1
  12. package/esm2022/src/di/initializer_token.mjs +2 -2
  13. package/esm2022/src/di/injector.mjs +4 -4
  14. package/esm2022/src/di/injector_token.mjs +2 -2
  15. package/esm2022/src/di/internal_tokens.mjs +2 -2
  16. package/esm2022/src/di/scope.mjs +2 -2
  17. package/esm2022/src/hydration/error_handling.mjs +17 -6
  18. package/esm2022/src/hydration/utils.mjs +54 -8
  19. package/esm2022/src/i18n/tokens.mjs +5 -5
  20. package/esm2022/src/linker/compiler.mjs +2 -2
  21. package/esm2022/src/metadata/di.mjs +1 -1
  22. package/esm2022/src/platform/platform.mjs +2 -2
  23. package/esm2022/src/platform/platform_ref.mjs +2 -2
  24. package/esm2022/src/render3/after_render_hooks.mjs +2 -6
  25. package/esm2022/src/render3/component_ref.mjs +1 -1
  26. package/esm2022/src/render3/definition.mjs +1 -1
  27. package/esm2022/src/render3/errors_di.mjs +2 -2
  28. package/esm2022/src/render3/i18n/i18n_locale_id.mjs +2 -2
  29. package/esm2022/src/render3/instructions/change_detection.mjs +6 -6
  30. package/esm2022/src/render3/instructions/element.mjs +3 -3
  31. package/esm2022/src/render3/instructions/write_to_directive_input.mjs +1 -1
  32. package/esm2022/src/render3/util/view_utils.mjs +3 -3
  33. package/esm2022/src/render3/view_ref.mjs +1 -1
  34. package/esm2022/src/util/ng_dev_mode.mjs +11 -3
  35. package/esm2022/src/util/stringify.mjs +2 -2
  36. package/esm2022/src/version.mjs +1 -1
  37. package/esm2022/testing/src/component_fixture.mjs +127 -92
  38. package/esm2022/testing/src/logger.mjs +3 -3
  39. package/esm2022/testing/src/test_bed.mjs +11 -6
  40. package/esm2022/testing/src/test_bed_common.mjs +9 -2
  41. package/esm2022/testing/src/test_bed_compiler.mjs +5 -4
  42. package/esm2022/testing/src/testing.mjs +2 -2
  43. package/fesm2022/core.mjs +510 -376
  44. package/fesm2022/core.mjs.map +1 -1
  45. package/fesm2022/primitives/signals.mjs +1 -1
  46. package/fesm2022/rxjs-interop.mjs +1 -1
  47. package/fesm2022/testing.mjs +142 -95
  48. package/fesm2022/testing.mjs.map +1 -1
  49. package/index.d.ts +85 -23
  50. package/package.json +1 -1
  51. package/primitives/signals/index.d.ts +1 -1
  52. package/rxjs-interop/index.d.ts +1 -1
  53. package/schematics/migrations/block-template-entities/bundle.js +255 -208
  54. package/schematics/migrations/block-template-entities/bundle.js.map +3 -3
  55. package/schematics/migrations/compiler-options/bundle.js +13 -13
  56. package/schematics/migrations/transfer-state/bundle.js +13 -13
  57. package/schematics/ng-generate/control-flow-migration/bundle.js +265 -218
  58. package/schematics/ng-generate/control-flow-migration/bundle.js.map +3 -3
  59. package/schematics/ng-generate/standalone-migration/bundle.js +702 -560
  60. package/schematics/ng-generate/standalone-migration/bundle.js.map +3 -3
  61. package/testing/index.d.ts +6 -17
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.1.1
2
+ * @license Angular v17.1.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -332,7 +332,7 @@ export declare interface AfterViewInit {
332
332
  }
333
333
 
334
334
  /**
335
- * A [DI token](guide/glossary#di-token "DI token definition") that indicates which animations
335
+ * A [DI token](api/core/InjectionToken) that indicates which animations
336
336
  * module has been loaded.
337
337
  * @publicApi
338
338
  */
@@ -756,6 +756,8 @@ export declare class ApplicationRef {
756
756
  * detection pass during which all change detection must complete.
757
757
  */
758
758
  tick(): void;
759
+ private detectChangesInAttachedViews;
760
+ private detectChangesInView;
759
761
  /**
760
762
  * Attaches a view so that it will be dirty checked.
761
763
  * The view will be automatically detached when it is destroyed.
@@ -3327,9 +3329,7 @@ declare type DirectiveDefListOrFactory = (() => DirectiveDefList) | DirectiveDef
3327
3329
  * - Because declared and public name are usually same we only generate the array
3328
3330
  * `['declared', 'public']` format when they differ, or there is a transform.
3329
3331
  * - The reason why this API and `outputs` API is not the same is that `NgOnChanges` has
3330
- * inconsistent behavior in that it uses declared names rather than minified or public. For
3331
- * this reason `NgOnChanges` will be deprecated and removed in future version and this
3332
- * API will be simplified to be consistent with `output`.
3332
+ * inconsistent behavior in that it uses declared names rather than minified or public.
3333
3333
  */
3334
3334
  declare type DirectiveInputs<T> = {
3335
3335
  [P in keyof T]?: string | [
@@ -3925,7 +3925,7 @@ declare const FLAGS = 2;
3925
3925
  export declare function forwardRef(forwardRefFn: ForwardRefFn): Type<any>;
3926
3926
 
3927
3927
  /**
3928
- * An interface that a function passed into {@link forwardRef} has to implement.
3928
+ * An interface that a function passed into `forwardRef` has to implement.
3929
3929
  *
3930
3930
  * @usageNotes
3931
3931
  * ### Example
@@ -4545,6 +4545,18 @@ export declare interface HostListenerDecorator {
4545
4545
 
4546
4546
  declare const HYDRATION = 6;
4547
4547
 
4548
+ declare const HYDRATION_INFO_KEY = "__ngDebugHydrationInfo__";
4549
+
4550
+ /**
4551
+ * Internal type that represents a claimed node.
4552
+ * Only used in dev mode.
4553
+ */
4554
+ declare enum HydrationStatus {
4555
+ Hydrated = "hydrated",
4556
+ Skipped = "skipped",
4557
+ Mismatched = "mismatched"
4558
+ }
4559
+
4548
4560
  declare namespace i0 {
4549
4561
  export {
4550
4562
  ɵɵinject,
@@ -5211,10 +5223,10 @@ export declare const INJECTOR: InjectionToken<Injector>;
5211
5223
 
5212
5224
  /**
5213
5225
  * Concrete injectors implement this interface. Injectors are configured
5214
- * with [providers](guide/glossary#provider) that associate
5215
- * dependencies of various types with [injection tokens](guide/glossary#di-token).
5226
+ * with [providers](guide/dependency-injection-providers) that associate
5227
+ * dependencies of various types with [injection tokens](guide/dependency-injection-providers).
5216
5228
  *
5217
- * @see ["DI Providers"](guide/dependency-injection-providers).
5229
+ * @see [DI Providers](guide/dependency-injection-providers).
5218
5230
  * @see {@link StaticProvider}
5219
5231
  *
5220
5232
  * @usageNotes
@@ -5478,7 +5490,7 @@ export declare interface InputFunction {
5478
5490
  */
5479
5491
  <ReadT>(): InputSignal<ReadT | undefined>;
5480
5492
  <ReadT>(initialValue: ReadT, opts?: InputOptionsWithoutTransform<ReadT>): InputSignal<ReadT>;
5481
- <ReadT, WriteT>(initialValue: ReadT, opts: InputOptionsWithTransform<ReadT, WriteT>): InputSignal<ReadT, WriteT>;
5493
+ <ReadT, WriteT>(initialValue: ReadT, opts: InputOptionsWithTransform<ReadT, WriteT>): InputSignalWithTransform<ReadT, WriteT>;
5482
5494
  /**
5483
5495
  * Initializes a required input.
5484
5496
  *
@@ -5489,7 +5501,7 @@ export declare interface InputFunction {
5489
5501
  */
5490
5502
  required: {
5491
5503
  <ReadT>(opts?: InputOptionsWithoutTransform<ReadT>): InputSignal<ReadT>;
5492
- <ReadT, WriteT>(opts: InputOptionsWithTransform<ReadT, WriteT>): InputSignal<ReadT, WriteT>;
5504
+ <ReadT, WriteT>(opts: InputOptionsWithTransform<ReadT, WriteT>): InputSignalWithTransform<ReadT, WriteT>;
5493
5505
  };
5494
5506
  }
5495
5507
 
@@ -5531,18 +5543,17 @@ export declare type InputOptionsWithoutTransform<ReadT> = Omit<InputOptions<Read
5531
5543
  export declare type InputOptionsWithTransform<ReadT, WriteT> = Required<Pick<InputOptions<ReadT, WriteT>, 'transform'>> & InputOptions<ReadT, WriteT>;
5532
5544
 
5533
5545
  /**
5534
- * `InputSignal` is represents a special `Signal` for a directive/component input.
5546
+ * `InputSignal` represents a special `Signal` for a directive/component input.
5535
5547
  *
5536
5548
  * An input signal is similar to a non-writable signal except that it also
5537
5549
  * carries additional type-information for transforms, and that Angular internally
5538
5550
  * updates the signal whenever a new value is bound.
5539
5551
  *
5552
+ * @see {@link InputOptionsWithTransform} for inputs with transforms.
5553
+ *
5540
5554
  * @developerPreview
5541
5555
  */
5542
- export declare interface InputSignal<ReadT, WriteT = ReadT> extends Signal<ReadT> {
5543
- [SIGNAL]: InputSignalNode<ReadT, WriteT>;
5544
- [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: ReadT;
5545
- [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: WriteT;
5556
+ export declare interface InputSignal<ReadT> extends InputSignalWithTransform<ReadT, ReadT> {
5546
5557
  }
5547
5558
 
5548
5559
  /**
@@ -5566,6 +5577,36 @@ declare interface InputSignalNode<ReadT, WriteT> extends SignalNode<ReadT | type
5566
5577
  applyValueToInputSignal<ReadT, WriteT>(node: InputSignalNode<ReadT, WriteT>, value: ReadT): void;
5567
5578
  }
5568
5579
 
5580
+ /**
5581
+ * `InputSignalWithTransform` represents a special `Signal` for a
5582
+ * directive/component input with a `transform` function.
5583
+ *
5584
+ * Signal inputs with transforms capture an extra generic for their transform write
5585
+ * type. Transforms can expand the accepted bound values for an input while ensuring
5586
+ * value retrievals of the signal input are still matching the generic input type.
5587
+ *
5588
+ * ```ts
5589
+ * class MyDir {
5590
+ * disabled = input(false, {
5591
+ * transform: (v: string|boolean) => convertToBoolean(v),
5592
+ * }); // InputSignalWithTransform<boolean, string|boolean>
5593
+ *
5594
+ * click() {
5595
+ * this.disabled() // always returns a `boolean`.
5596
+ * }
5597
+ * }
5598
+ * ```
5599
+ *
5600
+ * @see {@link InputSignal} for additional information.
5601
+ *
5602
+ * @developerPreview
5603
+ */
5604
+ export declare interface InputSignalWithTransform<ReadT, WriteT> extends Signal<ReadT> {
5605
+ [SIGNAL]: InputSignalNode<ReadT, WriteT>;
5606
+ [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: ReadT;
5607
+ [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: WriteT;
5608
+ }
5609
+
5569
5610
  /** Function that can be used to transform incoming input values. */
5570
5611
  declare type InputTransformFunction = (value: any) => any;
5571
5612
 
@@ -10672,6 +10713,8 @@ export declare interface ViewChildDecorator {
10672
10713
  *
10673
10714
  * @usageNotes
10674
10715
  *
10716
+ * ### Example 1
10717
+ *
10675
10718
  * {@example core/di/ts/viewChild/view_child_example.ts region='Component'}
10676
10719
  *
10677
10720
  * ### Example 2
@@ -11094,7 +11137,7 @@ export declare class ɵAfterRenderEventManager {
11094
11137
  /**
11095
11138
  * Executes callbacks. Returns `true` if any callbacks executed.
11096
11139
  */
11097
- execute(): boolean;
11140
+ execute(): void;
11098
11141
  ngOnDestroy(): void;
11099
11142
  /** @nocollapse */
11100
11143
  static ɵprov: unknown;
@@ -11572,9 +11615,11 @@ export declare const ɵDEFER_BLOCK_CONFIG: InjectionToken<ɵDeferBlockConfig>;
11572
11615
 
11573
11616
  /**
11574
11617
  * **INTERNAL**, avoid referencing it in application code.
11575
- *
11618
+ * *
11576
11619
  * Injector token that allows to provide `DeferBlockDependencyInterceptor` class
11577
11620
  * implementation.
11621
+ *
11622
+ * This token is only injected in devMode
11578
11623
  */
11579
11624
  export declare const ɵDEFER_BLOCK_DEPENDENCY_INTERCEPTOR: InjectionToken<ɵDeferBlockDependencyInterceptor>;
11580
11625
 
@@ -11998,6 +12043,18 @@ export declare type ɵGlobalDevModeUtils = {
11998
12043
  [GLOBAL_PUBLISH_EXPANDO_KEY]: typeof globalUtilsFunctions;
11999
12044
  };
12000
12045
 
12046
+ export declare type ɵHydratedNode = {
12047
+ [HYDRATION_INFO_KEY]?: ɵHydrationInfo;
12048
+ };
12049
+
12050
+ export declare type ɵHydrationInfo = {
12051
+ status: HydrationStatus.Hydrated | HydrationStatus.Skipped;
12052
+ } | {
12053
+ status: HydrationStatus.Mismatched;
12054
+ actualNodeDetails: string | null;
12055
+ expectedNodeDetails: string | null;
12056
+ };
12057
+
12001
12058
  /**
12002
12059
  * Injection token that configures the image optimized image functionality.
12003
12060
  * See {@link ImageConfig} for additional information about parameters that
@@ -12523,6 +12580,8 @@ export declare interface ɵProviderRecord {
12523
12580
 
12524
12581
  export declare function ɵprovideZonelessChangeDetection(): EnvironmentProviders;
12525
12582
 
12583
+ export declare function ɵreadHydrationInfo(node: RNode): ɵHydrationInfo | null;
12584
+
12526
12585
  export declare class ɵReflectionCapabilities implements PlatformReflectionCapabilities {
12527
12586
  private _reflect;
12528
12587
  constructor(reflect?: any);
@@ -12969,7 +13028,7 @@ export declare function ɵtriggerResourceLoading(tDetails: TDeferBlockDetails, l
12969
13028
  *
12970
13029
  * @param string
12971
13030
  * @param maxLength of the output string
12972
- * @returns elispsed string with ... in the middle
13031
+ * @returns ellipsed string with ... in the middle
12973
13032
  */
12974
13033
  export declare function ɵtruncateMiddle(str: string, maxLength?: number): string;
12975
13034
 
@@ -12978,13 +13037,16 @@ export declare function ɵtruncateMiddle(str: string, maxLength?: number): strin
12978
13037
  */
12979
13038
  export declare function ɵunregisterLocaleData(): void;
12980
13039
 
12981
- /** Unwraps all `InputSignal` class fields of the given directive. */
13040
+ /**
13041
+ * Unwraps all `InputSignal`/`InputSignalWithTransform` class fields of
13042
+ * the given directive.
13043
+ */
12982
13044
  export declare type ɵUnwrapDirectiveSignalInputs<Dir, Fields extends keyof Dir> = {
12983
13045
  [P in Fields]: ɵUnwrapInputSignalWriteType<Dir[P]>;
12984
13046
  };
12985
13047
 
12986
- /** Retrieves the `WriteT` of an `InputSignal`. */
12987
- declare type ɵUnwrapInputSignalWriteType<Field> = Field extends InputSignal<unknown, infer WriteT> ? WriteT : never;
13048
+ /** Retrieves the `WriteT` of an `InputSignal` and `InputSignalWithTransform`. */
13049
+ declare type ɵUnwrapInputSignalWriteType<Field> = Field extends InputSignalWithTransform<unknown, infer WriteT> ? WriteT : never;
12988
13050
 
12989
13051
  export declare function ɵunwrapSafeValue(value: ɵSafeValue): string;
12990
13052
 
@@ -13007,7 +13069,7 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, ChangeDetectorR
13007
13069
  * This may be different from `_lView` if the `_cdRefInjectingView` is an embedded view.
13008
13070
  */
13009
13071
  private _cdRefInjectingView?;
13010
- private readonly notifyErrorHandler;
13072
+ readonly notifyErrorHandler: boolean;
13011
13073
  private _appRef;
13012
13074
  private _attachedToViewContainer;
13013
13075
  get rootNodes(): any[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "17.1.1",
3
+ "version": "17.1.3",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.1.1
2
+ * @license Angular v17.1.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.1.1
2
+ * @license Angular v17.1.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */