perf: move pods installation from init to ios-specific commands#2077
Merged
thymikee merged 22 commits intoreact-native-community:mainfrom Sep 21, 2023
Merged
Conversation
thymikee
reviewed
Sep 15, 2023
thymikee
reviewed
Sep 15, 2023
thymikee
reviewed
Sep 15, 2023
thymikee
reviewed
Sep 15, 2023
thymikee
reviewed
Sep 15, 2023
thymikee
reviewed
Sep 15, 2023
e4675c1 to
3615491
Compare
thymikee
reviewed
Sep 18, 2023
thymikee
reviewed
Sep 18, 2023
0611e23 to
1876e6a
Compare
979f872 to
d35c42a
Compare
thymikee
reviewed
Sep 20, 2023
thymikee
reviewed
Sep 20, 2023
thymikee
approved these changes
Sep 20, 2023
adamTrz
approved these changes
Sep 20, 2023
d35c42a to
5f386b4
Compare
init to ios-specific commandsinit to ios-specific commands
2 tasks
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.
Summary:
Currently Pods are installed during
initcommand, what makes project setup much longer than it supposed to be. This change makes pods installation optional during theinitcommand by displaying the prompt, and moves the installation process to therun-iosandbuild-ioscommands. Pods are automatically installed when running ios-specific commands and:package.json--force-podswas used, which forces to install pods (might be helpful when there are any errors related to pods)Additionally, new flag
--install-podswas introduced toinitcommand, to avoid displaying prompt. If set totrue, pods will install,falsewill skip the installation, and when not used, prompt will be displayed.To install pods during
*-ioscommand, it compares md5 hashes of native dependencies names and its versions. To achieve this, I added one new field to dependency config:versionwhich holds the version of the library from package.json/podspec file.Demo
1.
initwith promptScreen.Recording.2023-09-19.at.10.27.12.mov
2.
initwith--install-pods false- skip prompt and pods installationScreen.Recording.2023-09-19.at.10.18.10.mov
3.
run-iosfor the first time (cut the video because it takes too long 😄, app runs after installation)run-ios.mov
Test Plan:
yto confirm - pods should be installed--install-podsflag - pods should be installed automatically--install-pods false- prompt & pods installation should be skippedrun-ioscommand and verify pods are installed before building the apprun-iosagain and verify app is built without installing pods@react-navigation/nativerun-iosagain and verify pods are installed before building the apprun-iosagain and verify app is built without installing podsrun-ios --force-podsand verify pods are installed before building the appChecklist