Skip to content

Commit 8400279

Browse files
Revert "Simplify C++ TM struct generation (#3930)" (#3935)
This reverts commit 7396470.
1 parent 7396470 commit 8400279

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

docs/the-new-architecture/cxx-custom-types.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ This works - but is quite complex.
257257
[**Codegen**](pillars-codegen.md) for C++ Turbo Native Modules does support struct generators, so you can simplify the code above in `NativeSampleModule.h` to:
258258

259259
```cpp
260-
using CustomType = NativeSampleModuleCustomType<std::string, bool, std::optional<int32_t>>;
260+
using CustomType = NativeSampleModuleBaseCustomType<std::string, bool, std::optional<int32_t>>;
261261
template <>
262262
struct Bridging<CustomType>
263-
: NativeSampleModuleCustomTypeBridging<CustomType> {};
263+
: NativeSampleModuleBaseCustomTypeBridging<std::string, bool, std::optional<int32_t>> {};
264264
```
265265
266266
With `using CustomType` you declare a name for your concrete struct.
@@ -276,9 +276,10 @@ Without any custom conversion functions:
276276
277277
#### Base class
278278
279-
`NativeSampleModuleCustomType` is an auto-generated template in your `AppSpecsJSI.h` which name is generated by:
279+
`NativeSampleModuleBaseCustomType` is an auto-generated template in your `AppSpecsJSI.h` which name is generated by:
280280
281281
- `NativeSampleModule` (name of C++ Turbo Native Module in the JavaScript spec) +
282+
- `Base` (constant) +
282283
- `CustomType` (name of type in the JavaScript spec)
283284
284285
The same naming schema applies to the necessary `Bridging` struct which is defined via `struct Bridging<CustomType>`.

0 commit comments

Comments
 (0)