Cleanup platform specifics from hermes build - #80110
Conversation
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. |
|
@jayeshmangwani 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] |
|
@akinwale @roryabraham One of you needs to 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] |
|
|
||
| const metro = { | ||
| presets: [require('@react-native/babel-preset')], | ||
| presets: [[require('@react-native/babel-preset'), {disableImportExportTransform: true}]], |
There was a problem hiding this comment.
how about
| presets: [[require('@react-native/babel-preset'), {disableImportExportTransform: true}]], | |
| presets: [[require('@react-native/babel-preset'), {disableImportExportTransform: runningIn !== 'babel-jest'}]], |
There was a problem hiding this comment.
I thought about if, but for it we will have to wrap metro config into module to get the runningIn variable from api.
If metro is outside the function, it builds once when the module loads. If we move it inside it rebuilds on every Babel call. TBH I am not sure if it will impact the performance, but it might.
| @@ -1,4 +1,3 @@ | |||
| const {getDefaultConfig: getExpoDefaultConfig} = require('expo/metro-config'); | |||
There was a problem hiding this comment.
expo/metro-config could potentially be removed from the project deps as well?
There was a problem hiding this comment.
We don’t have this package directly added to package.json, so there’s nothing to remove on our side. We still have some expo packages in the project, it can be required indirectly as a transitive dependency though
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-01-28.at.09.18.18.movAndroid: mWeb ChromeScreen.Recording.2026-01-28.at.09.02.45.moviOS: HybridAppScreen.Recording.2026-01-28.at.09.45.51.moviOS: mWeb SafariScreen.Recording.2026-01-28.at.09.01.15.movMacOS: Chrome / SafariScreen.Recording.2026-01-28.at.08.59.48.mov |
|
@mountiny Changes look good and work well |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Curious how this affects TTI metrics, please let me know @roryabraham @rinej |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.11-0 🚀
|
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.3.12-1 🚀
|
Explanation of Change
In the PR we're enabling platform shaking by aligning Metro and Babel configurations and removing the unnecessary Expo Metro config dependency. This allows Metro to properly eliminate unused, platform-specific code from the final bundle.
The bundle size was reduced from 37.1 MB to 34.2 MB (~2.9 MB, ~8%).
These changes still need to be validated on ad-hoc builds to ensure everything works as expected.
Fixed Issues
$ #80500
PROPOSAL:
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)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
Android: Native
android.mp4
Android: mWeb Chrome
iOS: Native
ios.mp4
iOS: mWeb Safari
MacOS: Chrome / Safari