diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.expect.md index 1acb1eaeb2..4e5aee9945 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.expect.md @@ -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] \ No newline at end of file +(kind: ok) [10] +[10] +[1] +[1] +[10] +[1] +[10] +[1] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.js index abad99e92d..ce7a269c5c 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-indirect.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.expect.md index 7ab540b22a..c452730c6f 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.expect.md @@ -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] \ No newline at end of file +(kind: ok) [10] +[10] +[1] +[1] +[10] +[1] +[10] +[1] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.js index 8c1382e4a1..bfec97389d 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-do-while-test.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.expect.md index caebc16a56..ef1f315813 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.expect.md @@ -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] \ No newline at end of file +(kind: ok) [0] +[0] +[null] +[null] +[0] +[null] +[0] +[null] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.js index 11c0bb101b..9f5d475997 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-init.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.expect.md index b57c7515a4..51535c27b4 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.expect.md @@ -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] \ No newline at end of file +(kind: ok) [10] +[10] +[1] +[1] +[10] +[1] +[10] +[1] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.js index 1f16801221..0aac7661c3 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-test.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.expect.md index 63b662ffd0..4cc3c12c4f 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.expect.md @@ -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] \ No newline at end of file +(kind: ok) [2] +[2] +[1] +[1] +[2] +[1] +[2] +[1] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.js index bc6e7e0033..356df12338 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-for-update.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.expect.md index 86a5eb604f..5cf8d72901 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.expect.md @@ -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] \ No newline at end of file +(kind: ok) [10] +[10] +[1] +[1] +[10] +[1] +[10] +[1] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.js index 870c5085fc..6796efda6a 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forin-collection.js @@ -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 } }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.expect.md index 89fb305ee9..90561c13d5 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.expect.md @@ -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] \ No newline at end of file +(kind: ok) [10] +[10] +[1] +[1] +[10] +[1] +[10] +[1] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.js index 18a5e720d3..5fe07f4069 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-forof-collection.js @@ -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] }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.expect.md index 67a03c65c0..df5b3583c8 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.expect.md @@ -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] \ No newline at end of file +(kind: ok) [1] +[1] +[2] +[2] +[1] +[2] +[1] +[2] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.js index 436328d817..5518499a48 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-if.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.expect.md index c12ccd9d57..0e4b9e5c34 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.expect.md @@ -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 \ No newline at end of file +(kind: ok) ok +ok +ok +ok +ok +ok +ok +ok \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.js index 5137f4d978..10b1357e0d 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-phi-setState-type.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.expect.md index 7c4621a0fc..1f29694203 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.expect.md @@ -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] \ No newline at end of file +(kind: ok) [1] +[1] +[2] +[2] +[1] +[2] +[1] +[2] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.js index f6c90d6906..08ed5d6db4 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-reactive-after-fixpoint.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.expect.md index 589d8e14a2..70dbfa1120 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.expect.md @@ -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] \ No newline at end of file +(kind: ok) [1] +[1] +[2] +[2] +[1] +[2] +[1] +[2] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.js index cde6e913e7..61ce4cad2b 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-case-test.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.expect.md index 16b06a5935..a72645458b 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.expect.md @@ -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] \ No newline at end of file +(kind: ok) [1] +[1] +[2] +[2] +[1] +[2] +[1] +[2] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.js index b11940cbbe..da2b256c23 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-switch-condition.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.expect.md index 93c9aeb826..273aff065e 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.expect.md @@ -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] \ No newline at end of file +(kind: ok) [true] +[true] +[false] +[false] +[true] +[false] +[true] +[false] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.js index 4fc1a4d67d..d8df5ac6f8 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-if.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.expect.md index 9f67305fbb..7e8ed2e59f 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.expect.md @@ -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] \ No newline at end of file +(kind: ok) [true] +[true] +[false] +[false] +[true] +[false] +[true] +[false] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.js index d0c932cc1c..f2c5544ba9 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-via-mutation-switch.js @@ -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 }, + ], }; diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.expect.md index 4fe22772cd..44f5ea8d40 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.expect.md +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.expect.md @@ -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] \ No newline at end of file +(kind: ok) [10] +[10] +[1] +[1] +[10] +[1] +[10] +[1] \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.js index 26061e12a4..9bac5a7474 100644 --- a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.js +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/reactive-control-dependency-while-test.js @@ -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 }, + ], };