WhoBuilt

Changing React Native... from within!

Sep 20, 2022· 34 min· 1.2K views·Watch on YouTube

Speaker

Adam Foxman, principal software engineer at Microsoft, explains how Microsoft is improving React Native’s developer experience at React Native EU 2022, hosted by Callstack.

Why React Native gets harder at scale

Microsoft uses React Native across products including Office, Windows, Teams, and Xbox, but complex apps and large monorepos expose gaps in the developer experience. Duplicate package versions can bloat bundles or cause problems with shared state, while mismatches between React Native and libraries such as Gesture Handler and Reanimated can break apps during upgrades.

Make upgrades and development loops more reliable

Adding React Native to a mature application with a complicated native UI can be much harder than starting a new app. At Microsoft, monorepos with more than 5,000 external dependencies make upgrades difficult because changes ripple through libraries and apps. Foxman also points to slow bundling, Metro’s costly file crawl, missing symlink support, and limited TypeScript integration as obstacles.

Build tools that help the wider community

Microsoft’s RNX Kit is a community project for React Native developer experience, with about 30 released packages, five incubating packages, and test apps for Expo and bare React Native. Its tools are developed and tested against Microsoft’s large repositories, then shared so other teams can use them and contribute improvements.

Automate dependency checks and improve Metro

Dep Check uses a database of dependency versions tested with particular React Native releases to help teams upgrade compatible packages together. RNX Kit also adds Metro symlink support, bundle-time TypeScript and platform-specific checks, esbuild-based tree shaking, and plugins that detect duplicate packages and dependency cycles.

Use collaboration to move the ecosystem forward

Foxman says lasting change depends on collaboration as well as tools. The Bundle Working Group brings together people from Meta, Callstack, Expo, Airbnb, Google, and Klarna for monthly discussions about bundling. Microsoft invites developers to try RNX Kit, share feedback, and contribute code.

Takeaways

  • Track dependency compatibility across React Native upgrades instead of guessing package versions.
  • Use bundle checks to catch duplicate dependencies and cycles before they reach users.
  • Treat TypeScript checks as part of the React Native development and CI workflow.
  • When integrating React Native into a mature app, expect its existing native UI architecture to shape the work.
  • Open tools and contribution paths can help improvements tested at one company benefit the wider community.

Mentioned in this talk

Search inside this talk

What was claimed 10

Related talks