Skip to content

New resources for migrating libraries to the New Architecture

updated

The React Native team has shared an update on the tools and resources available to help developers migrate Native Modules and Native Components to their New Architecture equivalents: TurboModules and Fabric Components. The effort focuses on three areas: documentation, example migrations and community support.

React Native apps use a vast number of open source libraries, and those libraries need to migrate for everyone to benefit from the capabilities and performance improvements of the New Architecture.

Documentation

Over the past six months, the website gained a guide on adopting the New Architecture and an architecture deep-dive on Fabric. The guide currently covers migrating both apps and libraries. The team plans to add material on creating TurboModules, understanding Codegen and related topics, with updates expected by the 0.70 release. Progress on the guide can be followed in a public pull request.

Example repositories

Two repositories show the migration process in code:

  • RNNewArchitectureApp demonstrates how to move an app, along with its native modules and components, from the legacy architecture on React Native 0.67 to the New Architecture on the latest version. Each commit is an isolated migration step. The main branch contains only a README.md pointing to migration branches, and some branches include a RUN.md file describing each step in plain language. The team intends to add migrations for future minor releases.
  • RNNewArchitectureLibraries offers a step-by-step guide to creating a TurboModule and a Fabric Component that remain backward compatible with the legacy architecture. Future additions are planned for advanced features such as commands, event emitters and custom state.

Issues with either repository can be filed directly on GitHub.

Working Group

A GitHub Working Group created earlier this year gives the community a place to ask questions and follow progress. It has sections for Announcements, Deep Dive, Documentation, Libraries, Q&A and Releases. Library maintainers are encouraged to list their library in the Libraries section so the team can track migration status and understand common obstacles. The team plans to support the group until the New Architecture is enabled by default and major libraries have migrated.

According to maintainers' reports in the Working Group:

  • react-native-gesture-handler: migrated
  • react-native-reanimated: migrated, with testing and performance profiling in progress
  • react-native-template-new-architecture: migrated, gradually adopting more companion libraries
  • react-native-template-typescript: migrated
  • react-native-navigation, react-native-pager-view, react-native-screens: ongoing
  • react-native-slider, react-native-webview: started

Next steps

The team says it will keep offering best-effort support in the Working Group, add more examples, maintain up-to-date documentation, track library migration status and simplify the migration path. React Native 0.69 is also set to ship with improved developer experience for adopting the New Architecture in apps and libraries.

Source: reactnative.dev