-
Notifications
You must be signed in to change notification settings - Fork 46.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[compiler][fixtures] Repro for fbt + non-ascii strings
ghstack-source-id: 05211980566f8c061ac2ca8ce51e442d234beacc Pull Request resolved: #30386
- Loading branch information
Showing
6 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
...src/__tests__/fixtures/compiler/fbt/error.todo-fbt-param-with-newline.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,36 @@ | ||
|
||
## Input | ||
|
||
```javascript | ||
import fbt from "fbt"; | ||
|
||
function Component(props) { | ||
const element = ( | ||
<fbt desc={"Dialog to show to user"}> | ||
Hello{" "} | ||
<fbt:param | ||
name="a really long description | ||
that got split into multiple lines" | ||
> | ||
{props.name} | ||
</fbt:param> | ||
</fbt> | ||
); | ||
return element.toString(); | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ name: "Jason" }], | ||
}; | ||
|
||
``` | ||
|
||
|
||
## Error | ||
|
||
``` | ||
Cannot read properties of undefined (reading 'replace') | ||
``` | ||
21 changes: 21 additions & 0 deletions
21
...n-react-compiler/src/__tests__/fixtures/compiler/fbt/error.todo-fbt-param-with-newline.js
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,21 @@ | ||
import fbt from "fbt"; | ||
|
||
function Component(props) { | ||
const element = ( | ||
<fbt desc={"Dialog to show to user"}> | ||
Hello{" "} | ||
<fbt:param | ||
name="a really long description | ||
that got split into multiple lines" | ||
> | ||
{props.name} | ||
</fbt:param> | ||
</fbt> | ||
); | ||
return element.toString(); | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ name: "Jason" }], | ||
}; |
30 changes: 30 additions & 0 deletions
30
.../src/__tests__/fixtures/compiler/fbt/error.todo-fbt-param-with-quotes.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,30 @@ | ||
|
||
## Input | ||
|
||
```javascript | ||
import fbt from "fbt"; | ||
|
||
function Component(props) { | ||
const element = ( | ||
<fbt desc={"Dialog to show to user"}> | ||
Hello <fbt:param name='"user" name'>{props.name}</fbt:param> | ||
</fbt> | ||
); | ||
return element.toString(); | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ name: "Jason" }], | ||
}; | ||
|
||
``` | ||
|
||
|
||
## Error | ||
|
||
``` | ||
Property arguments[0] of CallExpression expected node to be of a type ["Expression","SpreadElement","JSXNamespacedName","ArgumentPlaceholder"] but instead got "JSXExpressionContainer" | ||
``` | ||
15 changes: 15 additions & 0 deletions
15
...in-react-compiler/src/__tests__/fixtures/compiler/fbt/error.todo-fbt-param-with-quotes.js
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,15 @@ | ||
import fbt from "fbt"; | ||
|
||
function Component(props) { | ||
const element = ( | ||
<fbt desc={"Dialog to show to user"}> | ||
Hello <fbt:param name='"user" name'>{props.name}</fbt:param> | ||
</fbt> | ||
); | ||
return element.toString(); | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ name: "Jason" }], | ||
}; |
30 changes: 30 additions & 0 deletions
30
...src/__tests__/fixtures/compiler/fbt/error.todo-fbt-param-with-unicode.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,30 @@ | ||
|
||
## Input | ||
|
||
```javascript | ||
import fbt from "fbt"; | ||
|
||
function Component(props) { | ||
const element = ( | ||
<fbt desc={"Dialog to show to user"}> | ||
Hello <fbt:param name="user name ☺">{props.name}</fbt:param> | ||
</fbt> | ||
); | ||
return element.toString(); | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ name: "Jason" }], | ||
}; | ||
|
||
``` | ||
|
||
|
||
## Error | ||
|
||
``` | ||
Property arguments[0] of CallExpression expected node to be of a type ["Expression","SpreadElement","JSXNamespacedName","ArgumentPlaceholder"] but instead got "JSXExpressionContainer" | ||
``` | ||
15 changes: 15 additions & 0 deletions
15
...n-react-compiler/src/__tests__/fixtures/compiler/fbt/error.todo-fbt-param-with-unicode.js
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,15 @@ | ||
import fbt from "fbt"; | ||
|
||
function Component(props) { | ||
const element = ( | ||
<fbt desc={"Dialog to show to user"}> | ||
Hello <fbt:param name="user name ☺">{props.name}</fbt:param> | ||
</fbt> | ||
); | ||
return element.toString(); | ||
} | ||
|
||
export const FIXTURE_ENTRYPOINT = { | ||
fn: Component, | ||
params: [{ name: "Jason" }], | ||
}; |