-
Notifications
You must be signed in to change notification settings - Fork 47.8k
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][patch] Fix jsx non-ascii regex pattern #30382
Changes from 4 commits
13640da
8fc521d
5768a14
f62cedc
5d893a9
cdf360e
f1f0aaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This error is not caught and handled by Forget as it occurs in EDIT: moved this fixture to #30386 |
||
``` | ||
|
||
|
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" }], | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously, we were matching
|
literalsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't recall why we needed to escape the
u{...
, does it work without them?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the docs, 1 and 2, I think
\u{HHHH}
and\uHHHH
both work