├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2022 Nicola Corti 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native New Architecture Sample 2 | 3 | This repo contains several branches that will help you understand how to setup your project for the **React Native New Architecture**. This should considered as a support material of [the official migration guide](https://reactnative.dev/docs/next/new-architecture-intro). 4 | 5 | Here you will find **runs of the migration guide** on empty projects. Every commit is **documented** and allows to follow over on every step. 6 | 7 | Some branches also have a `RUN.md` (example: [`ios/20220309`](https://github.com/cortinico/RNNewArchitectureApp/blob/ios/20220309/RUN.md)) file that can help you follow the commits with additional context. 8 | 9 | Please find a list of the branches below, with more information on which kind of setup they're addressing. 10 | 11 | ## Branches 12 | 13 | | Branch name | Description | Android | iOS | 14 | | --- | --- | --- | --- | 15 | | [`run/from-0.67-to-0.69`](https://github.com/react-native-community/RNNewArchitectureApp/tree/run/from-0.67-to-0.69) | A full migration from RN 0.67 to 0.69 | ✅ | ✅ | 16 | | [`run/from-0.67-to-0.70`](https://github.com/react-native-community/RNNewArchitectureApp/tree/run/from-0.67-to-0.70) | A full migration from RN 0.67 to 0.70 | ✅ | ✅ | 17 | | [`run/pure-cxx-module`](https://github.com/react-native-community/RNNewArchitectureApp/tree/run/pure-cxx-module) | A step-by-step guide on how to integrate a Pure C++ module in a React Native 0.71.0-RC.2 app. Thanks to [@christophpurrer](https://github.com/christophpurrer) for the guide | ✅ | ✅ | 18 | | [`view-flattening-ios`](https://github.com/react-native-community/RNNewArchitectureApp/tree/view-flattening-ios) | Examples of View Flattening on iOS | | ✅ | 19 | 20 | ## Sample Run 21 | 22 | A sample run will have commits marked as `[TurboModule]` or `[Fabric]` to clarify which aspect of the New Architecture is involved. 23 | For example, for the [`run/android/20220202`](https://github.com/cortinico/RNNewArchitectureApp/commits/run/android/20220202) branch will look like the following: 24 | 25 | * [582a8a7](https://github.com/cortinico/RNNewArchitectureApp/commit/582a8a7) `[Fabric] Use the new Fabric custom component` 26 | * [adeee8b](https://github.com/cortinico/RNNewArchitectureApp/commit/adeee8b) `[Fabric] Register the MainComponentsRegistry` 27 | * [5e7d88f](https://github.com/cortinico/RNNewArchitectureApp/commit/5e7d88f) `[Fabric] Add a MainComponentsRegistry for the application` 28 | * [8afa19e](https://github.com/cortinico/RNNewArchitectureApp/commit/8afa19e) `[Fabric] Add a React Package that will load the ViewManager` 29 | * [c893370](https://github.com/cortinico/RNNewArchitectureApp/commit/c893370) `[Fabric] Create the corresponding ViewManager` 30 | * [32885f5](https://github.com/cortinico/RNNewArchitectureApp/commit/32885f5) `[Fabric] Create a custom component spec file` 31 | * [5408f18](https://github.com/cortinico/RNNewArchitectureApp/commit/5408f18) `[Fabric] call setIsFabric(true) in the MainActivity` 32 | * [20a8378](https://github.com/cortinico/RNNewArchitectureApp/commit/20a8378) `[Fabric] Provide the JSI Module Package` 33 | * [cf1378e](https://github.com/cortinico/RNNewArchitectureApp/commit/cf1378e) `[TurboModule] Let's try to use this TurboModule` 34 | * [a80cea1](https://github.com/cortinico/RNNewArchitectureApp/commit/a80cea1) `[TurboModule] Enable TurboModule system in the Android App` 35 | * [d8884c2](https://github.com/cortinico/RNNewArchitectureApp/commit/d8884c2) `[TurboModule] Add the C++ implementation for MainApplicationTurboModuleManagerDelegate` 36 | * [f6d2e81](https://github.com/cortinico/RNNewArchitectureApp/commit/f6d2e81) `[TurboModule] Register a new TurboModulePackage` 37 | * [7ae59dd](https://github.com/cortinico/RNNewArchitectureApp/commit/7ae59dd) `[TurboModule] Install the ReactPackageTurboModuleManagerDelegateBuilder` 38 | * [4dfcfa6](https://github.com/cortinico/RNNewArchitectureApp/commit/4dfcfa6) `[TurboModule] Setup the NDK Build for the Android app` 39 | * [a0cf888](https://github.com/cortinico/RNNewArchitectureApp/commit/a0cf888) `[TurboModule] Implement the generated native spec interface` 40 | * [ba3f2a4](https://github.com/cortinico/RNNewArchitectureApp/commit/ba3f2a4) `[TurboModule] Configure the codegen with libraryname and Java package` 41 | * [7da902f](https://github.com/cortinico/RNNewArchitectureApp/commit/7da902f) `[TurboModule] Add a NativeModule Spec file` 42 | * [cb0eceb](https://github.com/cortinico/RNNewArchitectureApp/commit/cb0eceb) `Setup the React Gradle Plugin` 43 | * [66ca29b](https://github.com/cortinico/RNNewArchitectureApp/commit/66ca29b) `Build React Native from Source` 44 | * [be102a1](https://github.com/cortinico/RNNewArchitectureApp/commit/be102a1) `Enable Hermes` 45 | * [4357af9](https://github.com/cortinico/RNNewArchitectureApp/commit/4357af9) `Bump React Native to a nightly version` 46 | * [a3866a1](https://github.com/cortinico/RNNewArchitectureApp/commit/a3866a1) `Result of npx react-native init` 47 | 48 | ## Older Branches 49 | 50 | Here we collect older branches that are working, but no longer relevant. 51 | 52 | | Branch name | Description | Android | iOS | 53 | | --- | --- | --- | --- | 54 | | [`run/android/0.68.0-rc2`](https://github.com/cortinico/RNNewArchitectureApp/commits/run/android/0.68.0-rc2) | A run from an empty project on RN 0.68.0-rc2 using the New Architecture template | ✅ | | 55 | | [`run/android/20220202`](https://github.com/cortinico/RNNewArchitectureApp/commits/run/android/20220202) | A run from an empty project on RN 0.67.2, migrated to run on a RN nightly version `0.0.0-20211205-2008-583471bc4`. Here you can see all the step-by-step migration needed for an app coming from RN 0.67 | ✅ | | 56 | | [`run/android/0.68.0-rc3`](https://github.com/cortinico/RNNewArchitectureApp/commits/run/android/0.68.0-rc3) | A run from an empty project on RN 0.68.0-rc3 using the New Architecture template | ✅ | | 57 | | [`ios/20220309`](https://github.com/cortinico/RNNewArchitectureApp/commits/ios/20220309) | A run from an empty project starting from 0.67.3 to an app with a Turbomodule and a Fabric component | | ✅ | 58 | | [`run/from-0.67-to-0.68`](https://github.com/react-native-community/RNNewArchitectureApp/tree/run/from-0.67-to-0.68) | A full migration from RN 0.67 to 0.68 | ✅ | ✅ | 59 | | [`run/ios/0.68.0-rc.4-typescript`](https://github.com/react-native-community/RNNewArchitectureApp/tree/run/ios/0.68.0-rc.4-typescript) | A migration from RN 0.67 to RN 0.68 with typescript suppport for iOS | | ✅ | 60 | | [`run/android/0.68.0-rc.4-typescript`](https://github.com/react-native-community/RNNewArchitectureApp/tree/run/android/0.68.0-rc.4-typescript) | A migration from RN 0.67 to RN 0.68 with typescript suppport for Android | ✅ | | 61 | --------------------------------------------------------------------------------