WhoBuilt

The New Architecture is Here…What now?

Jul 22, 2022· 30 min· 3.8K views·Watch on YouTube

Speaker

Lorenzo Sciandra, senior software engineer at Microsoft and React Native core maintainer, explains the new React Native architecture and migration planning for the React Native Wrocław Meetup.

From Paper to the new architecture

Sciandra reviews Paper’s main pieces: Metro, JavaScriptCore, the bridge, JSON messaging, and Yoga. Its asynchronous message queue can become a bottleneck, JavaScript and native code lack shared type awareness, and modules may load at startup even when used much later.

What JSI, Fabric, and Codegen change

JSI provides a C++ interface between JavaScript and native code, enabling direct calls and lazy module loading. Fabric connects Yoga and JavaScript with multiple rendering priorities, while Codegen creates native interfaces from JavaScript, TypeScript, or Flow definitions. The bridge can remain during migration before a later bridgeless step.

Migration challenges and compatibility

Codegen has typing limits, including unsupported union and custom types in the version discussed, and TypeScript support is still in beta. Libraries may need substantial refactoring, including replacing APIs such as UIManager and findNodeHandle. Sciandra also notes that React Native Directory listed almost 1,100 libraries, with only four plus one fork reported as migrated at the time, and warns that React 18 requires compatible state management libraries.

A staged migration plan

Sciandra recommends migrating libraries first, and extracting app-specific native modules into libraries where practical. Then enable TurboModules, which can coexist with Paper libraries, and wait until key dependencies support the new architecture before enabling Fabric. He advises budgeting months for the work and using the Architecture Working Group to report issues and improve the migration path.

Takeaways

  • Budget several months for a React Native new architecture migration.
  • Start with libraries, then move custom native modules toward TurboModules.
  • Check Codegen type support and refactor library APIs before enabling the new architecture.
  • Verify state management and GraphQL dependencies support React 18 before adopting Fabric.
  • Share migration problems with the Architecture Working Group to help improve tooling and guidance.

Mentioned in this talk

Search inside this talk

What was claimed 14

Show all 14 facts

Related talks