@angular/core 20.0.0-next.2 → 20.0.0-next.4

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 (56) hide show
  1. package/event_dispatcher.d-pVP0-wST.d.ts +345 -0
  2. package/fesm2022/core.mjs +614 -428
  3. package/fesm2022/core.mjs.map +1 -1
  4. package/fesm2022/injector-BlLwZ2sr.mjs +24 -0
  5. package/fesm2022/injector-BlLwZ2sr.mjs.map +1 -0
  6. package/fesm2022/primitives/di.mjs +5 -18
  7. package/fesm2022/primitives/di.mjs.map +1 -1
  8. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  9. package/fesm2022/primitives/signals.mjs +4 -589
  10. package/fesm2022/primitives/signals.mjs.map +1 -1
  11. package/fesm2022/rxjs-interop.mjs +1 -8
  12. package/fesm2022/rxjs-interop.mjs.map +1 -1
  13. package/fesm2022/testing.mjs +2 -10
  14. package/fesm2022/testing.mjs.map +1 -1
  15. package/fesm2022/untracked-DkcXpNb_.mjs +620 -0
  16. package/fesm2022/untracked-DkcXpNb_.mjs.map +1 -0
  17. package/index.d.ts +7589 -7510
  18. package/{navigation_types.d-u4EOrrdZ.d.ts → navigation_types.d-DgDrF5rp.d.ts} +2 -2
  19. package/package.json +2 -2
  20. package/primitives/di/index.d.ts +25 -10
  21. package/primitives/event-dispatch/index.d.ts +5 -340
  22. package/primitives/signals/index.d.ts +5 -208
  23. package/rxjs-interop/index.d.ts +1 -10
  24. package/schematics/bundles/{apply_import_manager-CyRT0UvU.js → apply_import_manager-CeNv8GIG.js} +6 -6
  25. package/schematics/bundles/{checker-DF8ZaFW5.js → checker-k591b6WQ.js} +856 -180
  26. package/schematics/bundles/cleanup-unused-imports.js +42 -69
  27. package/schematics/bundles/{compiler_host-Da636uJ8.js → compiler_host-DwM3ugW3.js} +2 -2
  28. package/schematics/bundles/control-flow-migration.js +34 -13
  29. package/schematics/bundles/imports-CIX-JgAN.js +1 -1
  30. package/schematics/bundles/{program-BZk27Ndu.js → index-B4OAlHh8.js} +2234 -2097
  31. package/schematics/bundles/{index-DnkWgagp.js → index-BhELUmYx.js} +11 -11
  32. package/schematics/bundles/inject-flags.js +18 -52
  33. package/schematics/bundles/inject-migration.js +3 -3
  34. package/schematics/bundles/leading_space-D9nQ8UQC.js +1 -1
  35. package/schematics/bundles/{migrate_ts_type_references-DtkOnnv0.js → migrate_ts_type_references-Be0TNYen.js} +20 -20
  36. package/schematics/bundles/ng_decorators-DznZ5jMl.js +1 -1
  37. package/schematics/bundles/nodes-B16H9JUd.js +1 -1
  38. package/schematics/bundles/output-migration.js +62 -90
  39. package/schematics/bundles/project_tsconfig_paths-CDVxT6Ov.js +1 -1
  40. package/schematics/bundles/property_name-BBwFuqMe.js +1 -1
  41. package/schematics/bundles/route-lazy-loading.js +3 -3
  42. package/schematics/bundles/{project_paths-Jtbi76Bs.js → run_in_devkit-CkvEksWP.js} +262 -197
  43. package/schematics/bundles/self-closing-tags-migration.js +41 -71
  44. package/schematics/bundles/signal-input-migration.js +69 -97
  45. package/schematics/bundles/signal-queries-migration.js +80 -108
  46. package/schematics/bundles/signals.js +11 -11
  47. package/schematics/bundles/standalone-migration.js +8 -22
  48. package/schematics/bundles/symbol-VPWguRxr.js +25 -0
  49. package/schematics/bundles/test-bed-get.js +98 -0
  50. package/schematics/migrations.json +5 -0
  51. package/testing/index.d.ts +2 -4
  52. package/weak_ref.d-BZ7gyRag.d.ts +216 -0
  53. package/fesm2022/weak_ref-DrMdAIDh.mjs +0 -12
  54. package/fesm2022/weak_ref-DrMdAIDh.mjs.map +0 -1
  55. package/schematics/bundles/index-vGJcp5M7.js +0 -30
  56. package/weak_ref.d-ttyj86RV.d.ts +0 -9
@@ -1,194 +1,11 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.2
2
+ * @license Angular v20.0.0-next.4
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
- export { s as setAlternateWeakRefImpl } from '../../weak_ref.d-ttyj86RV.js';
8
-
9
- /**
10
- * A comparison function which can determine if two values are equal.
11
- */
12
- type ValueEqualityFn<T> = (a: T, b: T) => boolean;
13
- /**
14
- * The default equality function used for `signal` and `computed`, which uses referential equality.
15
- */
16
- declare function defaultEquals<T>(a: T, b: T): boolean;
17
-
18
- type Version = number & {
19
- __brand: 'Version';
20
- };
21
- /**
22
- * Symbol used to tell `Signal`s apart from other functions.
23
- *
24
- * This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.
25
- */
26
- declare const SIGNAL: unique symbol;
27
- declare function setActiveConsumer(consumer: ReactiveNode | null): ReactiveNode | null;
28
- declare function getActiveConsumer(): ReactiveNode | null;
29
- declare function isInNotificationPhase(): boolean;
30
- interface Reactive {
31
- [SIGNAL]: ReactiveNode;
32
- }
33
- declare function isReactive(value: unknown): value is Reactive;
34
- declare const REACTIVE_NODE: ReactiveNode;
35
- /**
36
- * A producer and/or consumer which participates in the reactive graph.
37
- *
38
- * Producer `ReactiveNode`s which are accessed when a consumer `ReactiveNode` is the
39
- * `activeConsumer` are tracked as dependencies of that consumer.
40
- *
41
- * Certain consumers are also tracked as "live" consumers and create edges in the other direction,
42
- * from producer to consumer. These edges are used to propagate change notifications when a
43
- * producer's value is updated.
44
- *
45
- * A `ReactiveNode` may be both a producer and consumer.
46
- */
47
- interface ReactiveNode {
48
- /**
49
- * Version of the value that this node produces.
50
- *
51
- * This is incremented whenever a new value is produced by this node which is not equal to the
52
- * previous value (by whatever definition of equality is in use).
53
- */
54
- version: Version;
55
- /**
56
- * Epoch at which this node is verified to be clean.
57
- *
58
- * This allows skipping of some polling operations in the case where no signals have been set
59
- * since this node was last read.
60
- */
61
- lastCleanEpoch: Version;
62
- /**
63
- * Whether this node (in its consumer capacity) is dirty.
64
- *
65
- * Only live consumers become dirty, when receiving a change notification from a dependency
66
- * producer.
67
- */
68
- dirty: boolean;
69
- /**
70
- * Producers which are dependencies of this consumer.
71
- *
72
- * Uses the same indices as the `producerLastReadVersion` and `producerIndexOfThis` arrays.
73
- */
74
- producerNode: ReactiveNode[] | undefined;
75
- /**
76
- * `Version` of the value last read by a given producer.
77
- *
78
- * Uses the same indices as the `producerNode` and `producerIndexOfThis` arrays.
79
- */
80
- producerLastReadVersion: Version[] | undefined;
81
- /**
82
- * Index of `this` (consumer) in each producer's `liveConsumers` array.
83
- *
84
- * This value is only meaningful if this node is live (`liveConsumers.length > 0`). Otherwise
85
- * these indices are stale.
86
- *
87
- * Uses the same indices as the `producerNode` and `producerLastReadVersion` arrays.
88
- */
89
- producerIndexOfThis: number[] | undefined;
90
- /**
91
- * Index into the producer arrays that the next dependency of this node as a consumer will use.
92
- *
93
- * This index is zeroed before this node as a consumer begins executing. When a producer is read,
94
- * it gets inserted into the producers arrays at this index. There may be an existing dependency
95
- * in this location which may or may not match the incoming producer, depending on whether the
96
- * same producers were read in the same order as the last computation.
97
- */
98
- nextProducerIndex: number;
99
- /**
100
- * Array of consumers of this producer that are "live" (they require push notifications).
101
- *
102
- * `liveConsumerNode.length` is effectively our reference count for this node.
103
- */
104
- liveConsumerNode: ReactiveNode[] | undefined;
105
- /**
106
- * Index of `this` (producer) in each consumer's `producerNode` array.
107
- *
108
- * Uses the same indices as the `liveConsumerNode` array.
109
- */
110
- liveConsumerIndexOfThis: number[] | undefined;
111
- /**
112
- * Whether writes to signals are allowed when this consumer is the `activeConsumer`.
113
- *
114
- * This is used to enforce guardrails such as preventing writes to writable signals in the
115
- * computation function of computed signals, which is supposed to be pure.
116
- */
117
- consumerAllowSignalWrites: boolean;
118
- readonly consumerIsAlwaysLive: boolean;
119
- /**
120
- * Tracks whether producers need to recompute their value independently of the reactive graph (for
121
- * example, if no initial value has been computed).
122
- */
123
- producerMustRecompute(node: unknown): boolean;
124
- producerRecomputeValue(node: unknown): void;
125
- consumerMarkedDirty(node: unknown): void;
126
- /**
127
- * Called when a signal is read within this consumer.
128
- */
129
- consumerOnSignalRead(node: unknown): void;
130
- /**
131
- * A debug name for the reactive node. Used in Angular DevTools to identify the node.
132
- */
133
- debugName?: string;
134
- /**
135
- * Kind of node. Example: 'signal', 'computed', 'input', 'effect'.
136
- *
137
- * ReactiveNode has this as 'unknown' by default, but derived node types should override this to
138
- * make available the kind of signal that particular instance of a ReactiveNode represents.
139
- *
140
- * Used in Angular DevTools to identify the kind of signal.
141
- */
142
- kind: string;
143
- }
144
- /**
145
- * Called by implementations when a producer's signal is read.
146
- */
147
- declare function producerAccessed(node: ReactiveNode): void;
148
- /**
149
- * Increment the global epoch counter.
150
- *
151
- * Called by source producers (that is, not computeds) whenever their values change.
152
- */
153
- declare function producerIncrementEpoch(): void;
154
- /**
155
- * Ensure this producer's `version` is up-to-date.
156
- */
157
- declare function producerUpdateValueVersion(node: ReactiveNode): void;
158
- /**
159
- * Propagate a dirty notification to live consumers of this producer.
160
- */
161
- declare function producerNotifyConsumers(node: ReactiveNode): void;
162
- /**
163
- * Whether this `ReactiveNode` in its producer capacity is currently allowed to initiate updates,
164
- * based on the current consumer context.
165
- */
166
- declare function producerUpdatesAllowed(): boolean;
167
- declare function consumerMarkDirty(node: ReactiveNode): void;
168
- declare function producerMarkClean(node: ReactiveNode): void;
169
- /**
170
- * Prepare this consumer to run a computation in its reactive context.
171
- *
172
- * Must be called by subclasses which represent reactive computations, before those computations
173
- * begin.
174
- */
175
- declare function consumerBeforeComputation(node: ReactiveNode | null): ReactiveNode | null;
176
- /**
177
- * Finalize this consumer's state after a reactive computation has run.
178
- *
179
- * Must be called by subclasses which represent reactive computations, after those computations
180
- * have finished.
181
- */
182
- declare function consumerAfterComputation(node: ReactiveNode | null, prevConsumer: ReactiveNode | null): void;
183
- /**
184
- * Determine whether this consumer has any dependencies which have changed since the last time
185
- * they were read.
186
- */
187
- declare function consumerPollProducersForChange(node: ReactiveNode): boolean;
188
- /**
189
- * Disconnect this consumer from the graph.
190
- */
191
- declare function consumerDestroy(node: ReactiveNode): void;
7
+ import { R as ReactiveNode, V as ValueEqualityFn, S as SIGNAL, a as SignalNode } from '../../weak_ref.d-BZ7gyRag.js';
8
+ export { b as REACTIVE_NODE, c as Reactive, e as ReactiveHookFn, w as SIGNAL_NODE, x as SignalGetter, f as consumerAfterComputation, g as consumerBeforeComputation, h as consumerDestroy, i as consumerMarkDirty, j as consumerPollProducersForChange, y as createSignal, d as defaultEquals, k as getActiveConsumer, l as isInNotificationPhase, m as isReactive, p as producerAccessed, n as producerIncrementEpoch, o as producerMarkClean, q as producerNotifyConsumers, r as producerUpdateValueVersion, s as producerUpdatesAllowed, t as runPostProducerCreatedFn, z as runPostSignalSetFn, u as setActiveConsumer, D as setAlternateWeakRefImpl, v as setPostProducerCreatedFn, A as setPostSignalSetFn, B as signalSetFn, C as signalUpdateFn } from '../../weak_ref.d-BZ7gyRag.js';
192
9
 
193
10
  /**
194
11
  * A computation, which derives a value from a declarative reactive expression.
@@ -218,7 +35,7 @@ type ComputedGetter<T> = (() => T) & {
218
35
  /**
219
36
  * Create a computed signal which derives a reactive value from an expression.
220
37
  */
221
- declare function createComputed<T>(computation: () => T): ComputedGetter<T>;
38
+ declare function createComputed<T>(computation: () => T, equal?: ValueEqualityFn<T>): ComputedGetter<T>;
222
39
 
223
40
  type ComputationFn<S, D> = (source: S, previous?: {
224
41
  source: S;
@@ -256,26 +73,6 @@ declare function createLinkedSignal<S, D>(sourceFn: () => S, computationFn: Comp
256
73
  declare function linkedSignalSetFn<S, D>(node: LinkedSignalNode<S, D>, newValue: D): void;
257
74
  declare function linkedSignalUpdateFn<S, D>(node: LinkedSignalNode<S, D>, updater: (value: D) => D): void;
258
75
 
259
- interface SignalNode<T> extends ReactiveNode {
260
- value: T;
261
- equal: ValueEqualityFn<T>;
262
- }
263
- type SignalBaseGetter<T> = (() => T) & {
264
- readonly [SIGNAL]: unknown;
265
- };
266
- interface SignalGetter<T> extends SignalBaseGetter<T> {
267
- readonly [SIGNAL]: SignalNode<T>;
268
- }
269
- /**
270
- * Create a `Signal` that can be set or updated directly.
271
- */
272
- declare function createSignal<T>(initialValue: T): SignalGetter<T>;
273
- declare function setPostSignalSetFn(fn: (() => void) | null): (() => void) | null;
274
- declare function signalSetFn<T>(node: SignalNode<T>, newValue: T): void;
275
- declare function signalUpdateFn<T>(node: SignalNode<T>, updater: (value: T) => T): void;
276
- declare function runPostSignalSetFn(): void;
277
- declare const SIGNAL_NODE: SignalNode<unknown>;
278
-
279
76
  declare function setThrowInvalidWriteToSignalError(fn: <T>(node: SignalNode<T>) => never): void;
280
77
 
281
78
  /**
@@ -320,4 +117,4 @@ declare function createWatch(fn: (onCleanup: WatchCleanupRegisterFn) => void, sc
320
117
  */
321
118
  declare function untracked<T>(nonReactiveReadsFn: () => T): T;
322
119
 
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 };
120
+ export { type ComputationFn, type ComputedNode, type LinkedSignalGetter, type LinkedSignalNode, ReactiveNode, SIGNAL, SignalNode, ValueEqualityFn, type Watch, type WatchCleanupFn, type WatchCleanupRegisterFn, createComputed, createLinkedSignal, createWatch, linkedSignalSetFn, linkedSignalUpdateFn, setThrowInvalidWriteToSignalError, untracked };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.2
2
+ * @license Angular v20.0.0-next.4
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.4
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-k591b6WQ.js');
12
+ var run_in_devkit = require('./run_in_devkit-CkvEksWP.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: '',