-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
chore: use official react-compiler-runtime package #51233
chore: use official react-compiler-runtime package #51233
Conversation
- Replaced local `react-compiler-runtime` with the official npm package. - Updated Babel config to target React 18 by changing `runtimeModule` to `target: '18'`. - Removed local `react-compiler-runtime` implementation and its dependencies from `lib/` directory. - Updated references in `package-lock.json` and `package.json` to point to the official package.
… in Jest - Fixed an issue where components compiled using `react-compiler` were not being tested in Jest. - Updated ReactCompilerConfig to exclude test files from compilation but still compile components imported in tests.
All contributors have signed the CLA ✍️ ✅ |
@marcaaron Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
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.
🙏
I have read the CLA Document and I hereby sign the CLA |
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.
While working on my PR I was unsure if we should install experimental versions of compiler vs beta version, have you verified which one is correct?
environment: { | ||
enableTreatRefLikeIdentifiersAsRefs: true, | ||
}, | ||
// We exclude 'tests' directory from compilation, but still compile components imported in test files. | ||
sources: (filename) => !filename.includes('tests/'), |
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.
Nice one 🙌
@@ -304,7 +304,7 @@ | |||
"prettier": "^2.8.8", | |||
"pusher-js-mock": "^0.3.3", | |||
"react-compiler-healthcheck": "^0.0.0-experimental-ab3118d-20240725", | |||
"react-compiler-runtime": "file:./lib/react-compiler-runtime", | |||
"react-compiler-runtime": "^0.0.0-experimental-8a03594-20241020", |
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.
What about react-compiler-healthcheck
package? Shouldn't it be bumped too?
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.
Same with eslint-plugin-react-compiler
I believe @blazejkustra will take over these changes |
Currently both beta and experimental point to the same version, but we were using experimental one before. |
Closing in favour of #51183 |
Details
react-compiler-runtime
with the official npm package.runtimeModule
totarget: '18'
.react-compiler-runtime
implementation and its dependencies fromlib/
directory.react-compiler
were not being tested in Jest.Fixed Issues
$ #49393
PROPOSAL:
Tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos