@samitouri / QOS-React-1 / commits / a272cf9b0c

Reactive control fixtures use multipass evaluation

Updates all of the reactive control dependency fixtures to use multipass evaluation in sprout.

Joe Savona committed Jan 19, 2024 at 11:04 UTC a272cf9b0c46e2be49a5a05feb4a4a2dd1628a80
30 files changed +618 -72
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.expect.md
+30 -5
@@ -16,8 +16,17 @@ function Component(props) {
16
17 export const FIXTURE_ENTRYPOINT = {
18 fn: Component,
19 - params: [{ limit: 10 }],
20 - // TODO: test executing the sequence {limit: 10}, {limit: 1}, {limit: 10}
19 + params: [],
20 + sequentialRenders: [
21 + { limit: 10 },
22 + { limit: 10 },
23 + { limit: 1 },
24 + { limit: 1 },
25 + { limit: 10 },
26 + { limit: 1 },
27 + { limit: 10 },
28 + { limit: 1 },
29 + ],
30 };
31
32 ```
@@ -49,11 +58,27 @@ function Component(props) {
58
59 export const FIXTURE_ENTRYPOINT = {
60 fn: Component,
52 - params: [{ limit: 10 }],
53 - // TODO: test executing the sequence {limit: 10}, {limit: 1}, {limit: 10}
61 + params: [],
62 + sequentialRenders: [
63 + { limit: 10 },
64 + { limit: 10 },
65 + { limit: 1 },
66 + { limit: 1 },
67 + { limit: 10 },
68 + { limit: 1 },
69 + { limit: 10 },
70 + { limit: 1 },
71 + ],
72 };
73
74 ```
75
76 ### Eval output
59 -(kind: ok) [10]
\ No newline at end of file
77 +(kind: ok) [10]
78 +[10]
79 +[1]
80 +[1]
81 +[10]
82 +[1]
83 +[10]
84 +[1]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.js
+11 -2
@@ -12,6 +12,15 @@ function Component(props) {
12
13 export const FIXTURE_ENTRYPOINT = {
14 fn: Component,
15 - params: [{ limit: 10 }],
16 - // TODO: test executing the sequence {limit: 10}, {limit: 1}, {limit: 10}
15 + params: [],
16 + sequentialRenders: [
17 + { limit: 10 },
18 + { limit: 10 },
19 + { limit: 1 },
20 + { limit: 1 },
21 + { limit: 10 },
22 + { limit: 1 },
23 + { limit: 10 },
24 + { limit: 1 },
25 + ],
26 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.expect.md
+30 -3
@@ -22,7 +22,17 @@ function Component(props) {
22
23 export const FIXTURE_ENTRYPOINT = {
24 fn: Component,
25 - params: [{ test: 12 }],
25 + params: [],
26 + sequentialRenders: [
27 + { test: 12 },
28 + { test: 12 },
29 + { test: 1 },
30 + { test: 1 },
31 + { test: 12 },
32 + { test: 1 },
33 + { test: 12 },
34 + { test: 1 },
35 + ],
36 };
37
38 ```
@@ -57,10 +67,27 @@ function Component(props) {
67
68 export const FIXTURE_ENTRYPOINT = {
69 fn: Component,
60 - params: [{ test: 12 }],
70 + params: [],
71 + sequentialRenders: [
72 + { test: 12 },
73 + { test: 12 },
74 + { test: 1 },
75 + { test: 1 },
76 + { test: 12 },
77 + { test: 1 },
78 + { test: 12 },
79 + { test: 1 },
80 + ],
81 };
82
83 ```
84
85 ### Eval output
66 -(kind: ok) [10]
\ No newline at end of file
86 +(kind: ok) [10]
87 +[10]
88 +[1]
89 +[1]
90 +[10]
91 +[1]
92 +[10]
93 +[1]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.js
+11 -1
@@ -18,5 +18,15 @@ function Component(props) {
18
19 export const FIXTURE_ENTRYPOINT = {
20 fn: Component,
21 - params: [{ test: 12 }],
21 + params: [],
22 + sequentialRenders: [
23 + { test: 12 },
24 + { test: 12 },
25 + { test: 1 },
26 + { test: 1 },
27 + { test: 12 },
28 + { test: 1 },
29 + { test: 12 },
30 + { test: 1 },
31 + ],
32 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.expect.md
+30 -3
@@ -21,7 +21,17 @@ function Component(props) {
21
22 export const FIXTURE_ENTRYPOINT = {
23 fn: Component,
24 - params: [{ init: 0 }],
24 + params: [],
25 + sequentialRenders: [
26 + { init: 0 },
27 + { init: 0 },
28 + { init: 10 },
29 + { init: 10 },
30 + { init: 0 },
31 + { init: 10 },
32 + { init: 0 },
33 + { init: 10 },
34 + ],
35 };
36
37 ```
@@ -55,10 +65,27 @@ function Component(props) {
65
66 export const FIXTURE_ENTRYPOINT = {
67 fn: Component,
58 - params: [{ init: 0 }],
68 + params: [],
69 + sequentialRenders: [
70 + { init: 0 },
71 + { init: 0 },
72 + { init: 10 },
73 + { init: 10 },
74 + { init: 0 },
75 + { init: 10 },
76 + { init: 0 },
77 + { init: 10 },
78 + ],
79 };
80
81 ```
82
83 ### Eval output
64 -(kind: ok) [0]
\ No newline at end of file
84 +(kind: ok) [0]
85 +[0]
86 +[null]
87 +[null]
88 +[0]
89 +[null]
90 +[0]
91 +[null]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.js
+11 -1
@@ -17,5 +17,15 @@ function Component(props) {
17
18 export const FIXTURE_ENTRYPOINT = {
19 fn: Component,
20 - params: [{ init: 0 }],
20 + params: [],
21 + sequentialRenders: [
22 + { init: 0 },
23 + { init: 0 },
24 + { init: 10 },
25 + { init: 10 },
26 + { init: 0 },
27 + { init: 10 },
28 + { init: 0 },
29 + { init: 10 },
30 + ],
31 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.expect.md
+30 -3
@@ -20,7 +20,17 @@ function Component(props) {
20
21 export const FIXTURE_ENTRYPOINT = {
22 fn: Component,
23 - params: [{ test: 12 }],
23 + params: [],
24 + sequentialRenders: [
25 + { test: 12 },
26 + { test: 12 },
27 + { test: 1 },
28 + { test: 1 },
29 + { test: 12 },
30 + { test: 1 },
31 + { test: 12 },
32 + { test: 1 },
33 + ],
34 };
35
36 ```
@@ -52,10 +62,27 @@ function Component(props) {
62
63 export const FIXTURE_ENTRYPOINT = {
64 fn: Component,
55 - params: [{ test: 12 }],
65 + params: [],
66 + sequentialRenders: [
67 + { test: 12 },
68 + { test: 12 },
69 + { test: 1 },
70 + { test: 1 },
71 + { test: 12 },
72 + { test: 1 },
73 + { test: 12 },
74 + { test: 1 },
75 + ],
76 };
77
78 ```
79
80 ### Eval output
61 -(kind: ok) [10]
\ No newline at end of file
81 +(kind: ok) [10]
82 +[10]
83 +[1]
84 +[1]
85 +[10]
86 +[1]
87 +[10]
88 +[1]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.js
+11 -1
@@ -16,5 +16,15 @@ function Component(props) {
16
17 export const FIXTURE_ENTRYPOINT = {
18 fn: Component,
19 - params: [{ test: 12 }],
19 + params: [],
20 + sequentialRenders: [
21 + { test: 12 },
22 + { test: 12 },
23 + { test: 1 },
24 + { test: 1 },
25 + { test: 12 },
26 + { test: 1 },
27 + { test: 12 },
28 + { test: 1 },
29 + ],
30 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.expect.md
+30 -3
@@ -20,7 +20,17 @@ function Component(props) {
20
21 export const FIXTURE_ENTRYPOINT = {
22 fn: Component,
23 - params: [{ update: 2 }],
23 + params: [],
24 + sequentialRenders: [
25 + { update: 2 },
26 + { update: 2 },
27 + { update: 1 },
28 + { update: 1 },
29 + { update: 2 },
30 + { update: 1 },
31 + { update: 2 },
32 + { update: 1 },
33 + ],
34 };
35
36 ```
@@ -52,10 +62,27 @@ function Component(props) {
62
63 export const FIXTURE_ENTRYPOINT = {
64 fn: Component,
55 - params: [{ update: 2 }],
65 + params: [],
66 + sequentialRenders: [
67 + { update: 2 },
68 + { update: 2 },
69 + { update: 1 },
70 + { update: 1 },
71 + { update: 2 },
72 + { update: 1 },
73 + { update: 2 },
74 + { update: 1 },
75 + ],
76 };
77
78 ```
79
80 ### Eval output
61 -(kind: ok) [2]
\ No newline at end of file
81 +(kind: ok) [2]
82 +[2]
83 +[1]
84 +[1]
85 +[2]
86 +[1]
87 +[2]
88 +[1]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.js
+11 -1
@@ -16,5 +16,15 @@ function Component(props) {
16
17 export const FIXTURE_ENTRYPOINT = {
18 fn: Component,
19 - params: [{ update: 2 }],
19 + params: [],
20 + sequentialRenders: [
21 + { update: 2 },
22 + { update: 2 },
23 + { update: 1 },
24 + { update: 1 },
25 + { update: 2 },
26 + { update: 1 },
27 + { update: 2 },
28 + { update: 1 },
29 + ],
30 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.expect.md
+30 -3
@@ -21,7 +21,17 @@ function Component(props) {
21
22 export const FIXTURE_ENTRYPOINT = {
23 fn: Component,
24 - params: [{ values: { "12": true } }],
24 + params: [],
25 + sequentialRenders: [
26 + { values: { "12": true } },
27 + { values: { "12": true } },
28 + { values: { "1": true } },
29 + { values: { "1": true } },
30 + { values: { "12": true } },
31 + { values: { "1": true } },
32 + { values: { "12": true } },
33 + { values: { "1": true } },
34 + ],
35 };
36
37 ```
@@ -54,10 +64,27 @@ function Component(props) {
64
65 export const FIXTURE_ENTRYPOINT = {
66 fn: Component,
57 - params: [{ values: { "12": true } }],
67 + params: [],
68 + sequentialRenders: [
69 + { values: { "12": true } },
70 + { values: { "12": true } },
71 + { values: { "1": true } },
72 + { values: { "1": true } },
73 + { values: { "12": true } },
74 + { values: { "1": true } },
75 + { values: { "12": true } },
76 + { values: { "1": true } },
77 + ],
78 };
79
80 ```
81
82 ### Eval output
63 -(kind: ok) [10]
\ No newline at end of file
83 +(kind: ok) [10]
84 +[10]
85 +[1]
86 +[1]
87 +[10]
88 +[1]
89 +[10]
90 +[1]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.js
+11 -1
@@ -17,5 +17,15 @@ function Component(props) {
17
18 export const FIXTURE_ENTRYPOINT = {
19 fn: Component,
20 - params: [{ values: { "12": true } }],
20 + params: [],
21 + sequentialRenders: [
22 + { values: { "12": true } },
23 + { values: { "12": true } },
24 + { values: { "1": true } },
25 + { values: { "1": true } },
26 + { values: { "12": true } },
27 + { values: { "1": true } },
28 + { values: { "12": true } },
29 + { values: { "1": true } },
30 + ],
31 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.expect.md
+30 -3
@@ -20,7 +20,17 @@ function Component(props) {
20
21 export const FIXTURE_ENTRYPOINT = {
22 fn: Component,
23 - params: [{ values: [12] }],
23 + params: [],
24 + sequentialRenders: [
25 + { values: [12] },
26 + { values: [12] },
27 + { values: [1] },
28 + { values: [1] },
29 + { values: [12] },
30 + { values: [1] },
31 + { values: [12] },
32 + { values: [1] },
33 + ],
34 };
35
36 ```
@@ -52,10 +62,27 @@ function Component(props) {
62
63 export const FIXTURE_ENTRYPOINT = {
64 fn: Component,
55 - params: [{ values: [12] }],
65 + params: [],
66 + sequentialRenders: [
67 + { values: [12] },
68 + { values: [12] },
69 + { values: [1] },
70 + { values: [1] },
71 + { values: [12] },
72 + { values: [1] },
73 + { values: [12] },
74 + { values: [1] },
75 + ],
76 };
77
78 ```
79
80 ### Eval output
61 -(kind: ok) [10]
\ No newline at end of file
81 +(kind: ok) [10]
82 +[10]
83 +[1]
84 +[1]
85 +[10]
86 +[1]
87 +[10]
88 +[1]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.js
+11 -1
@@ -16,5 +16,15 @@ function Component(props) {
16
17 export const FIXTURE_ENTRYPOINT = {
18 fn: Component,
19 - params: [{ values: [12] }],
19 + params: [],
20 + sequentialRenders: [
21 + { values: [12] },
22 + { values: [12] },
23 + { values: [1] },
24 + { values: [1] },
25 + { values: [12] },
26 + { values: [1] },
27 + { values: [12] },
28 + { values: [1] },
29 + ],
30 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.expect.md
+30 -3
@@ -17,7 +17,17 @@ function Component(props) {
17
18 export const FIXTURE_ENTRYPOINT = {
19 fn: Component,
20 - params: [{ cond: true }],
20 + params: [],
21 + sequentialRenders: [
22 + { cond: true },
23 + { cond: true },
24 + { cond: false },
25 + { cond: false },
26 + { cond: true },
27 + { cond: false },
28 + { cond: true },
29 + { cond: false },
30 + ],
31 };
32
33 ```
@@ -47,10 +57,27 @@ function Component(props) {
57
58 export const FIXTURE_ENTRYPOINT = {
59 fn: Component,
50 - params: [{ cond: true }],
60 + params: [],
61 + sequentialRenders: [
62 + { cond: true },
63 + { cond: true },
64 + { cond: false },
65 + { cond: false },
66 + { cond: true },
67 + { cond: false },
68 + { cond: true },
69 + { cond: false },
70 + ],
71 };
72
73 ```
74
75 ### Eval output
56 -(kind: ok) [1]
\ No newline at end of file
76 +(kind: ok) [1]
77 +[1]
78 +[2]
79 +[2]
80 +[1]
81 +[2]
82 +[1]
83 +[2]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.js
+11 -1
@@ -13,5 +13,15 @@ function Component(props) {
13
14 export const FIXTURE_ENTRYPOINT = {
15 fn: Component,
16 - params: [{ cond: true }],
16 + params: [],
17 + sequentialRenders: [
18 + { cond: true },
19 + { cond: true },
20 + { cond: false },
21 + { cond: false },
22 + { cond: true },
23 + { cond: false },
24 + { cond: true },
25 + { cond: false },
26 + ],
27 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.expect.md
+30 -5
@@ -37,8 +37,17 @@ function Foo({ cond, setX, setY, setState }) {
37
38 export const FIXTURE_ENTRYPOINT = {
39 fn: Component,
40 - // TODO: run this function with {cond:true}, {cond: false}
41 - params: [{ cond: true }],
40 + params: [],
41 + sequentialRenders: [
42 + { cond: true },
43 + { cond: true },
44 + { cond: false },
45 + { cond: false },
46 + { cond: true },
47 + { cond: false },
48 + { cond: true },
49 + { cond: false },
50 + ],
51 };
52
53 ```
@@ -101,11 +110,27 @@ function Foo(t21) {
110
111 export const FIXTURE_ENTRYPOINT = {
112 fn: Component,
104 - // TODO: run this function with {cond:true}, {cond: false}
105 - params: [{ cond: true }],
113 + params: [],
114 + sequentialRenders: [
115 + { cond: true },
116 + { cond: true },
117 + { cond: false },
118 + { cond: false },
119 + { cond: true },
120 + { cond: false },
121 + { cond: true },
122 + { cond: false },
123 + ],
124 };
125
126 ```
127
128 ### Eval output
111 -(kind: ok) ok
\ No newline at end of file
129 +(kind: ok) ok
130 +ok
131 +ok
132 +ok
133 +ok
134 +ok
135 +ok
136 +ok
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.js
+11 -2
@@ -33,6 +33,15 @@ function Foo({ cond, setX, setY, setState }) {
33
34 export const FIXTURE_ENTRYPOINT = {
35 fn: Component,
36 - // TODO: run this function with {cond:true}, {cond: false}
37 - params: [{ cond: true }],
36 + params: [],
37 + sequentialRenders: [
38 + { cond: true },
39 + { cond: true },
40 + { cond: false },
41 + { cond: false },
42 + { cond: true },
43 + { cond: false },
44 + { cond: true },
45 + { cond: false },
46 + ],
47 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.expect.md
+32 -5
@@ -18,7 +18,7 @@ function Component(props) {
18 }
19 }
20
21 - value = props.value;
21 + value = props.cond;
22 }
23
24 // The values assigned to `x` are non-reactive, but the value of `x`
@@ -31,7 +31,17 @@ function Component(props) {
31
32 export const FIXTURE_ENTRYPOINT = {
33 fn: Component,
34 - params: [{ cond: true }],
34 + params: [],
35 + sequentialRenders: [
36 + { cond: true },
37 + { cond: true },
38 + { cond: false },
39 + { cond: false },
40 + { cond: true },
41 + { cond: false },
42 + { cond: true },
43 + { cond: false },
44 + ],
45 };
46
47 ```
@@ -57,7 +67,7 @@ function Component(props) {
67 }
68 }
69
60 - value = props.value;
70 + value = props.cond;
71 }
72 let t0;
73 if ($[0] !== x) {
@@ -72,10 +82,27 @@ function Component(props) {
82
83 export const FIXTURE_ENTRYPOINT = {
84 fn: Component,
75 - params: [{ cond: true }],
85 + params: [],
86 + sequentialRenders: [
87 + { cond: true },
88 + { cond: true },
89 + { cond: false },
90 + { cond: false },
91 + { cond: true },
92 + { cond: false },
93 + { cond: true },
94 + { cond: false },
95 + ],
96 };
97
98 ```
99
100 ### Eval output
81 -(kind: ok) [0]
\ No newline at end of file
101 +(kind: ok) [1]
102 +[1]
103 +[2]
104 +[2]
105 +[1]
106 +[2]
107 +[1]
108 +[2]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.js
+12 -2
@@ -14,7 +14,7 @@ function Component(props) {
14 }
15 }
16
17 - value = props.value;
17 + value = props.cond;
18 }
19
20 // The values assigned to `x` are non-reactive, but the value of `x`
@@ -27,5 +27,15 @@ function Component(props) {
27
28 export const FIXTURE_ENTRYPOINT = {
29 fn: Component,
30 - params: [{ cond: true }],
30 + params: [],
31 + sequentialRenders: [
32 + { cond: true },
33 + { cond: true },
34 + { cond: false },
35 + { cond: false },
36 + { cond: true },
37 + { cond: false },
38 + { cond: true },
39 + { cond: false },
40 + ],
41 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.expect.md
+30 -3
@@ -25,7 +25,17 @@ function Component(props) {
25
26 export const FIXTURE_ENTRYPOINT = {
27 fn: Component,
28 - params: [{ cond: true }],
28 + params: [],
29 + sequentialRenders: [
30 + { cond: true },
31 + { cond: true },
32 + { cond: false },
33 + { cond: false },
34 + { cond: true },
35 + { cond: false },
36 + { cond: true },
37 + { cond: false },
38 + ],
39 };
40
41 ```
@@ -63,10 +73,27 @@ function Component(props) {
73
74 export const FIXTURE_ENTRYPOINT = {
75 fn: Component,
66 - params: [{ cond: true }],
76 + params: [],
77 + sequentialRenders: [
78 + { cond: true },
79 + { cond: true },
80 + { cond: false },
81 + { cond: false },
82 + { cond: true },
83 + { cond: false },
84 + { cond: true },
85 + { cond: false },
86 + ],
87 };
88
89 ```
90
91 ### Eval output
72 -(kind: ok) [1]
\ No newline at end of file
92 +(kind: ok) [1]
93 +[1]
94 +[2]
95 +[2]
96 +[1]
97 +[2]
98 +[1]
99 +[2]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.js
+11 -1
@@ -21,5 +21,15 @@ function Component(props) {
21
22 export const FIXTURE_ENTRYPOINT = {
23 fn: Component,
24 - params: [{ cond: true }],
24 + params: [],
25 + sequentialRenders: [
26 + { cond: true },
27 + { cond: true },
28 + { cond: false },
29 + { cond: false },
30 + { cond: true },
31 + { cond: false },
32 + { cond: true },
33 + { cond: false },
34 + ],
35 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.expect.md
+30 -5
@@ -23,8 +23,17 @@ function Component({ value }) {
23
24 export const FIXTURE_ENTRYPOINT = {
25 fn: Component,
26 - params: [{ value: GLOBAL }],
27 - // TODO: test executing the sequence {value: GLOBAL}, {value: null}, {value: GLOBAL}
26 + params: [],
27 + sequentialRenders: [
28 + { value: GLOBAL },
29 + { value: GLOBAL },
30 + { value: null },
31 + { value: null },
32 + { value: GLOBAL },
33 + { value: null },
34 + { value: GLOBAL },
35 + { value: null },
36 + ],
37 };
38
39 ```
@@ -61,11 +70,27 @@ function Component(t14) {
70
71 export const FIXTURE_ENTRYPOINT = {
72 fn: Component,
64 - params: [{ value: GLOBAL }],
65 - // TODO: test executing the sequence {value: GLOBAL}, {value: null}, {value: GLOBAL}
73 + params: [],
74 + sequentialRenders: [
75 + { value: GLOBAL },
76 + { value: GLOBAL },
77 + { value: null },
78 + { value: null },
79 + { value: GLOBAL },
80 + { value: null },
81 + { value: GLOBAL },
82 + { value: null },
83 + ],
84 };
85
86 ```
87
88 ### Eval output
71 -(kind: ok) [1]
\ No newline at end of file
89 +(kind: ok) [1]
90 +[1]
91 +[2]
92 +[2]
93 +[1]
94 +[2]
95 +[1]
96 +[2]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.js
+11 -2
@@ -19,6 +19,15 @@ function Component({ value }) {
19
20 export const FIXTURE_ENTRYPOINT = {
21 fn: Component,
22 - params: [{ value: GLOBAL }],
23 - // TODO: test executing the sequence {value: GLOBAL}, {value: null}, {value: GLOBAL}
22 + params: [],
23 + sequentialRenders: [
24 + { value: GLOBAL },
25 + { value: GLOBAL },
26 + { value: null },
27 + { value: null },
28 + { value: GLOBAL },
29 + { value: null },
30 + { value: GLOBAL },
31 + { value: null },
32 + ],
33 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.expect.md
+30 -3
@@ -20,7 +20,17 @@ function Component(props) {
20
21 export const FIXTURE_ENTRYPOINT = {
22 fn: Component,
23 - params: [{ cond: true }],
23 + params: [],
24 + sequentialRenders: [
25 + { cond: true },
26 + { cond: true },
27 + { cond: false },
28 + { cond: false },
29 + { cond: true },
30 + { cond: false },
31 + { cond: true },
32 + { cond: false },
33 + ],
34 };
35
36 ```
@@ -54,10 +64,27 @@ function Component(props) {
64
65 export const FIXTURE_ENTRYPOINT = {
66 fn: Component,
57 - params: [{ cond: true }],
67 + params: [],
68 + sequentialRenders: [
69 + { cond: true },
70 + { cond: true },
71 + { cond: false },
72 + { cond: false },
73 + { cond: true },
74 + { cond: false },
75 + { cond: true },
76 + { cond: false },
77 + ],
78 };
79
80 ```
81
82 ### Eval output
63 -(kind: ok) [true]
\ No newline at end of file
83 +(kind: ok) [true]
84 +[true]
85 +[false]
86 +[false]
87 +[true]
88 +[false]
89 +[true]
90 +[false]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.js
+11 -1
@@ -16,5 +16,15 @@ function Component(props) {
16
17 export const FIXTURE_ENTRYPOINT = {
18 fn: Component,
19 - params: [{ cond: true }],
19 + params: [],
20 + sequentialRenders: [
21 + { cond: true },
22 + { cond: true },
23 + { cond: false },
24 + { cond: false },
25 + { cond: true },
26 + { cond: false },
27 + { cond: true },
28 + { cond: false },
29 + ],
30 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.expect.md
+30 -3
@@ -23,7 +23,17 @@ function Component(props) {
23
24 export const FIXTURE_ENTRYPOINT = {
25 fn: Component,
26 - params: [{ cond: true }],
26 + params: [],
27 + sequentialRenders: [
28 + { cond: true },
29 + { cond: true },
30 + { cond: false },
31 + { cond: false },
32 + { cond: true },
33 + { cond: false },
34 + { cond: true },
35 + { cond: false },
36 + ],
37 };
38
39 ```
@@ -59,10 +69,27 @@ function Component(props) {
69
70 export const FIXTURE_ENTRYPOINT = {
71 fn: Component,
62 - params: [{ cond: true }],
72 + params: [],
73 + sequentialRenders: [
74 + { cond: true },
75 + { cond: true },
76 + { cond: false },
77 + { cond: false },
78 + { cond: true },
79 + { cond: false },
80 + { cond: true },
81 + { cond: false },
82 + ],
83 };
84
85 ```
86
87 ### Eval output
68 -(kind: ok) [true]
\ No newline at end of file
88 +(kind: ok) [true]
89 +[true]
90 +[false]
91 +[false]
92 +[true]
93 +[false]
94 +[true]
95 +[false]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.js
+11 -1
@@ -19,5 +19,15 @@ function Component(props) {
19
20 export const FIXTURE_ENTRYPOINT = {
21 fn: Component,
22 - params: [{ cond: true }],
22 + params: [],
23 + sequentialRenders: [
24 + { cond: true },
25 + { cond: true },
26 + { cond: false },
27 + { cond: false },
28 + { cond: true },
29 + { cond: false },
30 + { cond: true },
31 + { cond: false },
32 + ],
33 };
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.expect.md
+30 -3
@@ -22,7 +22,17 @@ function Component(props) {
22
23 export const FIXTURE_ENTRYPOINT = {
24 fn: Component,
25 - params: [{ test: 12 }],
25 + params: [],
26 + sequentialRenders: [
27 + { test: 12 },
28 + { test: 12 },
29 + { test: 1 },
30 + { test: 1 },
31 + { test: 12 },
32 + { test: 1 },
33 + { test: 12 },
34 + { test: 1 },
35 + ],
36 };
37
38 ```
@@ -57,10 +67,27 @@ function Component(props) {
67
68 export const FIXTURE_ENTRYPOINT = {
69 fn: Component,
60 - params: [{ test: 12 }],
70 + params: [],
71 + sequentialRenders: [
72 + { test: 12 },
73 + { test: 12 },
74 + { test: 1 },
75 + { test: 1 },
76 + { test: 12 },
77 + { test: 1 },
78 + { test: 12 },
79 + { test: 1 },
80 + ],
81 };
82
83 ```
84
85 ### Eval output
66 -(kind: ok) [10]
\ No newline at end of file
86 +(kind: ok) [10]
87 +[10]
88 +[1]
89 +[1]
90 +[10]
91 +[1]
92 +[10]
93 +[1]
\ No newline at end of file
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.js
+11 -1
@@ -18,5 +18,15 @@ function Component(props) {
18
19 export const FIXTURE_ENTRYPOINT = {
20 fn: Component,
21 - params: [{ test: 12 }],
21 + params: [],
22 + sequentialRenders: [
23 + { test: 12 },
24 + { test: 12 },
25 + { test: 1 },
26 + { test: 1 },
27 + { test: 12 },
28 + { test: 1 },
29 + { test: 12 },
30 + { test: 1 },
31 + ],
32 };