website/blog/2022-06-16-resources-migrating-your-react-native-library-to-the-new-architecture.md
tl; dr: We are working on improving the resources supporting the React Native New Architecture. We have already released a repository to help migrate your app (RNNewArchitectureApp) and one for your libraries (RNNewArchitectureLibraries). We are also revamping the New Architecture guide on the Website and we created a GitHub Working Group to answer questions related to the New Architecture.
<!--truncate-->In this post we are sharing an update on tools and resources to help you migrate your Native Modules and Native Components to their New Architecture equivalents, TurboModule and Fabric Components.
React Native users leverage vast number of open source libraries for building apps. For a complete and consistent ecosystem, it is necessary that these libraries migrate such that everyone can benefit from the unlocked capabilities and performance improvements of the New Architecture.
Here is what we’re working on to support library developers in migrating to the New Architecture:
In this post, we will dig deeper into these resources and explain in more detail how you can use them most efficiently. Finally, we will provide a snapshot of the current migration state for the most used React Native libraries.
In the past 6 months, we’ve added a guide on adopting the New Architecture and an architecture deep-dive on Fabric. We plan to expand this to include more guides and documentation around creating TurboModules, understanding Codegen, and more. We plan to have updates to share by the 0.70 release.
Currently, the New Architecture guide covers how to migrate your app and your libraries to support the New Architecture properly.
If you are interested in the evolution of this guide, or have feedback, you can follow along on this pull request.
For developers who may want to follow along in code, we’ve prepared two example repositories.
This repo was created to demonstrate how to migrate an app, the native modules and the native components from the legacy architecture on the React Native version 0.67 to the New Architecture and the most recent version of React Native. Each commit corresponds to an isolated migration step.
<figure><figcaption>Commit list for a migration in the RNNewArchitectureApp repository</figcaption>
The repo is organized as follows:
Some of the migration branches also have a RUN.md file which describes in a more human-readable fashion the exact steps that have been applied in every commit.
We plan to keep this example up to date with the most recent stable releases, adding migrations to any minor release of React Native we are going to release. If you notice issue with any of the steps, please file an issue in the repository. This will hold until we have the reasonable feeling that most of the React Native users have migrated to the New Architecture.
Similarly, this repo provides a step-by-step guide on how to create a TurboModule and a Fabric Component. It has a focus on ensuring backward compatibility between the New Architecture and the legacy one.
The repository is organized in a similar way to the previous one:
We plan to keep this example updated onto new releases of React Native, especially releases that affect library development, as well as add more examples on how to use advanced features (for example: implementing commands, event emitters, custom state). If you notice errors, please file an issue in the example repository.
We’ve created a dedicated working group to give the community space to ask questions and get updates on the New Architecture. If you are a library maintainer, this is a valuable resource to find answers to your questions, and for us to know about your requirements. To join, please follow these instructions. Everyone is welcome.
The working group is organized into several sections:
To use this group effectively:
We plan to support this group until the New Architecture is enabled by default and all the major libraries have been migrated to it.
Libraries maintainers have been sharing with us in the working group the status of their migration effort, and we wanted to provide you with a quick overview:
We are invested in supporting the React Native community’s adoption of the New Architecture. Concretely, we will continue to:
In addition, React Native 0.69 will ship with improved devX for app and library developers for New Architecture adoption. You can find more information about the 0.69.0 release here.
We are excited about what we will build together with the New Architecture!