chore: use official react-compiler-runtime package#51233
chore: use official react-compiler-runtime package#51233piotrski wants to merge 2 commits intoExpensify:mainfrom
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] |
|
I have read the CLA Document and I hereby sign the CLA |
blazejkustra
left a comment
There was a problem hiding this comment.
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?
| enableTreatRefLikeIdentifiersAsRefs: true, | ||
| }, | ||
| // We exclude 'tests' directory from compilation, but still compile components imported in test files. | ||
| sources: (filename) => !filename.includes('tests/'), |
| "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.
What about react-compiler-healthcheck package? Shouldn't it be bumped too?
There was a problem hiding this comment.
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-runtimewith the official npm package.runtimeModuletotarget: '18'.react-compiler-runtimeimplementation and its dependencies fromlib/directory.react-compilerwere not being tested in Jest.Fixed Issues
$ #49393
PROPOSAL:
Tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos