@angular/core 20.0.0-next.2 → 20.0.0-next.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 (49) hide show
  1. package/fesm2022/core.mjs +413 -365
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/di.mjs +3 -2
  4. package/fesm2022/primitives/di.mjs.map +1 -1
  5. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  6. package/fesm2022/primitives/signals.mjs +28 -7
  7. package/fesm2022/primitives/signals.mjs.map +1 -1
  8. package/fesm2022/rxjs-interop.mjs +1 -8
  9. package/fesm2022/rxjs-interop.mjs.map +1 -1
  10. package/fesm2022/testing.mjs +2 -10
  11. package/fesm2022/testing.mjs.map +1 -1
  12. package/fesm2022/weak_ref-DrMdAIDh.mjs +1 -1
  13. package/index.d.ts +7523 -7489
  14. package/navigation_types.d-u4EOrrdZ.d.ts +1 -1
  15. package/package.json +2 -2
  16. package/primitives/di/index.d.ts +25 -10
  17. package/primitives/event-dispatch/index.d.ts +1 -1
  18. package/primitives/signals/index.d.ts +9 -6
  19. package/rxjs-interop/index.d.ts +1 -10
  20. package/schematics/bundles/{apply_import_manager-CyRT0UvU.js → apply_import_manager-BXQEjo09.js} +6 -6
  21. package/schematics/bundles/{checker-DF8ZaFW5.js → checker-BHb19MHt.js} +629 -71
  22. package/schematics/bundles/cleanup-unused-imports.js +42 -69
  23. package/schematics/bundles/{compiler_host-Da636uJ8.js → compiler_host-Bk3repE2.js} +2 -2
  24. package/schematics/bundles/control-flow-migration.js +3 -3
  25. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  26. package/schematics/bundles/{index-DnkWgagp.js → index-BL9kAIe5.js} +11 -11
  27. package/schematics/bundles/{program-BZk27Ndu.js → index-I8VbxQcO.js} +2234 -2097
  28. package/schematics/bundles/inject-flags.js +18 -52
  29. package/schematics/bundles/inject-migration.js +3 -3
  30. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  31. package/schematics/bundles/{migrate_ts_type_references-DtkOnnv0.js → migrate_ts_type_references-KlOTWeDl.js} +20 -20
  32. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  33. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  34. package/schematics/bundles/output-migration.js +62 -90
  35. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  36. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  37. package/schematics/bundles/route-lazy-loading.js +3 -3
  38. package/schematics/bundles/{project_paths-Jtbi76Bs.js → run_in_devkit-C0JPtK2u.js} +262 -197
  39. package/schematics/bundles/self-closing-tags-migration.js +41 -71
  40. package/schematics/bundles/signal-input-migration.js +69 -97
  41. package/schematics/bundles/signal-queries-migration.js +80 -108
  42. package/schematics/bundles/signals.js +11 -11
  43. package/schematics/bundles/standalone-migration.js +8 -22
  44. package/schematics/bundles/symbol-VPWguRxr.js +25 -0
  45. package/schematics/bundles/test-bed-get.js +98 -0
  46. package/schematics/migrations.json +5 -0
  47. package/testing/index.d.ts +1 -3
  48. package/weak_ref.d-ttyj86RV.d.ts +1 -1
  49. package/schematics/bundles/index-vGJcp5M7.js +0 -30
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.2
2
+ * @license Angular v20.0.0-next.3
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "20.0.0-next.2",
3
+ "version": "20.0.0-next.3",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -46,7 +46,7 @@
46
46
  "tslib": "^2.3.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@angular/compiler": "20.0.0-next.2",
49
+ "@angular/compiler": "20.0.0-next.3",
50
50
  "rxjs": "^6.5.3 || ^7.4.0",
51
51
  "zone.js": "~0.15.0"
52
52
  },
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.2
2
+ * @license Angular v20.0.0-next.3
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -20,18 +20,32 @@ interface Type<T> extends Function {
20
20
  }
21
21
 
22
22
  /**
23
- * Information about how a type or `InjectionToken` interfaces with the DI system.
23
+ * Information about how a type or `InjectionToken` interfaces with the DI
24
+ * system. This describes:
24
25
  *
25
- * At a minimum, this includes a `factory` which defines how to create the given type `T`, possibly
26
- * requesting injection of other types if necessary.
26
+ * 1. *How* the type is provided
27
+ * The declaration must specify only one of the following:
28
+ * - A `value` which is a predefined instance of the type.
29
+ * - A `factory` which defines how to create the given type `T`, possibly
30
+ * requesting injection of other types if necessary.
31
+ * - Neither, in which case the type is expected to already be present in the
32
+ * injector hierarchy. This is used for internal use cases.
27
33
  *
28
- * Optionally, a `providedIn` parameter specifies that the given type belongs to a particular
29
- * `Injector`, `NgModule`, or a special scope (e.g. `'root'`). A value of `null` indicates
30
- * that the injectable does not belong to any scope.
34
+ * 2. *Where* the type is stored (if it is stored)
35
+ * - The `providedIn` parameter specifies which injector the type belongs to.
36
+ * - The `token` is used as the key to store the type in the injector.
31
37
  */
32
38
  interface ɵɵInjectableDeclaration<T> {
33
39
  /**
34
- * Specifies that the given type belongs to a particular injector:
40
+ * Specifies that the given type belongs to a particular `Injector`,
41
+ * `NgModule`, or a special scope (e.g. `'root'`).
42
+ *
43
+ * `any` is deprecated and will be removed soon.
44
+ *
45
+ * A value of `null` indicates that the injectable does not belong to any
46
+ * scope, and won't be stored in any injector. For declarations with a
47
+ * factory, this will create a new instance of the type each time it is
48
+ * requested.
35
49
  */
36
50
  providedIn: Type<any> | 'root' | 'platform' | 'any' | null;
37
51
  /**
@@ -43,11 +57,11 @@ interface ɵɵInjectableDeclaration<T> {
43
57
  /**
44
58
  * Factory method to execute to create an instance of the injectable.
45
59
  */
46
- factory: (t?: Type<any>) => T;
60
+ factory?: (t?: Type<any>) => T;
47
61
  /**
48
62
  * In a case of no explicit injector, a location where the instance of the injectable is stored.
49
63
  */
50
- value: T | undefined;
64
+ value?: T;
51
65
  }
52
66
  /**
53
67
  * A `Type` which has a `ɵprov: ɵɵInjectableDeclaration` static field.
@@ -71,6 +85,7 @@ declare const NOT_FOUND: unique symbol;
71
85
  * hierarchy. Context can be attached below.
72
86
  */
73
87
  declare class NotFoundError extends Error {
88
+ readonly name: string;
74
89
  constructor(message: string);
75
90
  }
76
91
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.2
2
+ * @license Angular v20.0.0-next.3
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 v20.0.0-next.2
2
+ * @license Angular v20.0.0-next.3
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -18,6 +18,7 @@ declare function defaultEquals<T>(a: T, b: T): boolean;
18
18
  type Version = number & {
19
19
  __brand: 'Version';
20
20
  };
21
+ type ReactiveHookFn = (node: ReactiveNode) => void;
21
22
  /**
22
23
  * Symbol used to tell `Signal`s apart from other functions.
23
24
  *
@@ -189,6 +190,8 @@ declare function consumerPollProducersForChange(node: ReactiveNode): boolean;
189
190
  * Disconnect this consumer from the graph.
190
191
  */
191
192
  declare function consumerDestroy(node: ReactiveNode): void;
193
+ declare function runPostProducerCreatedFn(node: ReactiveNode): void;
194
+ declare function setPostProducerCreatedFn(fn: ReactiveHookFn | null): ReactiveHookFn | null;
192
195
 
193
196
  /**
194
197
  * A computation, which derives a value from a declarative reactive expression.
@@ -218,7 +221,7 @@ type ComputedGetter<T> = (() => T) & {
218
221
  /**
219
222
  * Create a computed signal which derives a reactive value from an expression.
220
223
  */
221
- declare function createComputed<T>(computation: () => T): ComputedGetter<T>;
224
+ declare function createComputed<T>(computation: () => T, equal?: ValueEqualityFn<T>): ComputedGetter<T>;
222
225
 
223
226
  type ComputationFn<S, D> = (source: S, previous?: {
224
227
  source: S;
@@ -269,11 +272,11 @@ interface SignalGetter<T> extends SignalBaseGetter<T> {
269
272
  /**
270
273
  * Create a `Signal` that can be set or updated directly.
271
274
  */
272
- declare function createSignal<T>(initialValue: T): SignalGetter<T>;
273
- declare function setPostSignalSetFn(fn: (() => void) | null): (() => void) | null;
275
+ declare function createSignal<T>(initialValue: T, equal?: ValueEqualityFn<T>): SignalGetter<T>;
276
+ declare function setPostSignalSetFn(fn: ReactiveHookFn | null): ReactiveHookFn | null;
274
277
  declare function signalSetFn<T>(node: SignalNode<T>, newValue: T): void;
275
278
  declare function signalUpdateFn<T>(node: SignalNode<T>, updater: (value: T) => T): void;
276
- declare function runPostSignalSetFn(): void;
279
+ declare function runPostSignalSetFn<T>(node: SignalNode<T>): void;
277
280
  declare const SIGNAL_NODE: SignalNode<unknown>;
278
281
 
279
282
  declare function setThrowInvalidWriteToSignalError(fn: <T>(node: SignalNode<T>) => never): void;
@@ -320,4 +323,4 @@ declare function createWatch(fn: (onCleanup: WatchCleanupRegisterFn) => void, sc
320
323
  */
321
324
  declare function untracked<T>(nonReactiveReadsFn: () => T): T;
322
325
 
323
- export { type ComputationFn, type ComputedNode, type LinkedSignalGetter, type LinkedSignalNode, REACTIVE_NODE, type Reactive, type ReactiveNode, SIGNAL, SIGNAL_NODE, type SignalGetter, type SignalNode, type ValueEqualityFn, type Watch, type WatchCleanupFn, type WatchCleanupRegisterFn, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, createComputed, createLinkedSignal, createSignal, createWatch, defaultEquals, getActiveConsumer, isInNotificationPhase, isReactive, linkedSignalSetFn, linkedSignalUpdateFn, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, runPostSignalSetFn, setActiveConsumer, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalSetFn, signalUpdateFn, untracked };
326
+ export { type ComputationFn, type ComputedNode, type LinkedSignalGetter, type LinkedSignalNode, REACTIVE_NODE, type Reactive, type ReactiveHookFn, type ReactiveNode, SIGNAL, SIGNAL_NODE, type SignalGetter, type SignalNode, type ValueEqualityFn, type Watch, type WatchCleanupFn, type WatchCleanupRegisterFn, consumerAfterComputation, consumerBeforeComputation, consumerDestroy, consumerMarkDirty, consumerPollProducersForChange, createComputed, createLinkedSignal, createSignal, createWatch, defaultEquals, getActiveConsumer, isInNotificationPhase, isReactive, linkedSignalSetFn, linkedSignalUpdateFn, producerAccessed, producerIncrementEpoch, producerMarkClean, producerNotifyConsumers, producerUpdateValueVersion, producerUpdatesAllowed, runPostProducerCreatedFn, runPostSignalSetFn, setActiveConsumer, setPostProducerCreatedFn, setPostSignalSetFn, setThrowInvalidWriteToSignalError, signalSetFn, signalUpdateFn, untracked };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.2
2
+ * @license Angular v20.0.0-next.3
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -117,15 +117,6 @@ interface ToSignalOptions<T> {
117
117
  * until the `Observable` itself completes.
118
118
  */
119
119
  manualCleanup?: boolean;
120
- /**
121
- * Whether `toSignal` should throw errors from the Observable error channel back to RxJS, where
122
- * they'll be processed as uncaught exceptions.
123
- *
124
- * In practice, this means that the signal returned by `toSignal` will keep returning the last
125
- * good value forever, as Observables which error produce no further values. This option emulates
126
- * the behavior of the `async` pipe.
127
- */
128
- rejectErrors?: boolean;
129
120
  /**
130
121
  * A comparison function which defines equality for values emitted by the observable.
131
122
  *
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.2
3
+ * @license Angular v20.0.0-next.3
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-DF8ZaFW5.js');
12
- var project_paths = require('./project_paths-Jtbi76Bs.js');
11
+ var checker = require('./checker-BHb19MHt.js');
12
+ var run_in_devkit = require('./run_in_devkit-C0JPtK2u.js');
13
13
 
14
14
  /**
15
15
  * Applies import manager changes, and writes them as replacements the
@@ -23,7 +23,7 @@ function applyImportManagerChanges(importManager, replacements, sourceFiles, inf
23
23
  newImports.forEach((newImports, fileName) => {
24
24
  newImports.forEach((newImport) => {
25
25
  const printedImport = printer.printNode(ts.EmitHint.Unspecified, newImport, pathToFile.get(fileName));
26
- replacements.push(new project_paths.Replacement(project_paths.projectFile(checker.absoluteFrom(fileName), info), new project_paths.TextUpdate({ position: 0, end: 0, toInsert: `${printedImport}\n` })));
26
+ replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(checker.absoluteFrom(fileName), info), new run_in_devkit.TextUpdate({ position: 0, end: 0, toInsert: `${printedImport}\n` })));
27
27
  });
28
28
  });
29
29
  // Capture updated imports
@@ -46,7 +46,7 @@ function applyImportManagerChanges(importManager, replacements, sourceFiles, inf
46
46
  formatFlags &= ~ts.ListFormat.SpaceBetweenBraces;
47
47
  }
48
48
  const printedBindings = printer.printList(formatFlags, newBindings.elements, oldBindings.getSourceFile());
49
- replacements.push(new project_paths.Replacement(project_paths.projectFile(oldBindings.getSourceFile(), info), new project_paths.TextUpdate({
49
+ replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(oldBindings.getSourceFile(), info), new run_in_devkit.TextUpdate({
50
50
  position: oldBindings.getStart(),
51
51
  end: oldBindings.getEnd(),
52
52
  // TS uses four spaces as indent. We migrate to two spaces as we
@@ -56,7 +56,7 @@ function applyImportManagerChanges(importManager, replacements, sourceFiles, inf
56
56
  }
57
57
  // Update removed imports
58
58
  for (const removedImport of deletedImports) {
59
- replacements.push(new project_paths.Replacement(project_paths.projectFile(removedImport.getSourceFile(), info), new project_paths.TextUpdate({
59
+ replacements.push(new run_in_devkit.Replacement(run_in_devkit.projectFile(removedImport.getSourceFile(), info), new run_in_devkit.TextUpdate({
60
60
  position: removedImport.getStart(),
61
61
  end: removedImport.getEnd(),
62
62
  toInsert: '',