-
Notifications
You must be signed in to change notification settings - Fork 47.5k
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
fix(react-compiler): JSXText
emits incorrect with bracket
#32138
Conversation
472c0cc
to
ee65f6c
Compare
JSXText
emits incorrect with bracket
Thanks for the report and fix! Instead of adding a playground test, can you add this as a unit test fixture?
// component to compile
function Test({friends}) {
return (
<div>
If the string contains the string {pageNumber} it will be
replaced by the page number.
</div>
);
}
// Export for test evaluator to know which function to invoke.
// Test evaluator will compare the result of compiledFn() against originalFn()
export const FIXTURE_ENTRYPOINT = {
fn: Test,
params: [{friends: []}],
};
# in react/compiler
$ yarn; yarn snap --update |
compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts
Outdated
Show resolved
Hide resolved
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.
Looks good overall, please address feedback and we'll merge this 🙂
ae79d12
to
6efadb9
Compare
Done |
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.
Let's remove the changes to page.spec.ts
(the playground test) and rename descriptive-name.jsx
to a descriptive name, e.g. your PR title jsx-bracket-repro.jsx
6efadb9
to
86c00df
Compare
86c00df
to
304f98c
Compare
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.
Awesome, thanks for the fix!
Summary
Our LlamaIndex Product is blocked by this bug
Fixes: #32137
How did you test this change?