Slide 1

Slide 1 text

Ahmed El-Helw - Abdulahi Osoble without a Monorepo Scaling Android Development HudHud Maps - Careem Technologies

Slide 2

Slide 2 text

This Talk is Not Monorepo vs non-Monorepo

Slide 3

Slide 3 text

Starting Point Sharing Libraries

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Merging 2 Apps

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

“MiniApps” are just Groupings of Features

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

Container (App Shell) * Lives in its own repository * “Cont a ins” (depends on) a ll the fe a tures a nd deleg a tes to them * Outputs the f in a l a pk th a t goes to the Pl a y Store

Slide 11

Slide 11 text

Architectural Principles

Slide 12

Slide 12 text

* No fe a ture directly depends on a nother * Fe a tures a re option a l (T&Cs a pply) * Aim tow a rds not h a ving n di ff erent w a ys of doing things

Slide 13

Slide 13 text

inte rf ace Feat ur eFacto ry { fu n p r ovideFeat u r e(dependenciesP r ovide r : DependenciesP r ovide r ): Feat ur e } inte rf ace Feat ur e { // .. . }

Slide 14

Slide 14 text

inte rf ace Feat ur eFacto ry { fu n p r ovideFeat u r e(dependenciesP r ovide r : DependenciesP r ovide r ): Feat ur e } inte rf ace Feat ur e { // .. . }

Slide 15

Slide 15 text

inte rf ace DependenciesP r ovide r { fu n ana ly tics(): Ana ly ticsP r ovide r fu n expe r iments(): Expe r iments fu n l ocationDependencies(): LocationDependencies fu n netwo rk ingDependencies(): Netwo r k ingDependencies }

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

Dependencies • Cont a iner implements DependenciesP r ovide r • Fe a ture doesn't need to know the concrete type • We c a n ch a nge det a ils without fe a tures needing to m a ke a ny ch a nges a s long a s the API is consistent

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

Dependencies Provider * it’s a n interf a ce, so we c a n h a ve fun with individu a l dependencies * Wr a p it * No-op it * Repl a ce it

Slide 22

Slide 22 text

Navigating with Deep Links

Slide 23

Slide 23 text

scheme: / / /

Slide 24

Slide 24 text

inte rf ace DeepLin k Reso l ve r { f u n r eso l ve( ur i: St r ing): Intent? }

Slide 25

Slide 25 text

inte rf ace Feat ur e { f u n deepLin k Reso l ve r (): DeepLin k Reso l ve r ? = n ul l }

Slide 26

Slide 26 text

fu n r eso l veDeepLin k ( ur i: St r ing): Intent? { va l host = u r i.pa r seHost() va l f eat ur e = feat ur es.getO r Defa ul t(host, n ul l ) r et ur n f eat u r e ?. deepLin k Reso l ve r () ? .r eso l ve( u r i) }

Slide 27

Slide 27 text

fu n r eso l veDeepLin k ( ur i: St r ing): Intent? { va l host = u r i.pa r seHost() va l f eat ur e = feat ur es.getO r Defa ul t(host, n ul l ) r et ur n f eat u r e ?. deepLin k Reso l ve r () ? .r eso l ve( u r i) }

Slide 28

Slide 28 text

fu n r eso l veDeepLin k ( ur i: St r ing): Intent? { va l host = u r i.pa r seHost() va l f eat ur e = feat ur es.getO r Defa ul t(host, n ul l ) r et ur n f eat u r e ?. deepLin k Reso l ve r () ? .r eso l ve( u r i) }

Slide 29

Slide 29 text

Registration

Slide 30

Slide 30 text

va l feat u r eFacto r ies = mapOf( " r ides" to RidesFacto ry (), " f ood" to FoodFacto ry () )

Slide 31

Slide 31 text

imp l ementation( l ibs. f eat ur e. r ides) imp l ementation( l ibs. f eat ur e.food)

Slide 32

Slide 32 text

/ / imp l ementation( l ibs. f eat ur e. r ides) imp l ementation( l ibs. f eat ur e.food)

Slide 33

Slide 33 text

Push Noti f ications • Received by the cont a iner a nd deleg a ted, b a sed on a f ield, to the proper fe a ture

Slide 34

Slide 34 text

How do teams develop?

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

Librarisize the Container

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

CI/CD

Slide 40

Slide 40 text

Sharing steps

Slide 41

Slide 41 text

Common checks

Slide 42

Slide 42 text

Dependency Diff c a reem/dependency-di ff -tldr

Slide 43

Slide 43 text

Size Delta J a keWh a rton/di ff use

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Manifest Diff

Slide 46

Slide 46 text

Source Compatibility ch a nges to...

Slide 47

Slide 47 text

Source Compatibility ch a nges to...

Slide 48

Slide 48 text

Binary Compatibility

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

Run It

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

No content

Slide 55

Slide 55 text

No content

Slide 56

Slide 56 text

No content

Slide 57

Slide 57 text

No content

Slide 58

Slide 58 text

No content

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

Binary Compatibility • Gr a dle will compile e a ch module a g a inst the st a ted version • For p a ck a ging a nd runtime, Gr a dle picks the "newest" version

Slide 62

Slide 62 text

Tooling can Help for our Libs • https://github.com/Kotlin/bin a ry-comp a tibility-v a lid a tor • https://github.com/tylerbwong/met a l a v a -gr a dle

Slide 63

Slide 63 text

Dependency Ownership • Pl a tform Dependencies • Fe a ture speci f ic Dependencies

Slide 64

Slide 64 text

Dependency Alignment • Publish BOM or Version c a t a log • Centr a lizing control of BOM/Version c a t a log a t a pl a tform level • Pl a tform dependencies only

Slide 65

Slide 65 text

Challenges • More di ff icult to m a ke ch a nges a cross a ll a pps • Deprec a tions a re tricky to m a ke • Extr a cting st a nd a lone SDKs is tricky

Slide 66

Slide 66 text

Thank You

Slide 67

Slide 67 text

for some smaller teams having devx is a distant dream but they can continue to scale until their codebase is as big as a whale ignoring the monorepo reviews multiple repos they will use one main repository controls the release version bump PRs will certainly increase since every team builds on their own tests and makes sure it works on their phone uploads their new version to internal maven the ability to rollback makes it a haven tooling comes into play helping to fi nd bugs and slay detect hidden changes before they break catch them early before the mistake di ff erences in size of apks dependency di ff s across the days a central team controls dependencies setting the version and avoiding redundancies let's not forget compatibility too binary and source to name a few using the tools and being aware helps save us from lots of despair unfortunately, that is all the time allotted for this summary rhyme written with 0% GPT now go enjoy sessions and co ff ee

Slide 68

Slide 68 text

Scaling with Kotlin Multiplatform • Te a ms h a ve their own KMP dependencies • Choice between n a mesp a ce cl a shing a nd "KMP" per fr a mework t a x on iOS • Bridges h a ve to be repe a ted, since types a re a ll slightly di ff erent