Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[compiler][fixtures] Repro for fbt + non-ascii strings #30386

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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')
```
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" }],
};
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"
```
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" }],
};
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"
```
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" }],
};
Loading