-
This repository is nothing, just try to simulate how TurboModule, and CodeGen work together.
-
TurboModule and CodeGen are not yet formally released. It may change in the future. Do not use this project for production.
-
only iOS is supported at the moment. PRs for Android are welcome.
-
Clone this repository.
-
Run
npm install
, all required components will be installed automatically.- Run
pod install
fromTurboModulePlayground/ios
folder. - Start XCode and open generated
TurboModulePlayground.xcworkspace
.
no steps required.
- Run
-
Create a Spec file at
src/turbomodules
. Each Spec file is namedNative*.js
for ObjC module ORNative*Cxx.js
for C++ module, where*
is the name of the NativeModule. -
Run
npm run codegen
. Then TurboModuleSpec and TurboModuleCxxSpec will be generated atXcode/TurboModulePlayground/turbomodule/spec
-
Add your native file into Xcode.
-
Add your turbo module name into
Xcode/TurboModulePlayground/turbomodule/TurboModuleProvider.mm
not yet supported.