-
Notifications
You must be signed in to change notification settings - Fork 47k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ghstack-poisoned]
- Loading branch information
Showing
5 changed files
with
104 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 0 additions & 107 deletions
107
...mpiler/src/__tests__/fixtures/compiler/bug-renaming-jsx-tag-lowercase.expect.md
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
...-plugin-react-compiler/src/__tests__/fixtures/compiler/bug-renaming-jsx-tag-lowercase.tsx
This file was deleted.
Oops, something went wrong.
85 changes: 85 additions & 0 deletions
85
...t-compiler/src/__tests__/fixtures/compiler/renaming-jsx-tag-lowercase.expect.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
|
||
## Input | ||
|
||
```javascript | ||
import {Stringify, identity, useIdentity} from 'shared-runtime'; | ||
|
||
function Foo({}) { | ||
const x = {}; | ||
const y = {}; | ||
useIdentity(0); | ||
return ( | ||
<> | ||
<Stringify value={identity(y)} /> | ||
<Stringify value={identity(x)} /> | ||
</> | ||
); | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Foo, | ||
params: [{}], | ||
}; | ||
|
||
``` | ||
|
||
## Code | ||
|
||
```javascript | ||
import { c as _c } from "react/compiler-runtime"; | ||
import { Stringify, identity, useIdentity } from "shared-runtime"; | ||
|
||
function Foo(t0) { | ||
const $ = _c(9); | ||
const x = {}; | ||
const y = {}; | ||
useIdentity(0); | ||
|
||
const T0 = Stringify; | ||
const t1 = identity(y); | ||
let t2; | ||
if ($[0] !== T0 || $[1] !== t1) { | ||
t2 = <T0 value={t1} />; | ||
$[0] = T0; | ||
$[1] = t1; | ||
$[2] = t2; | ||
} else { | ||
t2 = $[2]; | ||
} | ||
const T1 = Stringify; | ||
const t3 = identity(x); | ||
let t4; | ||
if ($[3] !== T1 || $[4] !== t3) { | ||
t4 = <T1 value={t3} />; | ||
$[3] = T1; | ||
$[4] = t3; | ||
$[5] = t4; | ||
} else { | ||
t4 = $[5]; | ||
} | ||
let t5; | ||
if ($[6] !== t2 || $[7] !== t4) { | ||
t5 = ( | ||
<> | ||
{t2} | ||
{t4} | ||
</> | ||
); | ||
$[6] = t2; | ||
$[7] = t4; | ||
$[8] = t5; | ||
} else { | ||
t5 = $[8]; | ||
} | ||
return t5; | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Foo, | ||
params: [{}], | ||
}; | ||
|
||
``` | ||
### Eval output | ||
(kind: ok) <div>{"value":{}}</div><div>{"value":{}}</div> |
18 changes: 18 additions & 0 deletions
18
...abel-plugin-react-compiler/src/__tests__/fixtures/compiler/renaming-jsx-tag-lowercase.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {Stringify, identity, useIdentity} from 'shared-runtime'; | ||
|
||
function Foo({}) { | ||
const x = {}; | ||
const y = {}; | ||
useIdentity(0); | ||
return ( | ||
<> | ||
<Stringify value={identity(y)} /> | ||
<Stringify value={identity(x)} /> | ||
</> | ||
); | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Foo, | ||
params: [{}], | ||
}; |