Slide 1

Slide 1 text

Scaling CocoaPods Samuel Giddins Scaling CocoaPods @ Square 1

Slide 2

Slide 2 text

Samuel Giddins Mobile Developer Experience @ Square CocoaPods Core Contributor Scaling CocoaPods @ Square 2

Slide 3

Slide 3 text

Mobile Developer Experience Scaling CocoaPods @ Square 3

Slide 4

Slide 4 text

Mobile Developer Experience ➡ Owns the build system, dependency manager, interface with CI Scaling CocoaPods @ Square 3

Slide 5

Slide 5 text

Mobile Developer Experience ➡ Owns the build system, dependency manager, interface with CI ➡ Maintains the (open source) tools used to build the app Scaling CocoaPods @ Square 3

Slide 6

Slide 6 text

Mobile Developer Experience ➡ Owns the build system, dependency manager, interface with CI ➡ Maintains the (open source) tools used to build the app ➡ Keeps developers as productive as possible Scaling CocoaPods @ Square 3

Slide 7

Slide 7 text

Mobile Developer Experience ➡ Owns the build system, dependency manager, interface with CI ➡ Maintains the (open source) tools used to build the app ➡ Keeps developers as productive as possible ➡ Cross platform: iOS & Android Scaling CocoaPods @ Square 3

Slide 8

Slide 8 text

Mobile Developer Experience ➡ Owns the build system, dependency manager, interface with CI ➡ Maintains the (open source) tools used to build the app ➡ Keeps developers as productive as possible ➡ Cross platform: iOS & Android ➡ Develops CocoaPods features Scaling CocoaPods @ Square 3

Slide 9

Slide 9 text

CocoaPods @ Square Scaling CocoaPods @ Square 4

Slide 10

Slide 10 text

CocoaPods @ Square ➡ 265 total pods Scaling CocoaPods @ Square 4

Slide 11

Slide 11 text

CocoaPods @ Square ➡ 265 total pods ➡Pods directory is 1005 MB Scaling CocoaPods @ Square 4

Slide 12

Slide 12 text

CocoaPods @ Square ➡ 265 total pods ➡Pods directory is 1005 MB ➡Over 10,000 source files Scaling CocoaPods @ Square 4

Slide 13

Slide 13 text

CocoaPods @ Square ➡ 265 total pods ➡Pods directory is 1005 MB ➡Over 10,000 source files ➡ Swift, Objective-C Scaling CocoaPods @ Square 4

Slide 14

Slide 14 text

CocoaPods @ Square ➡ 265 total pods ➡Pods directory is 1005 MB ➡Over 10,000 source files ➡ Swift, Objective-C ➡ Dynamic Frameworks, Static Libraries, Static Frameworks Scaling CocoaPods @ Square 4

Slide 15

Slide 15 text

CocoaPods @ Square ➡ 265 total pods ➡Pods directory is 1005 MB ➡Over 10,000 source files ➡ Swift, Objective-C ➡ Dynamic Frameworks, Static Libraries, Static Frameworks ➡ Monorepo & Multirepo Scaling CocoaPods @ Square 4

Slide 16

Slide 16 text

CocoaPods @ Square is CocoaPods @ Scale Scaling CocoaPods @ Square 5

Slide 17

Slide 17 text

CocoaPods at home in a monorepo Generating a scratch workspace for a single pod $ pod gen Frameworks/SquareUIComponents --auto-open Describing tests in a podspec Pod::Spec.new do |s| s.test_spec 'Tests' do |ts| ts.source_files = 'Tests/**/*.{h,m}' end end Scaling CocoaPods @ Square 6

Slide 18

Slide 18 text

Automation Removing the depending on the open-source specs repo $ pod whitelist NAME VERSION Whitelists a (pod, version) tuple for internal Square use Automatically generating pre-built binary pods on CI $ pod bin NAME.podspec [ARTIFACT_REPO_URL] Converts the provided `NAME.podspec` into a binary version. The process includes, installing a sandbox, building the sandbox using release configuration for both device and simulator, packing the output and generate a new podspec that uses `ARTIFACT_REPO_URL` as the source. The generated podspec is also validated. Scaling CocoaPods @ Square 7

Slide 19

Slide 19 text

CocoaPods Performance Scaling CocoaPods @ Square 8

Slide 20

Slide 20 text

CocoaPods Performance ➡ Lots of profiling with rbspy Scaling CocoaPods @ Square 8

Slide 21

Slide 21 text

CocoaPods Performance ➡ Lots of profiling with rbspy ➡ Resolver refactoring to make graph traversal not take forever Scaling CocoaPods @ Square 8

Slide 22

Slide 22 text

CocoaPods Performance ➡ Lots of profiling with rbspy ➡ Resolver refactoring to make graph traversal not take forever ➡ Build setting generation rewrite to memoize everything Scaling CocoaPods @ Square 8

Slide 23

Slide 23 text

Investment in Monitoring Scaling CocoaPods @ Square 9

Slide 24

Slide 24 text

Investment in Monitoring ➡ chronometer to instrument method calls Scaling CocoaPods @ Square 9

Slide 25

Slide 25 text

Investment in Monitoring ➡ chronometer to instrument method calls ➡ Log durations to in-house logging system Scaling CocoaPods @ Square 9

Slide 26

Slide 26 text

Investment in Monitoring ➡ chronometer to instrument method calls ➡ Log durations to in-house logging system ➡ Roll up into dashboards visible to the entire organization Scaling CocoaPods @ Square 9

Slide 27

Slide 27 text

Investment in Monitoring Scaling CocoaPods @ Square 10

Slide 28

Slide 28 text

Ownership of our Destiny Scaling CocoaPods @ Square 11

Slide 29

Slide 29 text

Ownership of our Destiny ➡ The team owns our use of CocoaPods, not any individual contributors Scaling CocoaPods @ Square 11

Slide 30

Slide 30 text

Ownership of our Destiny ➡ The team owns our use of CocoaPods, not any individual contributors ➡ No forks, few hacks, no helplessness Scaling CocoaPods @ Square 11

Slide 31

Slide 31 text

Ownership of our Destiny ➡ The team owns our use of CocoaPods, not any individual contributors ➡ No forks, few hacks, no helplessness ➡ Open Source sharing expertise with therest of the industry Scaling CocoaPods @ Square 11

Slide 32

Slide 32 text

Continuous Re-Evaluation Scaling CocoaPods @ Square 12

Slide 33

Slide 33 text

Continuous Re-Evaluation ➡ Even though we have core contributors, we're open to not using CocoaPods Scaling CocoaPods @ Square 12

Slide 34

Slide 34 text

Continuous Re-Evaluation ➡ Even though we have core contributors, we're open to not using CocoaPods ➡ Taking as many lessons as possible from other tools, such as Buck and Bazel Scaling CocoaPods @ Square 12

Slide 35

Slide 35 text

Continuous Re-Evaluation ➡ Even though we have core contributors, we're open to not using CocoaPods ➡ Taking as many lessons as possible from other tools, such as Buck and Bazel ➡ CocoaPods is a tool, tools are replaceable. Our expertise is forever. Scaling CocoaPods @ Square 12

Slide 36

Slide 36 text

CocoaPods: Scaled? Scaling CocoaPods @ Square 13

Slide 37

Slide 37 text

CocoaPods: Scaled? Scaling CocoaPods @ Square 14

Slide 38

Slide 38 text

CocoaPods: Scaled? ➡ Last year's crisis of confidence is over Scaling CocoaPods @ Square 14

Slide 39

Slide 39 text

CocoaPods: Scaled? ➡ Last year's crisis of confidence is over ➡ We've onboarded 2 new people to contribute to CocoaPods Scaling CocoaPods @ Square 14

Slide 40

Slide 40 text

CocoaPods: Scaled? ➡ Last year's crisis of confidence is over ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) Scaling CocoaPods @ Square 14

Slide 41

Slide 41 text

CocoaPods: Scaled? ➡ Last year's crisis of confidence is over ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) ➡ Performance has improved slightly, with a massive increase in: Scaling CocoaPods @ Square 14

Slide 42

Slide 42 text

CocoaPods: Scaled? ➡ Last year's crisis of confidence is over ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) ➡ Performance has improved slightly, with a massive increase in: ➡features Scaling CocoaPods @ Square 14

Slide 43

Slide 43 text

CocoaPods: Scaled? ➡ Last year's crisis of confidence is over ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) ➡ Performance has improved slightly, with a massive increase in: ➡features ➡# of modules Scaling CocoaPods @ Square 14

Slide 44

Slide 44 text

CocoaPods: Scaled? ➡ Last year's crisis of confidence is over ➡ We've onboarded 2 new people to contribute to CocoaPods ➡ Development has internal ownership (my team!) ➡ Performance has improved slightly, with a massive increase in: ➡features ➡# of modules ➡amount of code managed by CocoaPods Scaling CocoaPods @ Square 14

Slide 45

Slide 45 text

CocoaPods: Scaled @segiddins MDX @ Square Scaling CocoaPods @ Square 15