@samitouri / QOS-React / commits / 966932c525

fix again :(

Mike Vitousek committed Feb 9, 2024 at 15:17 UTC 966932c525f1aeaa30bec7381e2899de9a6c074b
2 files changed +7 -36
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/no-flow-bailout-unrelated.expect.md
+5 -28
@@ -9,18 +9,12 @@ function useX() {}
9 function Foo(props) {
10 // $FlowFixMe[incompatible-type]
11 useX();
12 - const x = new Foo(...props.foo, null, ...[props.bar]);
13 - return x;
12 + return null;
13 }
14
15 export const FIXTURE_ENTRYPOINT = {
16 fn: Foo,
18 - params: [
19 - {
20 - foo: [1],
21 - bar: 2,
22 - },
23 - ],
17 + params: [{}],
18 };
19
20 ```
@@ -28,35 +22,18 @@ export const FIXTURE_ENTRYPOINT = {
22 ## Code
23
24 ```javascript
31 -import { unstable_useMemoCache as useMemoCache } from "react"; // @enableFlowSuppressions
25 +// @enableFlowSuppressions
26
27 function useX() {}
28
29 function Foo(props) {
36 - const $ = useMemoCache(3);
37 -
30 useX();
39 - let t0;
40 - if ($[0] !== props.bar || $[1] !== props.foo) {
41 - t0 = new Foo(...props.foo, null, ...[props.bar]);
42 - $[0] = props.bar;
43 - $[1] = props.foo;
44 - $[2] = t0;
45 - } else {
46 - t0 = $[2];
47 - }
48 - const x = t0;
49 - return x;
31 + return null;
32 }
33
34 export const FIXTURE_ENTRYPOINT = {
35 fn: Foo,
54 - params: [
55 - {
56 - foo: [1],
57 - bar: 2,
58 - },
59 - ],
36 + params: [{}],
37 };
38
39 ```
compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/no-flow-bailout-unrelated.js
+2 -8
@@ -5,16 +5,10 @@ function useX() {}
5 function Foo(props) {
6 // $FlowFixMe[incompatible-type]
7 useX();
8 - const x = new Foo(...props.foo, null, ...[props.bar]);
9 - return x;
8 + return null;
9 }
10
11 export const FIXTURE_ENTRYPOINT = {
12 fn: Foo,
14 - params: [
15 - {
16 - foo: [1],
17 - bar: 2,
18 - },
19 - ],
13 + params: [{}],
14 };