Skip to content

Commit 226ecc9

Browse files
author
Riccardo
committed
[Guide - The New Architecture] What Backward Compatibility Is (#3038)
1 parent 037fbc4 commit 226ecc9

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/the-new-architecture/backward-compatibility.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ id: backward-compatibility
33
title: What Backward Compatibility Is
44
---
55

6-
This section contains a brief paragraph explaining why library developers should be mindful about backward compatibility.
6+
Creating a backward compatible module is important to provide a library that works in both the **Old Architecture** and the **New Architecture**. Not all the users of your library will immediately jump on the new architecture ship: it is a good thing that they will be able to use your library even if they are still using the old architecture.
77

8-
It could contains shared section between the backward compatibility for TurboModules and Native Components.
8+
The trick to create a good backward compatible module is to minimize the changes required to adopt the new version. In that way, users of the module can smoothly move to the new version and migrate to the new architecture when they are ready, ideally by issueing one different command.
9+
10+
To achieve this result, we have to perform few changes in our **TurboModule** and **Fabric Component** configurations. The steps we have to follow are:
11+
12+
1. **Update the installation configuration** to avoid downloading dependencies that are not needed by the Old Architecture.
13+
1. **Update the code** to support both architectures. Both Android and iOS build pipelines gives you mechanism to provide a library that will compile with the correct React Native Architecture.
14+
1. **Configure the specs to load the proper implementation**, so that the JavaScript layer leverages the New Architecture whan it is available.
15+
16+
:::info
17+
The next sections requires that you are familiar with the [Pillars](pillars) of the **New Architecture**.
18+
:::
19+
20+
- To create a backward compatible **TurboModule**, follow [this guide](backward-compatibility-turbomodules).
21+
- To create a backward compatible **Fabric Component**, follow [this guide](backward-compatibility-fabric-components).
22+
- If you have troubles while creating a backward compatible module, look at our [troubleshooting guide](backward-compatibility-troubleshooting).

0 commit comments

Comments
 (0)