@angular/core 17.0.0-next.6 → 17.0.0-next.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 (93) hide show
  1. package/esm2022/primitives/signals/index.mjs +15 -0
  2. package/esm2022/primitives/signals/src/computed.mjs +92 -0
  3. package/esm2022/primitives/signals/src/equality.mjs +14 -0
  4. package/esm2022/primitives/signals/src/errors.mjs +18 -0
  5. package/esm2022/primitives/signals/src/graph.mjs +291 -0
  6. package/esm2022/primitives/signals/src/signal.mjs +78 -0
  7. package/esm2022/primitives/signals/src/watch.mjs +82 -0
  8. package/esm2022/primitives/signals/src/weak_ref.mjs +11 -0
  9. package/esm2022/rxjs-interop/src/to_signal.mjs +45 -14
  10. package/esm2022/src/application_init.mjs +50 -2
  11. package/esm2022/src/application_ref.mjs +7 -2
  12. package/esm2022/src/application_tokens.mjs +16 -1
  13. package/esm2022/src/core_private_export.mjs +4 -4
  14. package/esm2022/src/core_reactivity_export_internal.mjs +6 -2
  15. package/esm2022/src/core_render3_private_export.mjs +2 -2
  16. package/esm2022/src/errors.mjs +1 -1
  17. package/esm2022/src/image_performance_warning.mjs +154 -0
  18. package/esm2022/src/linker/compiler.mjs +1 -1
  19. package/esm2022/src/metadata/directives.mjs +1 -1
  20. package/esm2022/src/render3/after_render_hooks.mjs +5 -1
  21. package/esm2022/src/render3/assert.mjs +16 -1
  22. package/esm2022/src/render3/component_ref.mjs +12 -3
  23. package/esm2022/src/render3/debug/framework_injector_profiler.mjs +33 -4
  24. package/esm2022/src/render3/debug/injector_profiler.mjs +1 -1
  25. package/esm2022/src/render3/debug/set_debug_info.mjs +20 -0
  26. package/esm2022/src/render3/definition.mjs +2 -1
  27. package/esm2022/src/render3/deps_tracker/api.mjs +1 -1
  28. package/esm2022/src/render3/deps_tracker/deps_tracker.mjs +13 -2
  29. package/esm2022/src/render3/features/host_directives_feature.mjs +3 -8
  30. package/esm2022/src/render3/hooks.mjs +5 -5
  31. package/esm2022/src/render3/index.mjs +3 -2
  32. package/esm2022/src/render3/instructions/change_detection.mjs +31 -14
  33. package/esm2022/src/render3/instructions/control_flow.mjs +75 -63
  34. package/esm2022/src/render3/instructions/defer.mjs +410 -60
  35. package/esm2022/src/render3/instructions/defer_events.mjs +28 -8
  36. package/esm2022/src/render3/instructions/shared.mjs +5 -4
  37. package/esm2022/src/render3/interfaces/container.mjs +5 -4
  38. package/esm2022/src/render3/interfaces/defer.mjs +13 -6
  39. package/esm2022/src/render3/interfaces/definition.mjs +1 -1
  40. package/esm2022/src/render3/interfaces/view.mjs +5 -4
  41. package/esm2022/src/render3/jit/environment.mjs +3 -1
  42. package/esm2022/src/render3/list_reconciliation.mjs +257 -0
  43. package/esm2022/src/render3/node_manipulation.mjs +4 -6
  44. package/esm2022/src/render3/pipe.mjs +4 -4
  45. package/esm2022/src/render3/reactive_lview_consumer.mjs +2 -2
  46. package/esm2022/src/render3/reactivity/api.mjs +15 -0
  47. package/esm2022/src/render3/reactivity/asserts.mjs +26 -0
  48. package/esm2022/src/render3/reactivity/computed.mjs +19 -0
  49. package/esm2022/src/render3/reactivity/effect.mjs +7 -6
  50. package/esm2022/src/render3/reactivity/signal.mjs +32 -0
  51. package/esm2022/src/render3/reactivity/untracked.mjs +24 -0
  52. package/esm2022/src/render3/util/global_utils.mjs +3 -2
  53. package/esm2022/src/render3/util/injector_discovery_utils.mjs +70 -9
  54. package/esm2022/src/render3/util/stringify_utils.mjs +28 -1
  55. package/esm2022/src/render3/util/view_utils.mjs +41 -25
  56. package/esm2022/src/render3/view_ref.mjs +13 -2
  57. package/esm2022/src/util/stringify.mjs +16 -1
  58. package/esm2022/src/version.mjs +1 -1
  59. package/esm2022/testing/src/logger.mjs +3 -3
  60. package/fesm2022/core.mjs +15104 -14010
  61. package/fesm2022/core.mjs.map +1 -1
  62. package/fesm2022/primitives/signals.mjs +539 -0
  63. package/fesm2022/primitives/signals.mjs.map +1 -0
  64. package/fesm2022/rxjs-interop.mjs +45 -14
  65. package/fesm2022/rxjs-interop.mjs.map +1 -1
  66. package/fesm2022/testing.mjs +1 -1
  67. package/index.d.ts +171 -167
  68. package/package.json +7 -1
  69. package/primitives/signals/index.d.ts +281 -0
  70. package/rxjs-interop/index.d.ts +15 -101
  71. package/schematics/collection.json +12 -2
  72. package/schematics/migrations/block-template-entities/bundle.js +1192 -610
  73. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  74. package/schematics/migrations/compiler-options/bundle.js +582 -0
  75. package/schematics/migrations/compiler-options/bundle.js.map +7 -0
  76. package/schematics/migrations/transfer-state/bundle.js +592 -0
  77. package/schematics/migrations/transfer-state/bundle.js.map +7 -0
  78. package/schematics/migrations.json +10 -0
  79. package/schematics/ng-generate/control-flow-migration/bundle.js +24097 -0
  80. package/schematics/ng-generate/control-flow-migration/bundle.js.map +7 -0
  81. package/schematics/ng-generate/control-flow-migration/schema.json +7 -0
  82. package/schematics/ng-generate/standalone-migration/bundle.js +2470 -1627
  83. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  84. package/testing/index.d.ts +1 -1
  85. package/esm2022/src/signals/index.mjs +0 -16
  86. package/esm2022/src/signals/src/api.mjs +0 -39
  87. package/esm2022/src/signals/src/computed.mjs +0 -95
  88. package/esm2022/src/signals/src/errors.mjs +0 -18
  89. package/esm2022/src/signals/src/graph.mjs +0 -280
  90. package/esm2022/src/signals/src/signal.mjs +0 -92
  91. package/esm2022/src/signals/src/untracked.mjs +0 -26
  92. package/esm2022/src/signals/src/watch.mjs +0 -81
  93. package/esm2022/src/signals/src/weak_ref.mjs +0 -11
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-next.6
2
+ * @license Angular v17.0.0-next.8
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -7,6 +7,8 @@
7
7
 
8
8
  import { BehaviorSubject } from 'rxjs';
9
9
  import { Observable } from 'rxjs';
10
+ import { ReactiveNode } from '@angular/core/primitives/signals';
11
+ import { SIGNAL } from '@angular/core/primitives/signals';
10
12
  import { Subject } from 'rxjs';
11
13
  import { Subscribable } from 'rxjs';
12
14
  import { Subscription } from 'rxjs';
@@ -398,7 +400,7 @@ export declare const APP_ID: InjectionToken<string>;
398
400
  *
399
401
  * The following example illustrates how to configure a multi-provider using `APP_INITIALIZER` token
400
402
  * and a function returning a promise.
401
- *
403
+ * ### Example with NgModule-based application
402
404
  * ```
403
405
  * function initializeApp(): Promise<any> {
404
406
  * return new Promise((resolve, reject) => {
@@ -420,11 +422,38 @@ export declare const APP_ID: InjectionToken<string>;
420
422
  * export class AppModule {}
421
423
  * ```
422
424
  *
425
+ * ### Example with standalone application
426
+ * ```
427
+ * export function initializeApp(http: HttpClient) {
428
+ * return (): Promise<any> =>
429
+ * firstValueFrom(
430
+ * http
431
+ * .get("https://someUrl.com/api/user")
432
+ * .pipe(tap(user => { ... }))
433
+ * );
434
+ * }
435
+ *
436
+ * bootstrapApplication(App, {
437
+ * providers: [
438
+ * provideHttpClient(),
439
+ * {
440
+ * provide: APP_INITIALIZER,
441
+ * useFactory: initializeApp,
442
+ * multi: true,
443
+ * deps: [HttpClient],
444
+ * },
445
+ * ],
446
+ * });
447
+
448
+ * ```
449
+ *
450
+ *
423
451
  * It's also possible to configure a multi-provider using `APP_INITIALIZER` token and a function
424
452
  * returning an observable, see an example below. Note: the `HttpClient` in this example is used for
425
453
  * demo purposes to illustrate how the factory function can work with other providers available
426
454
  * through DI.
427
455
  *
456
+ * ### Example with NgModule-based application
428
457
  * ```
429
458
  * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
430
459
  * return () => httpClient.get("https://someUrl.com/api/user")
@@ -447,6 +476,27 @@ export declare const APP_ID: InjectionToken<string>;
447
476
  * export class AppModule {}
448
477
  * ```
449
478
  *
479
+ * ### Example with standalone application
480
+ *
481
+ * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
482
+ * return () => httpClient.get("https://someUrl.com/api/user")
483
+ * .pipe(
484
+ * tap(user => { ... })
485
+ * );
486
+ * }
487
+ *
488
+ * bootstrapApplication(App, {
489
+ * providers: [
490
+ * provideHttpClient(),
491
+ * {
492
+ * provide: APP_INITIALIZER,
493
+ * useFactory: initializeApp,
494
+ * multi: true,
495
+ * deps: [HttpClient],
496
+ * },
497
+ * ],
498
+ * });
499
+ *
450
500
  * @publicApi
451
501
  */
452
502
  export declare const APP_INITIALIZER: InjectionToken<readonly (() => Observable<unknown> | Promise<unknown> | void)[]>;
@@ -752,6 +802,17 @@ export declare function asNativeElements(debugEls: DebugElement[]): any;
752
802
  */
753
803
  export declare function assertInInjectionContext(debugFn: Function): void;
754
804
 
805
+
806
+ /**
807
+ * Asserts that the current stack frame is not within a reactive context. Useful
808
+ * to disallow certain code from running inside a reactive context (see {@link toSignal}).
809
+ *
810
+ * @param debugFn a reference to the function making the assertion (used for the error message).
811
+ *
812
+ * @publicApi
813
+ */
814
+ export declare function assertNotInReactiveContext(debugFn: Function, extraContext?: string): void;
815
+
755
816
  /**
756
817
  * Checks that there is currently a platform that contains the given token as a provider.
757
818
  *
@@ -1014,6 +1075,13 @@ declare const CHILD_HEAD = 12;
1014
1075
 
1015
1076
  declare const CHILD_TAIL = 13;
1016
1077
 
1078
+ declare interface ClassDebugInfo {
1079
+ className: string;
1080
+ filePath?: string;
1081
+ lineNumber?: number;
1082
+ forbidOrphanRendering?: boolean;
1083
+ }
1084
+
1017
1085
  /**
1018
1086
  * Configures the `Injector` to return an instance of `useClass` for a token.
1019
1087
  * @see ["Dependency Injection Guide"](guide/dependency-injection).
@@ -1141,16 +1209,8 @@ export declare abstract class CompilerFactory {
1141
1209
  * @publicApi
1142
1210
  */
1143
1211
  export declare type CompilerOptions = {
1144
- /**
1145
- * @deprecated not used at all in Ivy, providing this config option has no effect.
1146
- */
1147
- useJit?: boolean;
1148
1212
  defaultEncapsulation?: ViewEncapsulation;
1149
1213
  providers?: StaticProvider[];
1150
- /**
1151
- * @deprecated not used at all in Ivy, providing this config option has no effect.
1152
- */
1153
- missingTranslation?: MissingTranslationStrategy;
1154
1214
  preserveWhitespaces?: boolean;
1155
1215
  };
1156
1216
 
@@ -1736,8 +1796,6 @@ declare type ComponentTemplate<T> = {
1736
1796
 
1737
1797
  /**
1738
1798
  * Create a computed `Signal` which derives a reactive value from an expression.
1739
- *
1740
- * @developerPreview
1741
1799
  */
1742
1800
  export declare function computed<T>(computation: () => T, options?: CreateComputedOptions<T>): Signal<T>;
1743
1801
 
@@ -2059,8 +2117,6 @@ export declare function createComponent<C>(component: Type<C>, options: {
2059
2117
 
2060
2118
  /**
2061
2119
  * Options passed to the `computed` creation function.
2062
- *
2063
- * @developerPreview
2064
2120
  */
2065
2121
  export declare interface CreateComputedOptions<T> {
2066
2122
  /**
@@ -2071,8 +2127,6 @@ export declare interface CreateComputedOptions<T> {
2071
2127
 
2072
2128
  /**
2073
2129
  * Options passed to the `effect` function.
2074
- *
2075
- * @developerPreview
2076
2130
  */
2077
2131
  export declare interface CreateEffectOptions {
2078
2132
  /**
@@ -2156,8 +2210,6 @@ export declare function createPlatformFactory(parentPlatformFactory: ((extraProv
2156
2210
 
2157
2211
  /**
2158
2212
  * Options passed to the `signal` creation function.
2159
- *
2160
- * @developerPreview
2161
2213
  */
2162
2214
  export declare interface CreateSignalOptions<T> {
2163
2215
  /**
@@ -2504,7 +2556,7 @@ declare enum DeferDependenciesLoadingState {
2504
2556
  declare type DeferredLoadingBlockConfig = [minimumTime: number | null, afterTime: number | null];
2505
2557
 
2506
2558
  /** Configuration object for a placeholder block as it is stored in the component constants. */
2507
- declare type DeferredPlaceholderBlockConfig = [afterTime: number | null];
2559
+ declare type DeferredPlaceholderBlockConfig = [minimumTime: number | null];
2508
2560
 
2509
2561
  /**
2510
2562
  * @deprecated in v8, delete after v10. This API should be used only by generated code, and that
@@ -2604,6 +2656,8 @@ declare class DepsTracker implements DepsTrackerApi {
2604
2656
  /** @override */
2605
2657
  getStandaloneComponentScope(type: ɵComponentType<any>, rawImports?: RawScopeInfoFromDecorator[]): StandaloneComponentScope;
2606
2658
  private computeStandaloneComponentScope;
2659
+ /** @override */
2660
+ isOrphanComponent(cmp: Type<any>): boolean;
2607
2661
  }
2608
2662
 
2609
2663
  /**
@@ -2659,10 +2713,13 @@ declare interface DepsTrackerApi {
2659
2713
  * `clearScopeCacheFor` method.
2660
2714
  */
2661
2715
  getStandaloneComponentScope(type: ɵComponentType<any>, rawImports: (Type<any> | (() => Type<any>))[]): StandaloneComponentScope;
2716
+ /**
2717
+ * Checks if the NgModule declaring the component is not loaded into the browser yet. Always
2718
+ * returns false for standalone components.
2719
+ */
2720
+ isOrphanComponent(cmp: ɵComponentType<any>): boolean;
2662
2721
  }
2663
2722
 
2664
- declare const DESCENDANT_VIEWS_TO_REFRESH = 5;
2665
-
2666
2723
  /**
2667
2724
  * Array of destroy hooks that should be executed for a view and their directive indices.
2668
2725
  *
@@ -2916,7 +2973,7 @@ export declare interface Directive {
2916
2973
  * If a binding changes, Angular updates the directive's host element.
2917
2974
  *
2918
2975
  * When the key is a property of the host element, the property value is
2919
- * the propagated to the specified DOM property.
2976
+ * propagated to the specified DOM property.
2920
2977
  *
2921
2978
  * When the key is a static attribute in the DOM, the attribute value
2922
2979
  * is propagated to the specified property in the host element.
@@ -3305,8 +3362,6 @@ export declare interface DoCheck {
3305
3362
 
3306
3363
  /**
3307
3364
  * Create a global `Effect` for the given reactive function.
3308
- *
3309
- * @developerPreview
3310
3365
  */
3311
3366
  export declare function effect(effectFn: (onCleanup: EffectCleanupRegisterFn) => void, options?: CreateEffectOptions): EffectRef;
3312
3367
 
@@ -3314,8 +3369,6 @@ export declare function effect(effectFn: (onCleanup: EffectCleanupRegisterFn) =>
3314
3369
  * An effect can, optionally, register a cleanup function. If registered, the cleanup is executed
3315
3370
  * before the next effect run. The cleanup function makes it possible to "cancel" any work that the
3316
3371
  * previous effect run might have started.
3317
- *
3318
- * @developerPreview
3319
3372
  */
3320
3373
  export declare type EffectCleanupFn = () => void;
3321
3374
 
@@ -3326,8 +3379,6 @@ declare type EffectCleanupRegisterFn = (cleanupFn: EffectCleanupFn) => void;
3326
3379
 
3327
3380
  /**
3328
3381
  * A global reactive effect, which can be manually destroyed.
3329
- *
3330
- * @developerPreview
3331
3382
  */
3332
3383
  export declare interface EffectRef {
3333
3384
  /**
@@ -3884,6 +3935,8 @@ declare type GlobalTargetName = 'document' | 'window' | 'body';
3884
3935
 
3885
3936
  declare type GlobalTargetResolver = (element: any) => EventTarget;
3886
3937
 
3938
+ declare const HAS_CHILD_VIEWS_TO_REFRESH = 6;
3939
+
3887
3940
  /**
3888
3941
  * Flag to signify that this `LContainer` may have transplanted views which need to be change
3889
3942
  * detected. (see: `LView[DECLARATION_COMPONENT_VIEW])`.
@@ -4234,7 +4287,7 @@ export declare interface HostListenerDecorator {
4234
4287
  new (eventName: string, args?: string[]): any;
4235
4288
  }
4236
4289
 
4237
- declare const HYDRATION = 22;
4290
+ declare const HYDRATION = 6;
4238
4291
 
4239
4292
  declare namespace i0 {
4240
4293
  export {
@@ -5109,8 +5162,6 @@ export declare function isDevMode(): boolean;
5109
5162
 
5110
5163
  /**
5111
5164
  * Checks if the given `value` is a reactive `Signal`.
5112
- *
5113
- * @developerPreview
5114
5165
  */
5115
5166
  export declare function isSignal(value: unknown): value is Signal<unknown>;
5116
5167
 
@@ -5449,12 +5500,10 @@ declare interface LContainer extends Array<any> {
5449
5500
  */
5450
5501
  [NEXT]: LView | LContainer | null;
5451
5502
  /**
5452
- * The number of direct transplanted views which need a refresh or have descendants themselves
5453
- * that need a refresh but have not marked their ancestors as Dirty. This tells us that during
5454
- * change detection we should still descend to find those children to refresh, even if the parents
5455
- * are not `Dirty`/`CheckAlways`.
5503
+ * Indicates that this LContainer has a view underneath it that needs to be refreshed during
5504
+ * change detection.
5456
5505
  */
5457
- [DESCENDANT_VIEWS_TO_REFRESH]: number;
5506
+ [HAS_CHILD_VIEWS_TO_REFRESH]: boolean;
5458
5507
  /**
5459
5508
  * A collection of views created based on the underlying `<ng-template>` element but inserted into
5460
5509
  * a different `LContainer`. We need to track views created from a given declaration point since
@@ -5801,13 +5850,6 @@ declare interface LView<T = unknown> extends Array<any> {
5801
5850
  * More flags for this view. See PreOrderHookFlags for more info.
5802
5851
  */
5803
5852
  [PREORDER_HOOK_FLAGS]: PreOrderHookFlags;
5804
- /**
5805
- * The number of direct transplanted views which need a refresh or have descendants themselves
5806
- * that need a refresh but have not marked their ancestors as Dirty. This tells us that during
5807
- * change detection we should still descend to find those children to refresh, even if the parents
5808
- * are not `Dirty`/`CheckAlways`.
5809
- */
5810
- [DESCENDANT_VIEWS_TO_REFRESH]: number;
5811
5853
  /** Unique ID of the view. Used for `__ngContext__` lookups in the `LView` registry. */
5812
5854
  [ID]: number;
5813
5855
  /**
@@ -5889,8 +5931,8 @@ declare const enum LViewFlags {
5889
5931
  /**
5890
5932
  * Whether this moved LView was needs to be refreshed. Similar to the Dirty flag, but used for
5891
5933
  * transplanted and signal views where the parent/ancestor views are not marked dirty as well.
5892
- * i.e. "Refresh just this view". Used in conjunction with the DESCENDANT_VIEWS_TO_REFRESH
5893
- * counter.
5934
+ * i.e. "Refresh just this view". Used in conjunction with the HAS_CHILD_VIEWS_TO_REFRESH
5935
+ * flag.
5894
5936
  */
5895
5937
  RefreshView = 1024,
5896
5938
  /** Indicates that the view **or any of its ancestors** have an embedded view injector. */
@@ -5898,14 +5940,20 @@ declare const enum LViewFlags {
5898
5940
  /** Indicates that the view was created with `signals: true`. */
5899
5941
  SignalView = 4096,
5900
5942
  /**
5901
- * Index of the current init phase on last 21 bits
5943
+ * Indicates that this LView has a view underneath it that needs to be refreshed during change
5944
+ * detection. This flag indicates that even if this view is not dirty itself, we still need to
5945
+ * traverse its children during change detection.
5902
5946
  */
5903
- IndexWithinInitPhaseIncrementer = 8192,
5947
+ HasChildViewsToRefresh = 8192,
5904
5948
  /**
5905
5949
  * This is the count of the bits the 1 was shifted above (base 10)
5906
5950
  */
5907
- IndexWithinInitPhaseShift = 13,
5908
- IndexWithinInitPhaseReset = 8191
5951
+ IndexWithinInitPhaseShift = 14,
5952
+ /**
5953
+ * Index of the current init phase on last 21 bits
5954
+ */
5955
+ IndexWithinInitPhaseIncrementer = 16384,
5956
+ IndexWithinInitPhaseReset = 16383
5909
5957
  }
5910
5958
 
5911
5959
  /**
@@ -7452,92 +7500,6 @@ declare interface ReactiveLViewConsumer extends ReactiveNode {
7452
7500
  lView: LView | null;
7453
7501
  }
7454
7502
 
7455
- /**
7456
- * A producer and/or consumer which participates in the reactive graph.
7457
- *
7458
- * Producer `ReactiveNode`s which are accessed when a consumer `ReactiveNode` is the
7459
- * `activeConsumer` are tracked as dependencies of that consumer.
7460
- *
7461
- * Certain consumers are also tracked as "live" consumers and create edges in the other direction,
7462
- * from producer to consumer. These edges are used to propagate change notifications when a
7463
- * producer's value is updated.
7464
- *
7465
- * A `ReactiveNode` may be both a producer and consumer.
7466
- */
7467
- declare interface ReactiveNode {
7468
- /**
7469
- * Version of the value that this node produces.
7470
- *
7471
- * This is incremented whenever a new value is produced by this node which is not equal to the
7472
- * previous value (by whatever definition of equality is in use).
7473
- */
7474
- version: Version_2;
7475
- /**
7476
- * Whether this node (in its consumer capacity) is dirty.
7477
- *
7478
- * Only live consumers become dirty, when receiving a change notification from a dependency
7479
- * producer.
7480
- */
7481
- dirty: boolean;
7482
- /**
7483
- * Producers which are dependencies of this consumer.
7484
- *
7485
- * Uses the same indices as the `producerLastReadVersion` and `producerIndexOfThis` arrays.
7486
- */
7487
- producerNode: ReactiveNode[] | undefined;
7488
- /**
7489
- * `Version` of the value last read by a given producer.
7490
- *
7491
- * Uses the same indices as the `producerNode` and `producerIndexOfThis` arrays.
7492
- */
7493
- producerLastReadVersion: Version_2[] | undefined;
7494
- /**
7495
- * Index of `this` (consumer) in each producer's `liveConsumers` array.
7496
- *
7497
- * This value is only meaningful if this node is live (`liveConsumers.length > 0`). Otherwise
7498
- * these indices are stale.
7499
- *
7500
- * Uses the same indices as the `producerNode` and `producerLastReadVersion` arrays.
7501
- */
7502
- producerIndexOfThis: number[] | undefined;
7503
- /**
7504
- * Index into the producer arrays that the next dependency of this node as a consumer will use.
7505
- *
7506
- * This index is zeroed before this node as a consumer begins executing. When a producer is read,
7507
- * it gets inserted into the producers arrays at this index. There may be an existing dependency
7508
- * in this location which may or may not match the incoming producer, depending on whether the
7509
- * same producers were read in the same order as the last computation.
7510
- */
7511
- nextProducerIndex: number;
7512
- /**
7513
- * Array of consumers of this producer that are "live" (they require push notifications).
7514
- *
7515
- * `liveConsumerNode.length` is effectively our reference count for this node.
7516
- */
7517
- liveConsumerNode: ReactiveNode[] | undefined;
7518
- /**
7519
- * Index of `this` (producer) in each consumer's `producerNode` array.
7520
- *
7521
- * Uses the same indices as the `liveConsumerNode` array.
7522
- */
7523
- liveConsumerIndexOfThis: number[] | undefined;
7524
- /**
7525
- * Whether writes to signals are allowed when this consumer is the `activeConsumer`.
7526
- *
7527
- * This is used to enforce guardrails such as preventing writes to writable signals in the
7528
- * computation function of computed signals, which is supposed to be pure.
7529
- */
7530
- consumerAllowSignalWrites: boolean;
7531
- readonly consumerIsAlwaysLive: boolean;
7532
- /**
7533
- * Tracks whether producers need to recompute their value independently of the reactive graph (for
7534
- * example, if no initial value has been computed).
7535
- */
7536
- producerMustRecompute(node: unknown): boolean;
7537
- producerRecomputeValue(node: unknown): void;
7538
- consumerMarkedDirty(node: unknown): void;
7539
- }
7540
-
7541
7503
  /**
7542
7504
  * Creates an object that allows to retrieve component metadata.
7543
7505
  *
@@ -8189,13 +8151,6 @@ declare interface SerializedView {
8189
8151
  */
8190
8152
  export declare function setTestabilityGetter(getter: GetTestability): void;
8191
8153
 
8192
- /**
8193
- * Symbol used to tell `Signal`s apart from other functions.
8194
- *
8195
- * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.
8196
- */
8197
- declare const SIGNAL: unique symbol;
8198
-
8199
8154
  /**
8200
8155
  * A reactive value which notifies consumers of any changes.
8201
8156
  *
@@ -8203,8 +8158,6 @@ declare const SIGNAL: unique symbol;
8203
8158
  * call it.
8204
8159
  *
8205
8160
  * Ordinary values can be turned into `Signal`s with the `signal` function.
8206
- *
8207
- * @developerPreview
8208
8161
  */
8209
8162
  export declare type Signal<T> = (() => T) & {
8210
8163
  [SIGNAL]: unknown;
@@ -8212,8 +8165,6 @@ export declare type Signal<T> = (() => T) & {
8212
8165
 
8213
8166
  /**
8214
8167
  * Create a `Signal` that can be set or updated directly.
8215
- *
8216
- * @developerPreview
8217
8168
  */
8218
8169
  export declare function signal<T>(initialValue: T, options?: CreateSignalOptions<T>): WritableSignal<T>;
8219
8170
 
@@ -8391,7 +8342,7 @@ export declare interface StaticClassSansProvider {
8391
8342
  */
8392
8343
  export declare type StaticProvider = ValueProvider | ExistingProvider | StaticClassProvider | ConstructorProvider | FactoryProvider | any[];
8393
8344
 
8394
- declare const T_HOST = 6;
8345
+ declare const T_HOST = 5;
8395
8346
 
8396
8347
  /**
8397
8348
  * A combination of:
@@ -10067,15 +10018,11 @@ export declare interface TypeProvider extends Type<any> {
10067
10018
  /**
10068
10019
  * Execute an arbitrary function in a non-reactive (non-tracking) context. The executed function
10069
10020
  * can, optionally, return a value.
10070
- *
10071
- * @developerPreview
10072
10021
  */
10073
10022
  export declare function untracked<T>(nonReactiveReadsFn: () => T): T;
10074
10023
 
10075
10024
  /**
10076
10025
  * A comparison function which can determine if two values are equal.
10077
- *
10078
- * @developerPreview
10079
10026
  */
10080
10027
  export declare type ValueEqualityFn<T> = (a: T, b: T) => boolean;
10081
10028
 
@@ -10139,10 +10086,6 @@ export declare class Version {
10139
10086
  constructor(full: string);
10140
10087
  }
10141
10088
 
10142
- declare type Version_2 = number & {
10143
- __brand: 'Version';
10144
- };
10145
-
10146
10089
  declare const VIEW_REFS = 8;
10147
10090
 
10148
10091
  /**
@@ -10599,8 +10542,6 @@ declare interface ViewRefTracker {
10599
10542
 
10600
10543
  /**
10601
10544
  * A `Signal` with a value that can be mutated via a setter interface.
10602
- *
10603
- * @developerPreview
10604
10545
  */
10605
10546
  export declare interface WritableSignal<T> extends Signal<T> {
10606
10547
  /**
@@ -10608,15 +10549,10 @@ export declare interface WritableSignal<T> extends Signal<T> {
10608
10549
  */
10609
10550
  set(value: T): void;
10610
10551
  /**
10611
- * Update the value of the signal based on its current value, and
10552
+ * Update the value of the signal based on itfs current value, and
10612
10553
  * notify any dependents.
10613
10554
  */
10614
10555
  update(updateFn: (value: T) => T): void;
10615
- /**
10616
- * Update the current value by mutating it in-place, and
10617
- * notify any dependents.
10618
- */
10619
- mutate(mutatorFn: (value: T) => void): void;
10620
10556
  /**
10621
10557
  * Returns a readonly version of this signal. Readonly signals can be accessed to read their value
10622
10558
  * but can't be changed using set, update or mutate methods. The readonly signals do _not_ have
@@ -11315,6 +11251,11 @@ export declare interface ɵDirectiveDef<T> {
11315
11251
  * The features applied to this directive
11316
11252
  */
11317
11253
  readonly features: DirectiveDefFeature[] | null;
11254
+ /**
11255
+ * Info related to debugging/troubleshooting for this component. This info is only available in
11256
+ * dev mode.
11257
+ */
11258
+ debugInfo: ClassDebugInfo | null;
11318
11259
  /**
11319
11260
  * Function that will add the host directives to the list of matches during directive matching.
11320
11261
  * Patched onto the definition by the `HostDirectivesFeature`.
@@ -11524,6 +11465,38 @@ export declare function ɵgetUnknownPropertyStrictMode(): boolean;
11524
11465
 
11525
11466
  export declare const ɵglobal: any;
11526
11467
 
11468
+ /**
11469
+ * Injection token that configures the image optimized image functionality.
11470
+ * See {@link ImageConfig} for additional information about parameters that
11471
+ * can be used.
11472
+ *
11473
+ * @see {@link NgOptimizedImage}
11474
+ * @see {@link ImageConfig}
11475
+ * @publicApi
11476
+ */
11477
+ export declare const ɵIMAGE_CONFIG: InjectionToken<ɵImageConfig>;
11478
+
11479
+ export declare const ɵIMAGE_CONFIG_DEFAULTS: ɵImageConfig;
11480
+
11481
+ /**
11482
+ * A configuration object for the image-related options. Contains:
11483
+ * - breakpoints: An array of integer breakpoints used to generate
11484
+ * srcsets for responsive images.
11485
+ * - disableImageSizeWarning: A boolean value. Setting this to true will
11486
+ * disable console warnings about oversized images.
11487
+ * - disableImageLazyLoadWarning: A boolean value. Setting this to true will
11488
+ * disable console warnings about LCP images configured with `loading="lazy"`.
11489
+ * Learn more about the responsive image configuration in [the NgOptimizedImage
11490
+ * guide](guide/image-directive).
11491
+ * Learn more about image warning options in [the related error page](errors/NG0913).
11492
+ * @publicApi
11493
+ */
11494
+ export declare type ɵImageConfig = {
11495
+ breakpoints?: number[];
11496
+ disableImageSizeWarning?: boolean;
11497
+ disableImageLazyLoadWarning?: boolean;
11498
+ };
11499
+
11527
11500
  /**
11528
11501
  * *Internal* service that keeps track of pending tasks happening in the system
11529
11502
  * during the initial rendering. No tasks are tracked after an initial
@@ -12214,6 +12187,7 @@ export declare const enum ɵRuntimeErrorCode {
12214
12187
  MISSING_SSR_CONTENT_INTEGRITY_MARKER = -507,
12215
12188
  SIGNAL_WRITE_FROM_ILLEGAL_CONTEXT = 600,
12216
12189
  REQUIRE_SYNC_WITHOUT_SYNC_EMIT = 601,
12190
+ ASSERTION_NOT_INSIDE_REACTIVE_CONTEXT = -602,
12217
12191
  INVALID_I18N_STRUCTURE = 700,
12218
12192
  MISSING_LOCALE_DATA = 701,
12219
12193
  IMPORT_PROVIDERS_FROM_STANDALONE = 800,
@@ -12230,6 +12204,7 @@ export declare const enum ɵRuntimeErrorCode {
12230
12204
  UNSAFE_IFRAME_ATTRS = -910,
12231
12205
  VIEW_ALREADY_DESTROYED = 911,
12232
12206
  COMPONENT_ID_COLLISION = -912,
12207
+ IMAGE_PERFORMANCE_WARNING = -913,
12233
12208
  RUNTIME_DEPS_INVALID_IMPORTED_TYPE = 1000,
12234
12209
  RUNTIME_DEPS_ORPHAN_COMPONENT = 1001
12235
12210
  }
@@ -12294,6 +12269,13 @@ export declare function ɵsetAllowDuplicateNgModuleIdsForTest(allowDuplicates: b
12294
12269
 
12295
12270
  export declare function ɵsetAlternateWeakRefImpl(impl: unknown): void;
12296
12271
 
12272
+ /**
12273
+ * Sets the debug info for an Angular class.
12274
+ *
12275
+ * This runtime is guarded by ngDevMode flag.
12276
+ */
12277
+ export declare function ɵsetClassDebugInfo(type: Type<any>, debugInfo: ClassDebugInfo): void;
12278
+
12297
12279
  /**
12298
12280
  * Adds decorator, constructor, and property metadata to a given type via static metadata fields
12299
12281
  * on the type.
@@ -12396,6 +12378,15 @@ export declare function ɵtransitiveScopesFor<T>(type: Type<T>): ɵNgModuleTrans
12396
12378
  */
12397
12379
  export declare function ɵtriggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView): void;
12398
12380
 
12381
+ /**
12382
+ * Ellipses the string in the middle when longer than the max length
12383
+ *
12384
+ * @param string
12385
+ * @param maxLength of the output string
12386
+ * @returns elispsed string with ... in the middle
12387
+ */
12388
+ export declare function ɵtruncateMiddle(str: string, maxLength?: number): string;
12389
+
12399
12390
  /**
12400
12391
  * Helper function to remove all the locale data from `LOCALE_DATA`.
12401
12392
  */
@@ -12446,6 +12437,11 @@ export declare class ɵViewRef<T> implements EmbeddedViewRef<T>, InternalViewRef
12446
12437
  */
12447
12438
  _cdRefInjectingView?: LView<unknown> | undefined);
12448
12439
  get context(): T;
12440
+ /**
12441
+ * @deprecated Replacing the full context object is not supported. Modify the context
12442
+ * directly, or consider using a `Proxy` if you need to replace the full object.
12443
+ * // TODO(devversion): Remove this.
12444
+ */
12449
12445
  set context(value: T);
12450
12446
  get destroyed(): boolean;
12451
12447
  destroy(): void;
@@ -13425,12 +13421,20 @@ export declare function ɵɵCopyDefinitionFeature(definition: ɵDirectiveDef<any
13425
13421
  * @param errorTmplIndex Index of the template with the error block content.
13426
13422
  * @param loadingConfigIndex Index in the constants array of the configuration of the loading.
13427
13423
  * block.
13428
- * @param placeholderConfigIndexIndex in the constants array of the configuration of the
13424
+ * @param placeholderConfigIndex Index in the constants array of the configuration of the
13429
13425
  * placeholder block.
13426
+ * @param enableTimerScheduling Function that enables timer-related scheduling if `after`
13427
+ * or `minimum` parameters are setup on the `@loading` or `@placeholder` blocks.
13430
13428
  *
13431
13429
  * @codeGenApi
13432
13430
  */
13433
- export declare function ɵɵdefer(index: number, primaryTmplIndex: number, dependencyResolverFn?: DependencyResolverFn | null, loadingTmplIndex?: number | null, placeholderTmplIndex?: number | null, errorTmplIndex?: number | null, loadingConfigIndex?: number | null, placeholderConfigIndex?: number | null): void;
13431
+ export declare function ɵɵdefer(index: number, primaryTmplIndex: number, dependencyResolverFn?: DependencyResolverFn | null, loadingTmplIndex?: number | null, placeholderTmplIndex?: number | null, errorTmplIndex?: number | null, loadingConfigIndex?: number | null, placeholderConfigIndex?: number | null, enableTimerScheduling?: typeof ɵɵdeferEnableTimerScheduling): void;
13432
+
13433
+ /**
13434
+ * Enables timer-related scheduling if `after` or `minimum` parameters are setup
13435
+ * on the `@loading` or `@placeholder` blocks.
13436
+ */
13437
+ export declare function ɵɵdeferEnableTimerScheduling(tView: TView, tDetails: TDeferBlockDetails, placeholderConfigIndex?: number | null, loadingConfigIndex?: number | null): void;
13434
13438
 
13435
13439
  /**
13436
13440
  * Creates runtime data structures for the `on hover` deferred trigger.
@@ -14310,12 +14314,12 @@ export declare function ɵɵpipe(index: number, pipeName: string): any;
14310
14314
  * the pipe only when an input to the pipe changes.
14311
14315
  *
14312
14316
  * @param index Pipe index where the pipe was stored on creation.
14313
- * @param slotOffset the offset in the reserved slot space
14317
+ * @param offset the binding offset
14314
14318
  * @param v1 1st argument to {@link PipeTransform#transform}.
14315
14319
  *
14316
14320
  * @codeGenApi
14317
14321
  */
14318
- export declare function ɵɵpipeBind1(index: number, slotOffset: number, v1: any): any;
14322
+ export declare function ɵɵpipeBind1(index: number, offset: number, v1: any): any;
14319
14323
 
14320
14324
  /**
14321
14325
  * Invokes a pipe with 2 arguments.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "17.0.0-next.6",
3
+ "version": "17.0.0-next.8",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -20,6 +20,12 @@
20
20
  "esm": "./esm2022/core.mjs",
21
21
  "default": "./fesm2022/core.mjs"
22
22
  },
23
+ "./primitives/signals": {
24
+ "types": "./primitives/signals/index.d.ts",
25
+ "esm2022": "./esm2022/primitives/signals/index.mjs",
26
+ "esm": "./esm2022/primitives/signals/index.mjs",
27
+ "default": "./fesm2022/primitives/signals.mjs"
28
+ },
23
29
  "./rxjs-interop": {
24
30
  "types": "./rxjs-interop/index.d.ts",
25
31
  "esm2022": "./esm2022/rxjs-interop/rxjs-interop.mjs",