[No QA] Add support for consuming React Native artifacts on iOS#96293
Draft
mateuuszzzzz wants to merge 21 commits into
Draft
[No QA] Add support for consuming React Native artifacts on iOS#96293mateuuszzzzz wants to merge 21 commits into
mateuuszzzzz wants to merge 21 commits into
Conversation
…ogic to typescript utilities
Contributor
|
|
Codecov Report✅ All modified and coverable lines are covered by tests. |
Contributor
Author
|
TODO: Before merging this we need to create artifacts from this branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
This PR adds the code that lets our custom prebuilt React Native artifacts be consumed at build time, and extracts the shared resolution logic into a single TypeScript utility.
Until now, the logic that decides which published artifact version matches the local patches lived only on the Android side, in Gradle. This PR moves that common logic into a shared TypeScript utility (
scripts/artifacts-utils/lib/artifactsResolver.ts, invoked viaresolve-artifacts.ts). Both the Android Gradle consumer and the new iOS Ruby consumer (scripts/artifacts-utils/ios/patched_ios_artifacts.rb) now call this single resolver, so React Native version detection, GitHub Packages version lookups, and patches hash matching all live in one place instead of being duplicated per platform.The patched artifacts utilities were also reorganized under
scripts/artifacts-utils/(a small folder structure cleanup), andcompute-patches-hash.shmoved there so publishing and consumption reference the same script.iOS consumer
The iOS Ruby helper (
patched_ios_artifacts.rb) reopensReactNativeCoreUtilsto point React Native Core resolution and download at our private GitHub Packages Maven repo, matched by the patches hash. It lives in this repo because the HybridApp build (Mobile-Expensify) requires it.Mobile-Expensify companion PR
This change is paired with Mobile-Expensify PR https://github.com/Expensify/Mobile-Expensify/pull/13918, which wires the HybridApp iOS build to consume the artifacts. That PR requires the iOS helper from this repo, builds RNFB and RNSentry as static libraries so they stay compatible with the prebuilt React Core under
use_frameworks!, and adds aBUILD_RN_FROM_SOURCEtoggle so developers can fall back to building React Native from source if prebuilds ever cause a problem for them.Standalone NewDot is not supported yet
Standalone NewDot iOS does not consume the prebuilt artifacts for now. Under
use_frameworks! :linkage => :static(required by Firebase) the prebuilt React Core cannot exposeReact_RCTAppDelegateas an importable Swift module, which the standalone SwiftAppDelegateneeds. HybridApp is unaffected because itsAppDelegateis written in Objective C and imports that header directly with#importrather than as a Swift module. Standalone consumption is deferred.Depends on
This PR builds on the publishing infrastructure in #88523. Until that one merges, the diff here also shows those publishing changes.
Fixed Issues
$
PROPOSAL:
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13918
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari