WhoBuilt

React Native at Scale With Mike Duminy

Nov 30, 2023· 1 h 17 min· 1.7K views·Watch on YouTube

Speakers

Mike Duminy, principal engineer and domain architect at Klarna, discusses building and operating a large React Native app with Callstack’s Kuba and host in Wrocław.

Klarna’s app and scale

Duminy describes Klarna as a shopping and payments company whose app lets customers shop, pay, track deliveries, and use rewards. The company handles more than 2 million purchases a day and has over 150 million customers; its app has about 30 million monthly active users. Duminy says teams use instrumentation and A/B tests to understand behavior and measure changes against KPIs.

Why Klarna uses React Native and Re.Pack

Klarna’s shared monorepo supports its React Native app, web app, internal apps, and browser extension. Duminy says shared UI, logic, types, and tooling make it easier to support multiple platforms and help feature developers work through common abstractions. Re.Pack provides access to Webpack features such as tree shaking and code splitting; the app’s production JavaScript bundle is about 40 to 50 MB, compared with roughly 110 MB in development mode.

Performance, releases, and updates

Duminy recalls a performance push that brought Android startup time from nearly 30 seconds to about 2.5 seconds, while iOS startup is now under a second. He says Re.Pack was one part of a broader effort, so the improvement cannot be attributed to it alone. Klarna releases the public app weekly and uses a custom Re.Pack based process to send smaller JavaScript updates when urgent fixes are needed, targeting updates to specific app versions.

Teams and code ownership

Duminy describes around 70 teams working in the client codebase, with the broader React Native group ranging between 350 and 500 people. Teams own vertical slices of customer problems, including the related client and backend work, and can set their own KPIs. In the monorepo, package.json fields assign ownership through roughly 4,000 workspaces, and a merge checker identifies the teams responsible for changed files.

A shared experience across platforms

Klarna wants customers to move between products and platforms while keeping a cohesive experience. Duminy says the goal is for a feature team to build a Klarna feature that can run across the app, web, browser extension, and other touchpoints. The team is exploring Module Federation to resolve parts of the app at runtime, support independent deployment, and share dependencies.

Takeaways

  • Choose Re.Pack when its specific capabilities address a real need; Duminy says Metro offers a better developer experience for many apps.
  • Measure startup time directly: Duminy says bundle size stopped being a reliable proxy after Klarna adopted Hermes.
  • For urgent JavaScript updates, target specific app versions and account for compatibility with native code.
  • Give teams ownership of customer outcomes across client and backend layers, and make code ownership visible in the repository.
  • Treat cross-platform feature delivery as an organizational and architectural goal that requires shared abstractions and coordination.

Mentioned in this talk

Search inside this talk

What was claimed 23

  • integrates with
    Re.Pack integrates with webpack
    “Re.Pack is a toolkit for React Native applications that works with Webpack.”
    0:18inWhat is Re.Pack?YouTube
    Verified7 sources· Talk
  • metric
    Klarna: React Native app used by tens of millions of people every month; about 400 people work on it
    “We have about 400 people working on it, and it’s used by tens of millions of people every month.”
    YouTube
    Unverified1 source· Talk
  • uses
    “We have a React Native app.”
    YouTube
    Unverified1 source· Talk
  • role at
    Mike Duminy is principal engineer and domain architect at Klarna
    “I work at Klarna as a principal engineer and domain architect.”
    YouTube
    Unverified1 source· Talk
  • built
    “I’m the author of Super App Training.”
    YouTube
    Unverified1 source· Talk
  • role at
    Kuba is maintainer at Re.Pack
    “I’m the maintainer of the Re.Pack library.”
    YouTube
    Unverified1 source· Talk
  • role at
    Kuba is software developer at Klarna
    “I’m a software developer here at Klarna.”
    YouTube
    Unverified1 source· Talk
  • metric
    Klarna: About 80 million app downloads and roughly 30 million monthly active users
    “We’ve got about 80 million downloads and roughly 30 million monthly active users.”
    YouTube
    Unverified1 source· Talk
  • metric
    Klarna: Over 150 million customers
    “We have over 150 million customers at the company level.”
    YouTube
    Unverified1 source· Talk
  • metric
    Klarna: Over 2 million purchases per day globally
    “We have over 2 million purchases per day globally.”
    YouTube
    Unverified1 source· Talk
  • metric
    Klarna: About 42 million wishlists
    “We have about 42 million wishlists.”
    YouTube
    Unverified1 source· Talk
  • uses
    shared codebase for React Native, web, internal apps, and browser extension
    “We have a monorepo that powers our React Native app and holds the services that support it.”
    YouTube
    Unverified1 source· Talk
  • feature
    Klarna: Uses an internal mirror for NPM, CocoaPods, Gradle, and Maven dependencies
    “They all go through an internal mirror that we control.”
    YouTube
    Unverified1 source· Talk
  • feature
    Re.Pack: Enables tree shaking, code splitting, symlinks, and access to the Webpack ecosystem in React Native
    “It enables things like tree shaking, code splitting, and even symlinks.”
    YouTube
    Unverified1 source· Talk
  • feature
    Klarna: Reduced Android startup time from about 30 seconds to 2.5 seconds
    “We went from about 30 seconds on Android to 2.5 seconds.”
    YouTube
    Unverified1 source· Talk
  • feature
    Klarna: IOS startup time is now under one second
    “On iOS, it’s under a second now.”
    YouTube
    Unverified1 source· Talk
  • uses
    for development
    “For development, we don’t need to optimize as much.”
    YouTube
    Unverified1 source· Talk
  • uses
    for production builds
    “We use Re.Pack for production.”
    YouTube
    Unverified1 source· Talk
  • metric
    Klarna: About 70 teams work on the codebase; React Native group fluctuates between 350 and 500 people
    “We have about 70 teams working on this codebase.”
    YouTube
    Unverified1 source· Talk
  • metric
    Klarna: Public app release cycle is weekly; web app releases 10 to 15 times a day
    “We release our web app multiple times a day... about 10 to 15 times a day.”
    YouTube
    Unverified1 source· Talk
  • uses
    for production optimization and custom over-the-air updates
    “We built an in-house process that works on top of Re.Pack to allow us to do this.”
    YouTube
    Unverified1 source· Talk
  • feature
    Klarna: Uses an in-house package.json team field to assign code ownership by repository subtree
    “The root has a package.json with a team field... Everything below that is owned by that team.”
    YouTube
    Unverified1 source· Talk
  • metric
    Klarna: About 4,000 Yarn workspaces in the client repository
    “We’ve got about 4,000 of those in our client’s repository.”
    YouTube
    Unverified1 source· Talk

Related talks