diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/bug-fbt-preserve-whitespace-param.expect.md b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/bug-fbt-preserve-whitespace-param.expect.md new file mode 100644 index 0000000000000..3baa1d9811ae3 --- /dev/null +++ b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/bug-fbt-preserve-whitespace-param.expect.md @@ -0,0 +1,100 @@ + +## Input + +```javascript +import fbt from 'fbt'; + +/** + * Currently fails with the following: + * Found differences in evaluator results + * Non-forget (expected): + * (kind: ok)
Jason !
+ * Forget: + * (kind: ok)
Jason!
+ + */ + +function Foo(props) { + return ( + // prettier-ignore +
+ + + + {props.name} + + ! + + +
+ ); +} + +export const FIXTURE_ENTRYPOINT = { + fn: Foo, + params: [{name: 'Jason'}], +}; + +``` + +## Code + +```javascript +import { c as _c } from "react/compiler-runtime"; +import fbt from "fbt"; + +/** + * Currently fails with the following: + * Found differences in evaluator results + * Non-forget (expected): + * (kind: ok)
Jason !
+ * Forget: + * (kind: ok)
Jason!
+ + */ + +function Foo(props) { + const $ = _c(2); + let t0; + if ($[0] !== props.name) { + t0 = ( +
+ {fbt._( + "{=m0}", + [ + fbt._implicitParam( + "=m0", + + {fbt._( + "{user name}!", + [ + fbt._param( + "user name", + + props.name, + ), + ], + { hk: "mBBZ9" }, + )} + , + ), + ], + { hk: "3RVfuk" }, + )} +
+ ); + $[0] = props.name; + $[1] = t0; + } else { + t0 = $[1]; + } + return t0; +} + +export const FIXTURE_ENTRYPOINT = { + fn: Foo, + params: [{ name: "Jason" }], +}; + +``` + \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/bug-fbt-preserve-whitespace-param.tsx b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/bug-fbt-preserve-whitespace-param.tsx new file mode 100644 index 0000000000000..3f0b84533546e --- /dev/null +++ b/compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/fbt/bug-fbt-preserve-whitespace-param.tsx @@ -0,0 +1,32 @@ +import fbt from 'fbt'; + +/** + * Currently fails with the following: + * Found differences in evaluator results + * Non-forget (expected): + * (kind: ok)
Jason !
+ * Forget: + * (kind: ok)
Jason!
+ + */ + +function Foo(props) { + return ( + // prettier-ignore +
+ + + + {props.name} + + ! + + +
+ ); +} + +export const FIXTURE_ENTRYPOINT = { + fn: Foo, + params: [{name: 'Jason'}], +}; diff --git a/compiler/packages/snap/src/SproutTodoFilter.ts b/compiler/packages/snap/src/SproutTodoFilter.ts index 1fb1b0da02129..ebc49f68ab470 100644 --- a/compiler/packages/snap/src/SproutTodoFilter.ts +++ b/compiler/packages/snap/src/SproutTodoFilter.ts @@ -484,6 +484,7 @@ const skipFilter = new Set([ 'rules-of-hooks/rules-of-hooks-69521d94fa03', // bugs + 'fbt/bug-fbt-preserve-whitespace-param', 'bug-invalid-hoisting-functionexpr', 'original-reactive-scopes-fork/bug-nonmutating-capture-in-unsplittable-memo-block', 'original-reactive-scopes-fork/bug-hoisted-declaration-with-scope',