dillon1000/react
Commit
Browse files Repro of fbt issues
Adds the two FBT (https://facebook.github.io/fbt/) plugins to our test setup so
that we can verify Forget plays well with FBT. Unfortunately FBT's plugins are a
bit finicky, and things that are technically allowed per the JSX spec (such as
wrapping string attribute values in a JsxExpressionContainer) aren't supported
by FBT's plugin. This PR is just to add the fbt plugins and highlight some cases
that fail; these are fixed in later PRs in the stack.
For example, the `fbt-params.js` fixture fails on this PR:
Input
```error.fbt-params.js
import fbt from "fbt";
function Component(props) {
return (
<fbt desc={"Dialog to show to user"}>
Hello <fbt:param name="user name">{props.name}</fbt:param>
</fbt>
);
}
```
Output
```
React Forget › __tests__/fixtures/compiler › fixtures › fbt-params
Expected fixture 'fbt-params' to succeed but it failed with error:
/Users/joesavona/github/react-forget/forget/fbt-params: fbt: unsupported babel
node: MemberExpression
---
props.name
---
```
See fixes later in the stack.Changed paths13 files
First-parent comparisoncompiler/forget/package.json ModifiedM compiler/forget/src/Babel/RunReactForgetBabelPlugin.ts ModifiedA compiler/forget/src/__tests__/fixtures/compiler/error.fbt-params-complex-param-value.expect.md AddedR compiler/forget/src/__tests__/fixtures/compiler/fbt-params-complex-param-value.js →compiler/forget/src/__tests__/fixtures/compiler/error.fbt-params-complex-param-value.js RenamedA compiler/forget/src/__tests__/fixtures/compiler/error.fbt-params.expect.md AddedR compiler/forget/src/__tests__/fixtures/compiler/fbt-params.js →compiler/forget/src/__tests__/fixtures/compiler/error.fbt-params.js RenamedM compiler/forget/src/__tests__/fixtures/compiler/fbt-call-complex-param-value.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/fbt-call-complex-param-value.js ModifiedM compiler/forget/src/__tests__/fixtures/compiler/fbt-call.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/compiler/fbt-call.js ModifiedD compiler/forget/src/__tests__/fixtures/compiler/fbt-params-complex-param-value.expect.md DeletedD compiler/forget/src/__tests__/fixtures/compiler/fbt-params.expect.md DeletedM compiler/forget/yarn.lock ModifiedPatch
Files changed
Rendering syntax-highlighted changes…