Reactive control fixtures use multipass evaluation

Updates all of the reactive control dependency fixtures to use multipass 
evaluation in sprout.
This commit is contained in:
Joe Savona
2024-01-19 11:04:18 -08:00
parent c8323f3b42
commit a272cf9b0c
30 changed files with 618 additions and 72 deletions
@@ -16,8 +16,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ limit: 10 }],
// TODO: test executing the sequence {limit: 10}, {limit: 1}, {limit: 10}
params: [],
sequentialRenders: [
{ limit: 10 },
{ limit: 10 },
{ limit: 1 },
{ limit: 1 },
{ limit: 10 },
{ limit: 1 },
{ limit: 10 },
{ limit: 1 },
],
};
```
@@ -49,11 +58,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ limit: 10 }],
// TODO: test executing the sequence {limit: 10}, {limit: 1}, {limit: 10}
params: [],
sequentialRenders: [
{ limit: 10 },
{ limit: 10 },
{ limit: 1 },
{ limit: 1 },
{ limit: 10 },
{ limit: 1 },
{ limit: 10 },
{ limit: 1 },
],
};
```
### Eval output
(kind: ok) [10]
(kind: ok) [10]
[10]
[1]
[1]
[10]
[1]
[10]
[1]
@@ -12,6 +12,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ limit: 10 }],
// TODO: test executing the sequence {limit: 10}, {limit: 1}, {limit: 10}
params: [],
sequentialRenders: [
{ limit: 10 },
{ limit: 10 },
{ limit: 1 },
{ limit: 1 },
{ limit: 10 },
{ limit: 1 },
{ limit: 10 },
{ limit: 1 },
],
};
@@ -22,7 +22,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};
```
@@ -57,10 +67,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};
```
### Eval output
(kind: ok) [10]
(kind: ok) [10]
[10]
[1]
[1]
[10]
[1]
[10]
[1]
@@ -18,5 +18,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};
@@ -21,7 +21,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ init: 0 }],
params: [],
sequentialRenders: [
{ init: 0 },
{ init: 0 },
{ init: 10 },
{ init: 10 },
{ init: 0 },
{ init: 10 },
{ init: 0 },
{ init: 10 },
],
};
```
@@ -55,10 +65,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ init: 0 }],
params: [],
sequentialRenders: [
{ init: 0 },
{ init: 0 },
{ init: 10 },
{ init: 10 },
{ init: 0 },
{ init: 10 },
{ init: 0 },
{ init: 10 },
],
};
```
### Eval output
(kind: ok) [0]
(kind: ok) [0]
[0]
[null]
[null]
[0]
[null]
[0]
[null]
@@ -17,5 +17,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ init: 0 }],
params: [],
sequentialRenders: [
{ init: 0 },
{ init: 0 },
{ init: 10 },
{ init: 10 },
{ init: 0 },
{ init: 10 },
{ init: 0 },
{ init: 10 },
],
};
@@ -20,7 +20,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};
```
@@ -52,10 +62,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};
```
### Eval output
(kind: ok) [10]
(kind: ok) [10]
[10]
[1]
[1]
[10]
[1]
[10]
[1]
@@ -16,5 +16,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};
@@ -20,7 +20,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ update: 2 }],
params: [],
sequentialRenders: [
{ update: 2 },
{ update: 2 },
{ update: 1 },
{ update: 1 },
{ update: 2 },
{ update: 1 },
{ update: 2 },
{ update: 1 },
],
};
```
@@ -52,10 +62,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ update: 2 }],
params: [],
sequentialRenders: [
{ update: 2 },
{ update: 2 },
{ update: 1 },
{ update: 1 },
{ update: 2 },
{ update: 1 },
{ update: 2 },
{ update: 1 },
],
};
```
### Eval output
(kind: ok) [2]
(kind: ok) [2]
[2]
[1]
[1]
[2]
[1]
[2]
[1]
@@ -16,5 +16,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ update: 2 }],
params: [],
sequentialRenders: [
{ update: 2 },
{ update: 2 },
{ update: 1 },
{ update: 1 },
{ update: 2 },
{ update: 1 },
{ update: 2 },
{ update: 1 },
],
};
@@ -21,7 +21,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ values: { "12": true } }],
params: [],
sequentialRenders: [
{ values: { "12": true } },
{ values: { "12": true } },
{ values: { "1": true } },
{ values: { "1": true } },
{ values: { "12": true } },
{ values: { "1": true } },
{ values: { "12": true } },
{ values: { "1": true } },
],
};
```
@@ -54,10 +64,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ values: { "12": true } }],
params: [],
sequentialRenders: [
{ values: { "12": true } },
{ values: { "12": true } },
{ values: { "1": true } },
{ values: { "1": true } },
{ values: { "12": true } },
{ values: { "1": true } },
{ values: { "12": true } },
{ values: { "1": true } },
],
};
```
### Eval output
(kind: ok) [10]
(kind: ok) [10]
[10]
[1]
[1]
[10]
[1]
[10]
[1]
@@ -17,5 +17,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ values: { "12": true } }],
params: [],
sequentialRenders: [
{ values: { "12": true } },
{ values: { "12": true } },
{ values: { "1": true } },
{ values: { "1": true } },
{ values: { "12": true } },
{ values: { "1": true } },
{ values: { "12": true } },
{ values: { "1": true } },
],
};
@@ -20,7 +20,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ values: [12] }],
params: [],
sequentialRenders: [
{ values: [12] },
{ values: [12] },
{ values: [1] },
{ values: [1] },
{ values: [12] },
{ values: [1] },
{ values: [12] },
{ values: [1] },
],
};
```
@@ -52,10 +62,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ values: [12] }],
params: [],
sequentialRenders: [
{ values: [12] },
{ values: [12] },
{ values: [1] },
{ values: [1] },
{ values: [12] },
{ values: [1] },
{ values: [12] },
{ values: [1] },
],
};
```
### Eval output
(kind: ok) [10]
(kind: ok) [10]
[10]
[1]
[1]
[10]
[1]
[10]
[1]
@@ -16,5 +16,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ values: [12] }],
params: [],
sequentialRenders: [
{ values: [12] },
{ values: [12] },
{ values: [1] },
{ values: [1] },
{ values: [12] },
{ values: [1] },
{ values: [12] },
{ values: [1] },
],
};
@@ -17,7 +17,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
@@ -47,10 +57,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
### Eval output
(kind: ok) [1]
(kind: ok) [1]
[1]
[2]
[2]
[1]
[2]
[1]
[2]
@@ -13,5 +13,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
@@ -37,8 +37,17 @@ function Foo({ cond, setX, setY, setState }) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
// TODO: run this function with {cond:true}, {cond: false}
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
@@ -101,11 +110,27 @@ function Foo(t21) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
// TODO: run this function with {cond:true}, {cond: false}
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
### Eval output
(kind: ok) ok
(kind: ok) ok
ok
ok
ok
ok
ok
ok
ok
@@ -33,6 +33,15 @@ function Foo({ cond, setX, setY, setState }) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
// TODO: run this function with {cond:true}, {cond: false}
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
@@ -18,7 +18,7 @@ function Component(props) {
}
}
value = props.value;
value = props.cond;
}
// The values assigned to `x` are non-reactive, but the value of `x`
@@ -31,7 +31,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
@@ -57,7 +67,7 @@ function Component(props) {
}
}
value = props.value;
value = props.cond;
}
let t0;
if ($[0] !== x) {
@@ -72,10 +82,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
### Eval output
(kind: ok) [0]
(kind: ok) [1]
[1]
[2]
[2]
[1]
[2]
[1]
[2]
@@ -14,7 +14,7 @@ function Component(props) {
}
}
value = props.value;
value = props.cond;
}
// The values assigned to `x` are non-reactive, but the value of `x`
@@ -27,5 +27,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
@@ -25,7 +25,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
@@ -63,10 +73,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
### Eval output
(kind: ok) [1]
(kind: ok) [1]
[1]
[2]
[2]
[1]
[2]
[1]
[2]
@@ -21,5 +21,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
@@ -23,8 +23,17 @@ function Component({ value }) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ value: GLOBAL }],
// TODO: test executing the sequence {value: GLOBAL}, {value: null}, {value: GLOBAL}
params: [],
sequentialRenders: [
{ value: GLOBAL },
{ value: GLOBAL },
{ value: null },
{ value: null },
{ value: GLOBAL },
{ value: null },
{ value: GLOBAL },
{ value: null },
],
};
```
@@ -61,11 +70,27 @@ function Component(t14) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ value: GLOBAL }],
// TODO: test executing the sequence {value: GLOBAL}, {value: null}, {value: GLOBAL}
params: [],
sequentialRenders: [
{ value: GLOBAL },
{ value: GLOBAL },
{ value: null },
{ value: null },
{ value: GLOBAL },
{ value: null },
{ value: GLOBAL },
{ value: null },
],
};
```
### Eval output
(kind: ok) [1]
(kind: ok) [1]
[1]
[2]
[2]
[1]
[2]
[1]
[2]
@@ -19,6 +19,15 @@ function Component({ value }) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ value: GLOBAL }],
// TODO: test executing the sequence {value: GLOBAL}, {value: null}, {value: GLOBAL}
params: [],
sequentialRenders: [
{ value: GLOBAL },
{ value: GLOBAL },
{ value: null },
{ value: null },
{ value: GLOBAL },
{ value: null },
{ value: GLOBAL },
{ value: null },
],
};
@@ -20,7 +20,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
@@ -54,10 +64,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
### Eval output
(kind: ok) [true]
(kind: ok) [true]
[true]
[false]
[false]
[true]
[false]
[true]
[false]
@@ -16,5 +16,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
@@ -23,7 +23,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
@@ -59,10 +69,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
```
### Eval output
(kind: ok) [true]
(kind: ok) [true]
[true]
[false]
[false]
[true]
[false]
[true]
[false]
@@ -19,5 +19,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ cond: true }],
params: [],
sequentialRenders: [
{ cond: true },
{ cond: true },
{ cond: false },
{ cond: false },
{ cond: true },
{ cond: false },
{ cond: true },
{ cond: false },
],
};
@@ -22,7 +22,17 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};
```
@@ -57,10 +67,27 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};
```
### Eval output
(kind: ok) [10]
(kind: ok) [10]
[10]
[1]
[1]
[10]
[1]
[10]
[1]
@@ -18,5 +18,15 @@ function Component(props) {
export const FIXTURE_ENTRYPOINT = {
fn: Component,
params: [{ test: 12 }],
params: [],
sequentialRenders: [
{ test: 12 },
{ test: 12 },
{ test: 1 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
{ test: 12 },
{ test: 1 },
],
};