Skip to content

Commit

Permalink
Simplify C++ TM struct generation (facebook#41645)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#41645

Right now, when defining concrete structs and Bridging headers for Cxx TMs we need to define their member types twice:
```
using ConstantsStruct =
    NativeCxxModuleExampleCxxBaseConstantsStruct<bool, int32_t, std::string>;

template <>
struct Bridging<ConstantsStruct>
    : NativeCxxModuleExampleCxxBaseConstantsStructBridging<
          bool,
          int32_t,
          std::string> {};
```
Now we only need to define those once
```
using ConstantsStruct =
    NativeCxxModuleExampleCxxConstantsStruct<bool, int32_t, std::string>;

template <>
struct Bridging<ConstantsStruct>
    : NativeCxxModuleExampleCxxConstantsStructBridging<ConstantsStruct> {};
```

This change keeps the existing base types untouched - but they will be removed in the next RN version.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D51571453

fbshipit-source-id: 2783bd48bf786ffa80d322d06456b5d6f2d7ba8a
  • Loading branch information
christophpurrer authored and Othinn committed Jan 9, 2024
1 parent 6c216f8 commit c7d6a18
Show file tree
Hide file tree
Showing 7 changed files with 1,481 additions and 179 deletions.
Loading

0 comments on commit c7d6a18

Please sign in to comment.