Repro for fbt:enum source location issue

Fbt enums appear to rely on source locations and something that we're doing 
(maybe destructuring?) isn't preserving locations such that the fbt plugin 
breaks.
This commit is contained in:
Joe Savona
2024-03-19 15:21:55 -07:00
parent 7257c9b4f8
commit 501481ccea
2 changed files with 35 additions and 0 deletions
@@ -0,0 +1,25 @@
## Input
```javascript
import fbt from "fbt";
function Component({ a, b }) {
return (
<fbt desc="Description">
<fbt:enum enum-range={["avalue1", "avalue1"]} value={a} />{" "}
<fbt:enum enum-range={["bvalue1", "bvalue2"]} value={b} />
</fbt>
);
}
```
## Error
```
avalue1 not found in { bvalue1: 'bvalue1', bvalue2: 'bvalue2' }. Attempting to re-use incompatible enums
```
@@ -0,0 +1,10 @@
import fbt from "fbt";
function Component({ a, b }) {
return (
<fbt desc="Description">
<fbt:enum enum-range={["avalue1", "avalue1"]} value={a} />{" "}
<fbt:enum enum-range={["bvalue1", "bvalue2"]} value={b} />
</fbt>
);
}