@angular/core 17.0.0-rc.0 → 17.0.0-rc.2

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 (66) hide show
  1. package/esm2022/primitives/signals/index.mjs +2 -2
  2. package/esm2022/primitives/signals/src/graph.mjs +22 -1
  3. package/esm2022/primitives/signals/src/signal.mjs +7 -3
  4. package/esm2022/rxjs-interop/src/to_signal.mjs +9 -2
  5. package/esm2022/src/application_init.mjs +3 -2
  6. package/esm2022/src/application_ref.mjs +3 -3
  7. package/esm2022/src/application_tokens.mjs +1 -11
  8. package/esm2022/src/change_detection/change_detector_ref.mjs +1 -1
  9. package/esm2022/src/core.mjs +2 -2
  10. package/esm2022/src/core_private_export.mjs +2 -2
  11. package/esm2022/src/defer/cleanup.mjs +23 -53
  12. package/esm2022/src/defer/dom_triggers.mjs +15 -15
  13. package/esm2022/src/defer/idle_scheduler.mjs +20 -17
  14. package/esm2022/src/defer/instructions.mjs +99 -65
  15. package/esm2022/src/defer/interfaces.mjs +3 -1
  16. package/esm2022/src/defer/timer_scheduler.mjs +43 -34
  17. package/esm2022/src/defer/utils.mjs +2 -14
  18. package/esm2022/src/di/r3_injector.mjs +6 -1
  19. package/esm2022/src/errors.mjs +1 -1
  20. package/esm2022/src/hydration/api.mjs +2 -3
  21. package/esm2022/src/hydration/skip_hydration.mjs +7 -7
  22. package/esm2022/src/image_performance_warning.mjs +9 -3
  23. package/esm2022/src/linker/view_container_ref.mjs +4 -6
  24. package/esm2022/src/metadata/directives.mjs +1 -1
  25. package/esm2022/src/metadata/do_bootstrap.mjs +9 -0
  26. package/esm2022/src/metadata.mjs +1 -1
  27. package/esm2022/src/render3/after_render_hooks.mjs +25 -21
  28. package/esm2022/src/render3/assert.mjs +2 -2
  29. package/esm2022/src/render3/debug/injector_profiler.mjs +26 -8
  30. package/esm2022/src/render3/features/standalone_feature.mjs +5 -1
  31. package/esm2022/src/render3/instructions/change_detection.mjs +90 -9
  32. package/esm2022/src/render3/instructions/change_detection_flags.mjs +12 -0
  33. package/esm2022/src/render3/instructions/control_flow.mjs +65 -45
  34. package/esm2022/src/render3/instructions/shared.mjs +22 -42
  35. package/esm2022/src/render3/interfaces/view.mjs +2 -2
  36. package/esm2022/src/render3/node_manipulation.mjs +2 -3
  37. package/esm2022/src/render3/reactive_lview_consumer.mjs +20 -33
  38. package/esm2022/src/render3/reactivity/effect.mjs +22 -6
  39. package/esm2022/src/render3/reactivity/signal.mjs +1 -1
  40. package/esm2022/src/render3/util/injector_discovery_utils.mjs +54 -23
  41. package/esm2022/src/render3/util/view_utils.mjs +1 -4
  42. package/esm2022/src/version.mjs +1 -1
  43. package/esm2022/testing/src/component_fixture.mjs +4 -1
  44. package/esm2022/testing/src/defer.mjs +6 -3
  45. package/esm2022/testing/src/logger.mjs +3 -3
  46. package/fesm2022/core.mjs +17945 -17785
  47. package/fesm2022/core.mjs.map +1 -1
  48. package/fesm2022/primitives/signals.mjs +28 -3
  49. package/fesm2022/primitives/signals.mjs.map +1 -1
  50. package/fesm2022/rxjs-interop.mjs +9 -2
  51. package/fesm2022/rxjs-interop.mjs.map +1 -1
  52. package/fesm2022/testing.mjs +9 -3
  53. package/fesm2022/testing.mjs.map +1 -1
  54. package/index.d.ts +28 -22
  55. package/package.json +2 -2
  56. package/primitives/signals/index.d.ts +14 -1
  57. package/rxjs-interop/index.d.ts +10 -1
  58. package/schematics/migrations/block-template-entities/bundle.js +1671 -918
  59. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  60. package/schematics/ng-generate/control-flow-migration/bundle.js +1927 -1105
  61. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  62. package/schematics/ng-generate/control-flow-migration/schema.json +9 -2
  63. package/schematics/ng-generate/standalone-migration/bundle.js +2932 -2065
  64. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  65. package/testing/index.d.ts +1 -1
  66. package/esm2022/src/metadata/do_boostrap.mjs +0 -9
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-rc.0
2
+ * @license Angular v17.0.0-rc.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -477,7 +477,7 @@ export declare const APP_ID: InjectionToken<string>;
477
477
  * ```
478
478
  *
479
479
  * ### Example with standalone application
480
- *
480
+ * ```
481
481
  * function initializeAppFactory(httpClient: HttpClient): () => Observable<any> {
482
482
  * return () => httpClient.get("https://someUrl.com/api/user")
483
483
  * .pipe(
@@ -496,6 +496,7 @@ export declare const APP_ID: InjectionToken<string>;
496
496
  * },
497
497
  * ],
498
498
  * });
499
+ * ```
499
500
  *
500
501
  * @publicApi
501
502
  */
@@ -1056,6 +1057,10 @@ export declare abstract class ChangeDetectorRef {
1056
1057
  *
1057
1058
  * Use in development mode to verify that running change detection doesn't introduce
1058
1059
  * other changes. Calling it in production mode is a noop.
1060
+ *
1061
+ * @deprecated This is a test-only API that does not have a place in production interface.
1062
+ * `checkNoChanges` is already part of an `ApplicationRef` tick when the app is running in dev
1063
+ * mode. For more granular `checkNoChanges` validation, use `ComponentFixture`.
1059
1064
  */
1060
1065
  abstract checkNoChanges(): void;
1061
1066
  /**
@@ -3383,6 +3388,8 @@ export declare interface EffectRef {
3383
3388
  destroy(): void;
3384
3389
  }
3385
3390
 
3391
+ declare const EFFECTS_TO_SCHEDULE = 22;
3392
+
3386
3393
  /**
3387
3394
  * Keys within serialized view data structure to represent various
3388
3395
  * parts. See the `SerializedView` interface below for additional information.
@@ -5869,6 +5876,10 @@ declare interface LView<T = unknown> extends Array<any> {
5869
5876
  * precedence over the element and module injectors.
5870
5877
  */
5871
5878
  readonly [EMBEDDED_VIEW_INJECTOR]: Injector | null;
5879
+ /**
5880
+ * Effect scheduling operations that need to run during this views's update pass.
5881
+ */
5882
+ [EFFECTS_TO_SCHEDULE]: Array<() => void> | null;
5872
5883
  /**
5873
5884
  * A collection of callbacks functions that are executed when a given LView is destroyed. Those
5874
5885
  * are user defined, LView-specific destroy callbacks that don't have any corresponding TView
@@ -5882,10 +5893,6 @@ declare interface LView<T = unknown> extends Array<any> {
5882
5893
  * if any signals were read.
5883
5894
  */
5884
5895
  [REACTIVE_TEMPLATE_CONSUMER]: ReactiveLViewConsumer | null;
5885
- /**
5886
- * Same as REACTIVE_TEMPLATE_CONSUMER, but for the host bindings of the LView.
5887
- */
5888
- [REACTIVE_HOST_BINDING_CONSUMER]: ReactiveLViewConsumer | null;
5889
5896
  }
5890
5897
 
5891
5898
  /**
@@ -7103,7 +7110,7 @@ export declare type ProviderToken<T> = Type<T> | AbstractType<T> | InjectionToke
7103
7110
  * `BootstrapOptions` instead.
7104
7111
  *
7105
7112
  * @usageNotes
7106
- * ```typescript=
7113
+ * ```typescript
7107
7114
  * bootstrapApplication(MyApp, {providers: [
7108
7115
  * provideZoneChangeDetection({eventCoalescing: true}),
7109
7116
  * ]});
@@ -7501,12 +7508,11 @@ declare interface RDomTokenList {
7501
7508
  remove(token: string): void;
7502
7509
  }
7503
7510
 
7504
- declare const REACTIVE_HOST_BINDING_CONSUMER = 24;
7505
-
7506
7511
  declare const REACTIVE_TEMPLATE_CONSUMER = 23;
7507
7512
 
7508
7513
  declare interface ReactiveLViewConsumer extends ReactiveNode {
7509
7514
  lView: LView | null;
7515
+ slot: typeof REACTIVE_TEMPLATE_CONSUMER;
7510
7516
  }
7511
7517
 
7512
7518
  /**
@@ -10558,7 +10564,7 @@ export declare interface WritableSignal<T> extends Signal<T> {
10558
10564
  */
10559
10565
  set(value: T): void;
10560
10566
  /**
10561
- * Update the value of the signal based on itfs current value, and
10567
+ * Update the value of the signal based on its current value, and
10562
10568
  * notify any dependents.
10563
10569
  */
10564
10570
  update(updateFn: (value: T) => T): void;
@@ -11314,14 +11320,6 @@ export declare abstract class ɵEffectScheduler {
11314
11320
  static ɵprov: unknown;
11315
11321
  }
11316
11322
 
11317
- /**
11318
- * Internal token to collect all SSR-related features enabled for this application.
11319
- *
11320
- * Note: the token is in `core` to let other packages register features (the `core`
11321
- * package is imported in other packages).
11322
- */
11323
- export declare const ɵENABLED_SSR_FEATURES: InjectionToken<Set<string>>;
11324
-
11325
11323
  /**
11326
11324
  * Index of each type of locale data from the extra locale data array
11327
11325
  */
@@ -12080,8 +12078,12 @@ export declare class ɵRender3NgModuleRef<T> extends NgModuleRef<T> implements I
12080
12078
  * @param newState New state that should be applied to the defer block.
12081
12079
  * @param tNode TNode that represents a defer block.
12082
12080
  * @param lContainer Represents an instance of a defer block.
12081
+ * @param skipTimerScheduling Indicates that `@loading` and `@placeholder` block
12082
+ * should be rendered immediately, even if they have `after` or `minimum` config
12083
+ * options setup. This flag to needed for testing APIs to transition defer block
12084
+ * between states via `DeferFixture.render` method.
12083
12085
  */
12084
- export declare function ɵrenderDeferBlockState(newState: ɵDeferBlockState, tNode: TNode, lContainer: LContainer): void;
12086
+ export declare function ɵrenderDeferBlockState(newState: ɵDeferBlockState, tNode: TNode, lContainer: LContainer, skipTimerScheduling?: boolean): void;
12085
12087
 
12086
12088
  /**
12087
12089
  * Flags passed into template functions to determine which blocks (i.e. creation, update)
@@ -12182,6 +12184,7 @@ export declare const enum ɵRuntimeErrorCode {
12182
12184
  EXPRESSION_CHANGED_AFTER_CHECKED = -100,
12183
12185
  RECURSIVE_APPLICATION_REF_TICK = 101,
12184
12186
  RECURSIVE_APPLICATION_RENDER = 102,
12187
+ INFINITE_CHANGE_DETECTION = 103,
12185
12188
  CYCLIC_DI_DEPENDENCY = -200,
12186
12189
  PROVIDER_NOT_FOUND = -201,
12187
12190
  INVALID_FACTORY_DEPENDENCY = 202,
@@ -12201,7 +12204,7 @@ export declare const enum ɵRuntimeErrorCode {
12201
12204
  INVALID_EVENT_BINDING = 306,
12202
12205
  HOST_DIRECTIVE_UNRESOLVABLE = 307,
12203
12206
  HOST_DIRECTIVE_NOT_STANDALONE = 308,
12204
- DUPLICATE_DIRECTITVE = 309,
12207
+ DUPLICATE_DIRECTIVE = 309,
12205
12208
  HOST_DIRECTIVE_COMPONENT = 310,
12206
12209
  HOST_DIRECTIVE_UNDEFINED_BINDING = 311,
12207
12210
  HOST_DIRECTIVE_CONFLICTING_ALIAS = 312,
@@ -12227,6 +12230,7 @@ export declare const enum ɵRuntimeErrorCode {
12227
12230
  ASSERTION_NOT_INSIDE_REACTIVE_CONTEXT = -602,
12228
12231
  INVALID_I18N_STRUCTURE = 700,
12229
12232
  MISSING_LOCALE_DATA = 701,
12233
+ DEFER_LOADING_FAILED = 750,
12230
12234
  IMPORT_PROVIDERS_FROM_STANDALONE = 800,
12231
12235
  INVALID_DIFFER_INPUT = 900,
12232
12236
  NO_SUPPORTING_DIFFER_FACTORY = 901,
@@ -12413,7 +12417,7 @@ export declare function ɵtransitiveScopesFor<T>(type: Type<T>): ɵNgModuleTrans
12413
12417
  * @param tDetails Static information about this defer block.
12414
12418
  * @param lView LView of a host view.
12415
12419
  */
12416
- export declare function ɵtriggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView): void;
12420
+ export declare function ɵtriggerResourceLoading(tDetails: TDeferBlockDetails, lView: LView, tNode: TNode): void;
12417
12421
 
12418
12422
  /**
12419
12423
  * Ellipses the string in the middle when longer than the max length
@@ -15131,6 +15135,8 @@ export declare function ɵɵrepeater(metadataSlotIdx: number, collection: Iterab
15131
15135
  * @param templateFn Reference to the template of the main repeater block.
15132
15136
  * @param decls The number of nodes, local refs, and pipes for the main block.
15133
15137
  * @param vars The number of bindings for the main block.
15138
+ * @param tagName The name of the container element, if applicable
15139
+ * @param attrsIndex Index of template attributes in the `consts` array.
15134
15140
  * @param trackByFn Reference to the tracking function.
15135
15141
  * @param trackByUsesComponentInstance Whether the tracking function has any references to the
15136
15142
  * component instance. If it doesn't, we can avoid rebinding it.
@@ -15140,7 +15146,7 @@ export declare function ɵɵrepeater(metadataSlotIdx: number, collection: Iterab
15140
15146
  *
15141
15147
  * @codeGenApi
15142
15148
  */
15143
- export declare function ɵɵrepeaterCreate(index: number, templateFn: ComponentTemplate<unknown>, decls: number, vars: number, trackByFn: TrackByFunction<unknown>, trackByUsesComponentInstance?: boolean, emptyTemplateFn?: ComponentTemplate<unknown>, emptyDecls?: number, emptyVars?: number): void;
15149
+ export declare function ɵɵrepeaterCreate(index: number, templateFn: ComponentTemplate<unknown>, decls: number, vars: number, tagName: string | null, attrsIndex: number | null, trackByFn: TrackByFunction<unknown>, trackByUsesComponentInstance?: boolean, emptyTemplateFn?: ComponentTemplate<unknown>, emptyDecls?: number, emptyVars?: number): void;
15144
15150
 
15145
15151
  /**
15146
15152
  * A built-in trackBy function used for situations where users specified collection item reference
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "17.0.0-rc.0",
3
+ "version": "17.0.0-rc.2",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
7
7
  "engines": {
8
- "node": ">=18.13.0"
8
+ "node": "^18.13.0 || >=20.9.0"
9
9
  },
10
10
  "exports": {
11
11
  "./schematics/*": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-rc.0
2
+ * @license Angular v17.0.0-rc.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -53,6 +53,12 @@ export declare function consumerBeforeComputation(node: ReactiveNode | null): Re
53
53
  */
54
54
  export declare function consumerDestroy(node: ReactiveNode): void;
55
55
 
56
+ /**
57
+ * Determine whether this consumer has any dependencies which have changed since the last time
58
+ * they were read.
59
+ */
60
+ export declare function consumerPollProducersForChange(node: ReactiveNode): boolean;
61
+
56
62
  /**
57
63
  * Create a computed signal which derives a reactive value from an expression.
58
64
  */
@@ -123,6 +129,13 @@ export declare interface ReactiveNode {
123
129
  * previous value (by whatever definition of equality is in use).
124
130
  */
125
131
  version: Version;
132
+ /**
133
+ * Epoch at which this node is verified to be clean.
134
+ *
135
+ * This allows skipping of some polling operations in the case where no signals have been set
136
+ * since this node was last read.
137
+ */
138
+ lastCleanEpoch: Version;
126
139
  /**
127
140
  * Whether this node (in its consumer capacity) is dirty.
128
141
  *
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v17.0.0-rc.0
2
+ * @license Angular v17.0.0-rc.2
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -108,6 +108,15 @@ export declare interface ToSignalOptions {
108
108
  * until the `Observable` itself completes.
109
109
  */
110
110
  manualCleanup?: boolean;
111
+ /**
112
+ * Whether `toSignal` should throw errors from the Observable error channel back to RxJS, where
113
+ * they'll be processed as uncaught exceptions.
114
+ *
115
+ * In practice, this means that the signal returned by `toSignal` will keep returning the last
116
+ * good value forever, as Observables which error produce no further values. This option emulates
117
+ * the behavior of the `async` pipe.
118
+ */
119
+ rejectErrors?: boolean;
111
120
  }
112
121
 
113
122
  export { }