From 9ccd0797b2f16c36974e8c632422c4ff3c4f6a79 Mon Sep 17 00:00:00 2001 From: Ashish Gapat Date: Mon, 18 Aug 2025 22:43:58 +0530 Subject: [PATCH 1/4] Update [Codegen](what-is-codegen.md) document to improve grammar and readability - Fix grammar - Remove unnecessary emphasis - Add URL to Turbo Native Modules --- .../the-new-architecture/what-is-codegen.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/website/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md b/website/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md index d83ff7ef572..f72c92bbcd4 100644 --- a/website/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md +++ b/website/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md @@ -1,15 +1,15 @@ # What is Codegen? -**Codegen** is a tool to avoid writing a lot of repetitive code. Using Codegen **is not mandatory**: you can write all the generated manually. However, **Codegen** generates scaffolding code that could save you a lot of time. +**Codegen** is a tool to avoid writing a lot of repetitive code. Using Codegen **is not mandatory**: you can write all the generated code manually. However, Codegen generates scaffolding code that could save you a lot of time. -React Native invokes **Codegen** automatically every time an iOS or Android app is built. Occasionally, you would like to manually run the **Codegen** scripts to know which types and files are actually generated: this is a common scenario when developing Turbo Native Modules and Fabric Native Components. +React Native invokes Codegen automatically every time an iOS or Android app is built. Occasionally, you would like to manually run the Codegen scripts to know which types and files are actually generated: this is a common scenario when developing [Turbo Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction) and Fabric Native Components. -## How does Codegen works +## How Codegen Works -**Codegen** is a process that is tightly coupled with a React Native app. The **Codegen** scripts live inside the `react-native` NPM package and the apps call those scripts at build time. +**Codegen** is a process that is tightly coupled with a React Native app. The Codegen scripts live inside the `react-native` NPM package and the apps call those scripts at build time. -**Codegen** crawls the folders in your project, starting from a directory you specify in your `package.json`, looking for some specific JS files that contains the specification (or specs) for your custom modules and components. Spec files are JS files written in a typed dialect: React Native currently supports Flow and TypeScript. +Codegen crawls the folders in your project, starting from a directory you specify in your `package.json`, looking for some specific JS files that contain the specification (or specs) for your custom modules and components. Spec files are JS files written in a typed dialect: React Native currently supports Flow and TypeScript. -Every time **Codegen** finds a spec file, it generates the boilerplate code associated to it. **Codegen** generates some C++ glue-code and then it generates platform-specific code, using Java for Android and Objective-C++ for iOS. +Every time Codegen finds a spec file, it generates boilerplate code associated with it. Codegen generates some C++ glue-code and then it generates platform-specific code, using Java for Android and Objective-C++ for iOS. From 79d83bb87d97221938e7244aa2ca233a5028bf58 Mon Sep 17 00:00:00 2001 From: Ashish Gapat Date: Mon, 18 Aug 2025 23:29:05 +0530 Subject: [PATCH 2/4] Update what-is-codegen.md (Unversioned) Same as commit 9ccd0797b2f16c36974e8c632422c4ff3c4f6a79 --- docs/the-new-architecture/what-is-codegen.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/the-new-architecture/what-is-codegen.md b/docs/the-new-architecture/what-is-codegen.md index d83ff7ef572..f72c92bbcd4 100644 --- a/docs/the-new-architecture/what-is-codegen.md +++ b/docs/the-new-architecture/what-is-codegen.md @@ -1,15 +1,15 @@ # What is Codegen? -**Codegen** is a tool to avoid writing a lot of repetitive code. Using Codegen **is not mandatory**: you can write all the generated manually. However, **Codegen** generates scaffolding code that could save you a lot of time. +**Codegen** is a tool to avoid writing a lot of repetitive code. Using Codegen **is not mandatory**: you can write all the generated code manually. However, Codegen generates scaffolding code that could save you a lot of time. -React Native invokes **Codegen** automatically every time an iOS or Android app is built. Occasionally, you would like to manually run the **Codegen** scripts to know which types and files are actually generated: this is a common scenario when developing Turbo Native Modules and Fabric Native Components. +React Native invokes Codegen automatically every time an iOS or Android app is built. Occasionally, you would like to manually run the Codegen scripts to know which types and files are actually generated: this is a common scenario when developing [Turbo Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction) and Fabric Native Components. -## How does Codegen works +## How Codegen Works -**Codegen** is a process that is tightly coupled with a React Native app. The **Codegen** scripts live inside the `react-native` NPM package and the apps call those scripts at build time. +**Codegen** is a process that is tightly coupled with a React Native app. The Codegen scripts live inside the `react-native` NPM package and the apps call those scripts at build time. -**Codegen** crawls the folders in your project, starting from a directory you specify in your `package.json`, looking for some specific JS files that contains the specification (or specs) for your custom modules and components. Spec files are JS files written in a typed dialect: React Native currently supports Flow and TypeScript. +Codegen crawls the folders in your project, starting from a directory you specify in your `package.json`, looking for some specific JS files that contain the specification (or specs) for your custom modules and components. Spec files are JS files written in a typed dialect: React Native currently supports Flow and TypeScript. -Every time **Codegen** finds a spec file, it generates the boilerplate code associated to it. **Codegen** generates some C++ glue-code and then it generates platform-specific code, using Java for Android and Objective-C++ for iOS. +Every time Codegen finds a spec file, it generates boilerplate code associated with it. Codegen generates some C++ glue-code and then it generates platform-specific code, using Java for Android and Objective-C++ for iOS. From a6a5767276f3d4c3e37997dad82b84afa1dee234 Mon Sep 17 00:00:00 2001 From: Ashish Gapat Date: Mon, 18 Aug 2025 23:31:51 +0530 Subject: [PATCH 3/4] Update what-is-codegen.md (amend) --- docs/the-new-architecture/what-is-codegen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/the-new-architecture/what-is-codegen.md b/docs/the-new-architecture/what-is-codegen.md index f72c92bbcd4..bc9cc37e7e0 100644 --- a/docs/the-new-architecture/what-is-codegen.md +++ b/docs/the-new-architecture/what-is-codegen.md @@ -2,7 +2,7 @@ **Codegen** is a tool to avoid writing a lot of repetitive code. Using Codegen **is not mandatory**: you can write all the generated code manually. However, Codegen generates scaffolding code that could save you a lot of time. -React Native invokes Codegen automatically every time an iOS or Android app is built. Occasionally, you would like to manually run the Codegen scripts to know which types and files are actually generated: this is a common scenario when developing [Turbo Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction) and Fabric Native Components. +React Native invokes Codegen automatically every time an iOS or Android app is built. Occasionally, you would like to manually run the Codegen scripts to know which types and files are actually generated: this is a common scenario when developing [Turbo Native Modules](/docs/turbo-native-modules-introduction) and Fabric Native Components. From f3b94f10433635a40ac0bd169f1af53eea26ecc9 Mon Sep 17 00:00:00 2001 From: Ashish Gapat Date: Tue, 19 Aug 2025 02:27:56 +0530 Subject: [PATCH 4/4] Update what-is-codegen.md (amend) Same as 9ccd0797b2f16c36974e8c632422c4ff3c4f6a79 --- .../version-0.81/the-new-architecture/what-is-codegen.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md b/website/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md index f72c92bbcd4..bc9cc37e7e0 100644 --- a/website/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md +++ b/website/versioned_docs/version-0.81/the-new-architecture/what-is-codegen.md @@ -2,7 +2,7 @@ **Codegen** is a tool to avoid writing a lot of repetitive code. Using Codegen **is not mandatory**: you can write all the generated code manually. However, Codegen generates scaffolding code that could save you a lot of time. -React Native invokes Codegen automatically every time an iOS or Android app is built. Occasionally, you would like to manually run the Codegen scripts to know which types and files are actually generated: this is a common scenario when developing [Turbo Native Modules](https://reactnative.dev/docs/turbo-native-modules-introduction) and Fabric Native Components. +React Native invokes Codegen automatically every time an iOS or Android app is built. Occasionally, you would like to manually run the Codegen scripts to know which types and files are actually generated: this is a common scenario when developing [Turbo Native Modules](/docs/turbo-native-modules-introduction) and Fabric Native Components.