File tree 3 files changed +108
-0
lines changed
babel-plugin-react-compiler/src/__tests__/fixtures/compiler 3 files changed +108
-0
lines changed Original file line number Diff line number Diff line change
1
+
2
+ ## Input
3
+
4
+ ``` javascript
5
+ // @gating
6
+
7
+ /**
8
+ * Fail: bug-gating-invalid-function-properties
9
+ * Unexpected error in Forget runner
10
+ * Component is not defined
11
+ */
12
+ export default function Component () {
13
+ return <>< / > ;
14
+ }
15
+
16
+ export function Component2 () {
17
+ return <>< / > ;
18
+ }
19
+
20
+ Component .displayName = " Component ONE" ;
21
+ Component2 .displayName = " Component TWO" ;
22
+
23
+ export const FIXTURE_ENTRYPOINT = {
24
+ fn: Component,
25
+ params: [],
26
+ sequentialRenders: [],
27
+ };
28
+
29
+ ```
30
+
31
+ ## Code
32
+
33
+ ``` javascript
34
+ import { isForgetEnabled_Fixtures } from " ReactForgetFeatureFlag" ;
35
+ import { c as _c } from " react/compiler-runtime" ; // @gating
36
+
37
+ /**
38
+ * Fail: bug-gating-invalid-function-properties
39
+ * Unexpected error in Forget runner
40
+ * Component is not defined
41
+ */
42
+ export default isForgetEnabled_Fixtures ()
43
+ ? function Component () {
44
+ const $ = _c (1 );
45
+ let t0;
46
+ if ($[0 ] === Symbol .for (" react.memo_cache_sentinel" )) {
47
+ t0 = <>< / > ;
48
+ $[0 ] = t0;
49
+ } else {
50
+ t0 = $[0 ];
51
+ }
52
+ return t0;
53
+ }
54
+ : function Component () {
55
+ return <>< / > ;
56
+ };
57
+
58
+ export const Component2 = isForgetEnabled_Fixtures ()
59
+ ? function Component2 () {
60
+ const $ = _c (1 );
61
+ let t0;
62
+ if ($[0 ] === Symbol .for (" react.memo_cache_sentinel" )) {
63
+ t0 = <>< / > ;
64
+ $[0 ] = t0;
65
+ } else {
66
+ t0 = $[0 ];
67
+ }
68
+ return t0;
69
+ }
70
+ : function Component2 () {
71
+ return <>< / > ;
72
+ };
73
+
74
+ Component .displayName = " Component ONE" ;
75
+ Component2 .displayName = " Component TWO" ;
76
+
77
+ export const FIXTURE_ENTRYPOINT = {
78
+ fn: Component,
79
+ params: [],
80
+ sequentialRenders: [],
81
+ };
82
+
83
+ ```
84
+
Original file line number Diff line number Diff line change
1
+ // @gating
2
+
3
+ /**
4
+ * Fail: bug-gating-invalid-function-properties
5
+ * Unexpected error in Forget runner
6
+ * Component is not defined
7
+ */
8
+ export default function Component ( ) {
9
+ return < > </ > ;
10
+ }
11
+
12
+ export function Component2 ( ) {
13
+ return < > </ > ;
14
+ }
15
+
16
+ Component . displayName = "Component ONE" ;
17
+ Component2 . displayName = "Component TWO" ;
18
+
19
+ export const FIXTURE_ENTRYPOINT = {
20
+ fn : Component ,
21
+ params : [ ] ,
22
+ sequentialRenders : [ ] ,
23
+ } ;
Original file line number Diff line number Diff line change @@ -490,6 +490,7 @@ const skipFilter = new Set([
490
490
"bug-invalid-hoisting-functionexpr" ,
491
491
"original-reactive-scopes-fork/bug-nonmutating-capture-in-unsplittable-memo-block" ,
492
492
"original-reactive-scopes-fork/bug-hoisted-declaration-with-scope" ,
493
+ "bug-gating-invalid-function-properties" ,
493
494
494
495
// 'react-compiler-runtime' not yet supported
495
496
"flag-enable-emit-hook-guards" ,
You can’t perform that action at this time.
0 commit comments