From 7773dc1175afcdd0ac1a537691a9194483a0b71b Mon Sep 17 00:00:00 2001 From: Stefan Wallin Date: Fri, 7 Jul 2023 08:00:57 +0200 Subject: [PATCH 1/3] Clarify documentation for turbomodules `codegenConfig` is stated in text that it's an array, but in code example it's an object. Either the text or the code example should change. --- docs/the-new-architecture/pillars-turbomodule.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/the-new-architecture/pillars-turbomodule.md b/docs/the-new-architecture/pillars-turbomodule.md index 2a7ab81402b..b3189ada785 100644 --- a/docs/the-new-architecture/pillars-turbomodule.md +++ b/docs/the-new-architecture/pillars-turbomodule.md @@ -151,14 +151,14 @@ The shared configuration is a `package.json` file used by yarn when installing y "react": "*", "react-native": "*" }, - "codegenConfig": { + "codegenConfig": [{ "name": "RTNCalculatorSpec", "type": "modules", "jsSrcsDir": "js", "android": { "javaPackageName": "com.rtncalculator" } - } + }] } ``` From be8e2e96e849bc28b2b1d6a6bc04b7b3a9234fca Mon Sep 17 00:00:00 2001 From: Stefan Wallin Date: Fri, 7 Jul 2023 08:18:39 +0200 Subject: [PATCH 2/3] Fix linting issue --- docs/the-new-architecture/pillars-turbomodule.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/the-new-architecture/pillars-turbomodule.md b/docs/the-new-architecture/pillars-turbomodule.md index b3189ada785..052b5ddce9f 100644 --- a/docs/the-new-architecture/pillars-turbomodule.md +++ b/docs/the-new-architecture/pillars-turbomodule.md @@ -151,14 +151,16 @@ The shared configuration is a `package.json` file used by yarn when installing y "react": "*", "react-native": "*" }, - "codegenConfig": [{ - "name": "RTNCalculatorSpec", - "type": "modules", - "jsSrcsDir": "js", - "android": { - "javaPackageName": "com.rtncalculator" + "codegenConfig": [ + { + "name": "RTNCalculatorSpec", + "type": "modules", + "jsSrcsDir": "js", + "android": { + "javaPackageName": "com.rtncalculator" + } } - }] + ] } ``` From 322658457561a7064699856059f5f013adcc3c7c Mon Sep 17 00:00:00 2001 From: Stefan Wallin Date: Fri, 7 Jul 2023 12:35:07 +0200 Subject: [PATCH 3/3] Update the PR to reflect knowledge that the code sample is correct but documentation wrong --- .../pillars-turbomodule.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/the-new-architecture/pillars-turbomodule.md b/docs/the-new-architecture/pillars-turbomodule.md index 052b5ddce9f..45443f6fc42 100644 --- a/docs/the-new-architecture/pillars-turbomodule.md +++ b/docs/the-new-architecture/pillars-turbomodule.md @@ -151,16 +151,14 @@ The shared configuration is a `package.json` file used by yarn when installing y "react": "*", "react-native": "*" }, - "codegenConfig": [ - { - "name": "RTNCalculatorSpec", - "type": "modules", - "jsSrcsDir": "js", - "android": { - "javaPackageName": "com.rtncalculator" - } + "codegenConfig": { + "name": "RTNCalculatorSpec", + "type": "modules", + "jsSrcsDir": "js", + "android": { + "javaPackageName": "com.rtncalculator" } - ] + } } ``` @@ -168,7 +166,7 @@ The upper part of the file contains some descriptive information like the name o Then there are the dependencies for this package. For this guide, you need `react` and `react-native`. -Finally, the **Codegen** configuration is specified by the `codegenConfig` field. It contains an array of libraries, each of which is defined by three other fields: +Finally, the **Codegen** configuration is specified by the `codegenConfig` field. It contains an object that defines the module through four fields: - `name`: The name of the library. By convention, you should add the `Spec` suffix. - `type`: The type of module contained by this package. In this case, it is a Turbo Native Module; thus, the value to use is `modules`.