From 57fec031e6b425cc4546d29d9c13fc7bbafb1274 Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Tue, 20 Sep 2022 17:53:03 +0100 Subject: [PATCH 1/2] tweaks --- docs/new-architecture-library-intro.md | 8 ++++---- docs/the-new-architecture/pillars.md | 2 +- docs/the-new-architecture/use-app-template.md | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/new-architecture-library-intro.md b/docs/new-architecture-library-intro.md index 6bad696566e..88f06a7c829 100644 --- a/docs/new-architecture-library-intro.md +++ b/docs/new-architecture-library-intro.md @@ -18,7 +18,7 @@ The JavaScript specs serve as the source of truth for the methods that are provi Using a **typed** spec file allows you to be intentional and declare all the input arguments and outputs of your native module’s methods. :::info -Currently, this guide is written under the assumption that you will be using [Flow](https://flow.org/). The `react-native-codegen` package is also currently working only with the Flow source as an input. **TypeScript** support is in beta right now. +**TypeScript** support is in beta right now. ::: To adopt the New Architecture, you start by creating these specs for your native modules and native components. You can do this prior to actually migrating to the New Architecture: the specs will be used later on to generate native interface code for all the supported platforms as a way to enforce uniform APIs across platforms. @@ -152,7 +152,7 @@ If your existing native module has methods with the same name on multiple platfo -[Autolinking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) is a feature of the React Native CLI that simplifies the installation of third-party React Native libraries. Instructions to enable _autolinking_ are available at https://github.com/react-native-community/cli/blob/master/docs/autolinking.md. +[Autolinking](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md) is a feature of the React Native CLI that simplifies the installation of third-party React Native libraries. Instructions to enable _autolinking_ are available in the [React Native CLI docs](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md). ### Android @@ -220,9 +220,9 @@ Codegen can be configured in the `package.json` file of your Library. Add the fo Android also requires to have the [React Gradle Plugin properly configured](new-architecture-app-intro#android-specifics) in your app. -## Preparing your JavaScript Codebase for the new React Native Renderer (Fabric) +## Preparing your JavaScript Codebase for Fabric -The new renderer, also known as Fabric, doesn’t use the UIManager, so direct calls to UIManager will need to be migrated. Historically, calls to UIManager had some pretty complicated patterns. Fortunately, we’ve created new APIs that are much cleaner. These new APIs are forward compatible with Fabric, so you can migrate your code today, and the APIs will work properly when you turn on Fabric! +The new renderer, Fabric, doesn’t use the UIManager, so direct calls to UIManager will need to be migrated. Historically, calls to UIManager had some pretty complicated patterns. Fortunately, we’ve created new APIs that are much cleaner. These new APIs are forward compatible with Fabric, so you can migrate your code today, and the APIs will work properly when you turn on Fabric! Fabric will be providing new type safe JS APIs that are much more ergonomic than some of the patterns we've seen in product code today. These APIs require references to the underlying component, no longer using the result of `findNodeHandle`. `findNodeHandle` is used to search the tree for a native component given a class instance. This was breaking the React abstraction model. `findNodeHandle` is not compatible with React 18. Deprecation of `findNodeHandle` in React Native is similar to the [deprecation of `findDOMNode` in React DOM](https://reactjs.org/docs/strict-mode.html#warning-about-deprecated-finddomnode-usage). diff --git a/docs/the-new-architecture/pillars.md b/docs/the-new-architecture/pillars.md index 14fd75eb8cf..0b45abc9435 100644 --- a/docs/the-new-architecture/pillars.md +++ b/docs/the-new-architecture/pillars.md @@ -10,7 +10,7 @@ import NewArchitectureWarning from '../\_markdown-new-architecture-warning.mdx'; The New Architecture is composed mainly of two pillars: - [The New Native Module System - Turbo Modules](pillars-turbomodules) -- [The New Renderer - Fabric](pillars-fabric-components). +- [The New Renderer - Fabric](pillars-fabric-components) The core concepts of React Native still holds true in the New Architecture: Native Modules are the preferred way to create libraries that leverage some platform-specific API. Native Components are the preferred way to create reusable UI components, providing a native experience to the users. diff --git a/docs/the-new-architecture/use-app-template.md b/docs/the-new-architecture/use-app-template.md index 2fdfdf55fee..1efccef94ab 100644 --- a/docs/the-new-architecture/use-app-template.md +++ b/docs/the-new-architecture/use-app-template.md @@ -13,7 +13,7 @@ This page will help you create a new React Native app that uses the New Architec ## Development Environment -Before continuing, make sure you've followed all the steps in the[Setting up the development environment](getting-started.md) section under the **React Native CLI Quickstart** tab. +Before continuing, make sure you've followed all the steps in the [Setting up the development environment](getting-started.md) section under the **React Native CLI Quickstart** tab. If following the setup guide, stop when you reach the section **Running your React Native Application**, and resume following this guide. From 11bc2308d757047aaf72eb8e8cce7817fc05242f Mon Sep 17 00:00:00 2001 From: Lorenzo Sciandra Date: Thu, 22 Sep 2022 10:47:33 +0100 Subject: [PATCH 2/2] revert change --- docs/new-architecture-library-intro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/new-architecture-library-intro.md b/docs/new-architecture-library-intro.md index 88f06a7c829..928664bb212 100644 --- a/docs/new-architecture-library-intro.md +++ b/docs/new-architecture-library-intro.md @@ -220,7 +220,7 @@ Codegen can be configured in the `package.json` file of your Library. Add the fo Android also requires to have the [React Gradle Plugin properly configured](new-architecture-app-intro#android-specifics) in your app. -## Preparing your JavaScript Codebase for Fabric +## Preparing your JavaScript Codebase for the new React Native Renderer (Fabric) The new renderer, Fabric, doesn’t use the UIManager, so direct calls to UIManager will need to be migrated. Historically, calls to UIManager had some pretty complicated patterns. Fortunately, we’ve created new APIs that are much cleaner. These new APIs are forward compatible with Fabric, so you can migrate your code today, and the APIs will work properly when you turn on Fabric!