@angular/core 16.2.5 → 16.2.6
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.
- package/esm2022/src/render3/reactive_lview_consumer.mjs +1 -1
- package/esm2022/src/signals/src/api.mjs +2 -2
- package/esm2022/src/signals/src/computed.mjs +50 -45
- package/esm2022/src/signals/src/graph.mjs +7 -2
- package/esm2022/src/signals/src/signal.mjs +11 -6
- package/esm2022/src/signals/src/watch.mjs +16 -11
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/fesm2022/core.mjs +83 -63
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/rxjs-interop.mjs +82 -62
- package/fesm2022/rxjs-interop.mjs.map +1 -1
- package/fesm2022/testing.mjs +83 -63
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/guard-and-resolve-interfaces/bundle.js +13 -13
- package/schematics/migrations/remove-module-id/bundle.js +14 -14
- package/schematics/ng-generate/standalone-migration/bundle.js +376 -376
- package/schematics/ng-generate/standalone-migration/bundle.js.map +1 -1
- package/testing/index.d.ts +1 -1
package/fesm2022/testing.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v16.2.
|
|
2
|
+
* @license Angular v16.2.6
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -3556,7 +3556,7 @@ function getFactoryDef(type, throwNotFound) {
|
|
|
3556
3556
|
*
|
|
3557
3557
|
* This can be used to auto-unwrap signals in various cases, or to auto-wrap non-signal values.
|
|
3558
3558
|
*/
|
|
3559
|
-
const SIGNAL = Symbol('SIGNAL');
|
|
3559
|
+
const SIGNAL = /* @__PURE__ */ Symbol('SIGNAL');
|
|
3560
3560
|
/**
|
|
3561
3561
|
* Checks if the given `value` is a reactive `Signal`.
|
|
3562
3562
|
*
|
|
@@ -3734,7 +3734,9 @@ function consumerAfterComputation(node, prevConsumer) {
|
|
|
3734
3734
|
}
|
|
3735
3735
|
}
|
|
3736
3736
|
// Truncate the producer tracking arrays.
|
|
3737
|
-
|
|
3737
|
+
// Perf note: this is essentially truncating the length to `node.nextProducerIndex`, but
|
|
3738
|
+
// benchmarking has shown that individual pop operations are faster.
|
|
3739
|
+
while (node.producerNode.length > node.nextProducerIndex) {
|
|
3738
3740
|
node.producerNode.pop();
|
|
3739
3741
|
node.producerLastReadVersion.pop();
|
|
3740
3742
|
node.producerIndexOfThis.pop();
|
|
@@ -3808,6 +3810,9 @@ function producerAddLiveConsumer(node, consumer, indexOfThis) {
|
|
|
3808
3810
|
function producerRemoveLiveConsumerAtIndex(node, idx) {
|
|
3809
3811
|
assertProducerNode(node);
|
|
3810
3812
|
assertConsumerNode(node);
|
|
3813
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode && idx >= node.liveConsumerNode.length) {
|
|
3814
|
+
throw new Error(`Assertion error: active consumer index ${idx} is out of bounds of ${node.liveConsumerNode.length} consumers)`);
|
|
3815
|
+
}
|
|
3811
3816
|
if (node.liveConsumerNode.length === 1) {
|
|
3812
3817
|
// When removing the last live consumer, we will no longer be live. We need to remove
|
|
3813
3818
|
// ourselves from our producers' tracking (which may cause consumer-producers to lose
|
|
@@ -3872,60 +3877,65 @@ function computed(computation, options) {
|
|
|
3872
3877
|
* A dedicated symbol used before a computed value has been calculated for the first time.
|
|
3873
3878
|
* Explicitly typed as `any` so we can use it as signal's value.
|
|
3874
3879
|
*/
|
|
3875
|
-
const UNSET = Symbol('UNSET');
|
|
3880
|
+
const UNSET = /* @__PURE__ */ Symbol('UNSET');
|
|
3876
3881
|
/**
|
|
3877
3882
|
* A dedicated symbol used in place of a computed signal value to indicate that a given computation
|
|
3878
3883
|
* is in progress. Used to detect cycles in computation chains.
|
|
3879
3884
|
* Explicitly typed as `any` so we can use it as signal's value.
|
|
3880
3885
|
*/
|
|
3881
|
-
const COMPUTING = Symbol('COMPUTING');
|
|
3886
|
+
const COMPUTING = /* @__PURE__ */ Symbol('COMPUTING');
|
|
3882
3887
|
/**
|
|
3883
3888
|
* A dedicated symbol used in place of a computed signal value to indicate that a given computation
|
|
3884
3889
|
* failed. The thrown error is cached until the computation gets dirty again.
|
|
3885
3890
|
* Explicitly typed as `any` so we can use it as signal's value.
|
|
3886
3891
|
*/
|
|
3887
|
-
const ERRORED = Symbol('ERRORED');
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
}
|
|
3892
|
+
const ERRORED = /* @__PURE__ */ Symbol('ERRORED');
|
|
3893
|
+
// Note: Using an IIFE here to ensure that the spread assignment is not considered
|
|
3894
|
+
// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
|
|
3895
|
+
// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
|
|
3896
|
+
const COMPUTED_NODE = /* @__PURE__ */ (() => {
|
|
3897
|
+
return {
|
|
3898
|
+
...REACTIVE_NODE,
|
|
3899
|
+
value: UNSET,
|
|
3900
|
+
dirty: true,
|
|
3901
|
+
error: null,
|
|
3902
|
+
equal: defaultEquals,
|
|
3903
|
+
producerMustRecompute(node) {
|
|
3904
|
+
// Force a recomputation if there's no current value, or if the current value is in the
|
|
3905
|
+
// process of being calculated (which should throw an error).
|
|
3906
|
+
return node.value === UNSET || node.value === COMPUTING;
|
|
3907
|
+
},
|
|
3908
|
+
producerRecomputeValue(node) {
|
|
3909
|
+
if (node.value === COMPUTING) {
|
|
3910
|
+
// Our computation somehow led to a cyclic read of itself.
|
|
3911
|
+
throw new Error('Detected cycle in computations.');
|
|
3912
|
+
}
|
|
3913
|
+
const oldValue = node.value;
|
|
3914
|
+
node.value = COMPUTING;
|
|
3915
|
+
const prevConsumer = consumerBeforeComputation(node);
|
|
3916
|
+
let newValue;
|
|
3917
|
+
try {
|
|
3918
|
+
newValue = node.computation();
|
|
3919
|
+
}
|
|
3920
|
+
catch (err) {
|
|
3921
|
+
newValue = ERRORED;
|
|
3922
|
+
node.error = err;
|
|
3923
|
+
}
|
|
3924
|
+
finally {
|
|
3925
|
+
consumerAfterComputation(node, prevConsumer);
|
|
3926
|
+
}
|
|
3927
|
+
if (oldValue !== UNSET && oldValue !== ERRORED && newValue !== ERRORED &&
|
|
3928
|
+
node.equal(oldValue, newValue)) {
|
|
3929
|
+
// No change to `valueVersion` - old and new values are
|
|
3930
|
+
// semantically equivalent.
|
|
3931
|
+
node.value = oldValue;
|
|
3932
|
+
return;
|
|
3933
|
+
}
|
|
3934
|
+
node.value = newValue;
|
|
3935
|
+
node.version++;
|
|
3936
|
+
},
|
|
3937
|
+
};
|
|
3938
|
+
})();
|
|
3929
3939
|
|
|
3930
3940
|
function defaultThrowError() {
|
|
3931
3941
|
throw new Error();
|
|
@@ -3970,11 +3980,16 @@ function setPostSignalSetFn(fn) {
|
|
|
3970
3980
|
postSignalSetFn = fn;
|
|
3971
3981
|
return prev;
|
|
3972
3982
|
}
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3983
|
+
// Note: Using an IIFE here to ensure that the spread assignment is not considered
|
|
3984
|
+
// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
|
|
3985
|
+
// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
|
|
3986
|
+
const SIGNAL_NODE = /* @__PURE__ */ (() => {
|
|
3987
|
+
return {
|
|
3988
|
+
...REACTIVE_NODE,
|
|
3989
|
+
equal: defaultEquals,
|
|
3990
|
+
readonlyFn: undefined,
|
|
3991
|
+
};
|
|
3992
|
+
})();
|
|
3978
3993
|
function signalValueChanged(node) {
|
|
3979
3994
|
node.version++;
|
|
3980
3995
|
producerNotifyConsumers(node);
|
|
@@ -4067,16 +4082,21 @@ function watch(fn, schedule, allowSignalWrites) {
|
|
|
4067
4082
|
return node.ref;
|
|
4068
4083
|
}
|
|
4069
4084
|
const NOOP_CLEANUP_FN = () => { };
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4085
|
+
// Note: Using an IIFE here to ensure that the spread assignment is not considered
|
|
4086
|
+
// a side-effect, ending up preserving `COMPUTED_NODE` and `REACTIVE_NODE`.
|
|
4087
|
+
// TODO: remove when https://github.com/evanw/esbuild/issues/3392 is resolved.
|
|
4088
|
+
const WATCH_NODE = /* @__PURE__ */ (() => {
|
|
4089
|
+
return {
|
|
4090
|
+
...REACTIVE_NODE,
|
|
4091
|
+
consumerIsAlwaysLive: true,
|
|
4092
|
+
consumerAllowSignalWrites: false,
|
|
4093
|
+
consumerMarkedDirty: (node) => {
|
|
4094
|
+
node.schedule(node.ref);
|
|
4095
|
+
},
|
|
4096
|
+
hasRun: false,
|
|
4097
|
+
cleanupFn: NOOP_CLEANUP_FN,
|
|
4098
|
+
};
|
|
4099
|
+
})();
|
|
4080
4100
|
|
|
4081
4101
|
function setAlternateWeakRefImpl(impl) {
|
|
4082
4102
|
// TODO: remove this function
|
|
@@ -10905,7 +10925,7 @@ class Version {
|
|
|
10905
10925
|
/**
|
|
10906
10926
|
* @publicApi
|
|
10907
10927
|
*/
|
|
10908
|
-
const VERSION = new Version('16.2.
|
|
10928
|
+
const VERSION = new Version('16.2.6');
|
|
10909
10929
|
|
|
10910
10930
|
// This default value is when checking the hierarchy for a token.
|
|
10911
10931
|
//
|