Skip to content

Commit 7def18b

Browse files
author
Riccardo
authored
[Do Not Merge] Refactoring The New Architecture (#3029)
1 parent 5f28c24 commit 7def18b

11 files changed

+158
-12
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
id: backward-compatibility-fabric-components
3+
title: Fabric Components as Native Components
4+
---
5+
6+
This section describes the required steps to ensure that a Fabric Component can be used as a Native Component.
7+
8+
The section should explain:
9+
10+
- How to avoid installing dependencies when they are not needed
11+
- The usage of compilation pragmas to avoid compiling code that requires types from the codegen
12+
- API uniformity in JS, so that they don’t have to import different files
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
id: backward-compatibility-troubleshooting
3+
title: Troubleshooting
4+
---
5+
6+
This section contains solutions to common problems that can happen when developing a backward compatible module or component.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
id: backward-compatibility-turbomodules
3+
title: TurboModules as Native Modules
4+
---
5+
6+
This section describes the required steps to ensure that a TurboModule can be used as a Native Module.
7+
8+
The section explains:
9+
10+
- How to avoid installing dependencies when they are not needed
11+
- The usage of compilation pragmas to avoid compiling code that requires types from the codegen
12+
- API uniformity in JS, so that they don’t have to import different files
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
id: backward-compatibility
3+
title: What Backward Compatibility Is
4+
---
5+
6+
This section contains a brief paragraph explaining why library developers should be mindful about backward compatibility.
7+
8+
It could contains shared section between the backward compatibility for TurboModules and Native Components.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
id: landing-page
3+
title: Introduction
4+
---
5+
6+
This section is the entry point for the new guide’s documentation.
7+
It contains some basic information about the New Architecture: its pillars, the version from which it has been made available and other very high-level information. Then, it should present the guide’s structure itself.
8+
9+
This section should also contains a sort of Driving guide based on the user use-cases:
10+
11+
- New user: link to how to use the new [app template](use-app-template)
12+
- New Library developer: link to the [pillars](pillars)
13+
- Old library developer/app developer: link to [the migration guide](../new-architecture-intro)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
id: pillars-fabric-components
3+
title: Fabric Components
4+
---
5+
6+
This section contains a high-level introduction to Fabric components. It provides enough context to understand when a Fabric component is needed and how it roughly works.
7+
It points to the [Renderer](https://reactnative.dev/architecture/fabric-renderer) section of the [Architecture](https://reactnative.dev/architecture/overview) tab for a deep dive into the technical details.
8+
9+
This section must have a warning that it works only with the new architecture enabled. It points to the [migration section](../new-architecture-intro).
10+
11+
## How to Create a Fabric Components
12+
13+
This section is a step-by-step guide to create a Fabric component from scratch. The list of subsections is roughly:
14+
15+
- JS spec (with all the supported features)
16+
- Configuration (package.json, cocoapods, gradle, …) and CodeGen
17+
- Native code (one section for iOS and one for Android)
18+
- Integration in an App (`yarn add` and how to connect the JS specs to the app itself)
19+
- Troubleshooting (common issues and how to solve them)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
id: pillars-turbomodules
3+
title: TurboModules
4+
---
5+
6+
This section contains a high-level introduction to TurboModules. It provides enough context to understand when a TurboModule is needed and how it roughly works.
7+
8+
This section must have a warning that it works only with the new architecture enabled. It points to the [migration section](../new-architecture-intro).
9+
10+
## How to create a Turbomodule
11+
12+
This section is a step-by-step guide to create a TurboModule from scratch. The list of subsections is roughly:
13+
14+
- JS spec (with all the supported features)
15+
- Configuration (package.json, cocoapods, gradle, …) and CodeGen
16+
- Native code (one section for iOS and one for Android)
17+
- Integration in an App (`yarn add` and how to connect the JS specs to the app itself)
18+
- Troubleshooting (common issues and how to solve them)

docs/the-new-architecture/pillars.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
id: pillars
3+
title: What Compose the New Architecture
4+
---
5+
6+
This section recalls the main pillars from the new-architecture-intro section.
7+
8+
It contains a pointer to the `Migration` section and it specifies that these pillars work only when the new architecture is enabled. It also points to the prerequisites.
9+
10+
It describes how the following sections are organized.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
id: use-app-template
3+
title: Using the New App Template
4+
---
5+
6+
This section describes the new app template generated by the React Native CLI and how to use it properly.
7+
It should explain how to create a new app, which command should be issued to install the dependencies and to run it on the different platforms.

docs/the-new-architecture/why.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
id: why
3+
title: Why A New Architecture
4+
---
5+
6+
This section briefly explains why we decided to move away from the old architecture, and it describes succinctly the main benefits of adopting the new architecture.
7+
It points to the [Architecture](https://reactnative.dev/architecture/overview) tab of the website for a deep dive into the ‘why’s.

0 commit comments

Comments
 (0)