mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
963e45afd1
Summary: While working on D42008409 I found out that codegen for pure C++ modules doesn't work with container types that are nested inside generated data structures, which happens because they don't have a specialization of `bridging::toJS` that wouldn't pass the `invoker` instance through. It looks like an easiest option would be just to use `invoker` in codegen for `toJS` as well, which this diff does. Note that I also experimented with removing `invoker` from being used in the `::toJS` specializations for containers altogether (see D42008410), as there doesn't seem to be a single use case when `invoker` would be ever needed in any `::toJS` specialization (and imagining such a scenario would be a stretch, tbh - why a conversion function would invoke anything running on JS side, given that invoker provides no return values anyway?..) But since I am still not 100% about the invoker purpose there, I went with the codegen change. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D42008724 fbshipit-source-id: 6302d3ceacdfc8fed296ee1ef1a985f7273c2261
@react-native/codegen
Installation
yarn add --dev @react-native/codegen
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the react Native root folder:
yarnto install the dependencies. You just need to run this onceyarn jest react-native-codegen.