All Projects → thegamenicorus → TurboModulePlayground

thegamenicorus / TurboModulePlayground

Licence: other
Playing with React Native's new architecture:: JSI and TurboModules

Programming Languages

java
68154 projects - #9 most used programming language
python
139335 projects - #7 most used programming language
Objective-C++
1391 projects
typescript
32286 projects
objective c
16641 projects - #2 most used programming language
shell
77523 projects

TurboModulePlayground

First things first

  • 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.

Getting started

  1. Clone this repository.

  2. Run npm install , all required components will be installed automatically.

    iOS

    1. Run pod install from TurboModulePlayground/ios folder.
    2. Start XCode and open generated TurboModulePlayground.xcworkspace.

    Android

    no steps required.

Create your turbo module

iOS

  1. Create a Spec file at src/turbomodules. Each Spec file is named Native*.js for ObjC module OR Native*Cxx.js for C++ module, where * is the name of the NativeModule.

  2. Run npm run codegen. Then TurboModuleSpec and TurboModuleCxxSpec will be generated at Xcode/TurboModulePlayground/turbomodule/spec

  3. Add your native file into Xcode.

  4. Add your turbo module name into Xcode/TurboModulePlayground/turbomodule/TurboModuleProvider.mm

Android

not yet supported.

More about Spec file and supported types.

facebook/react-native#24875 (comment)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].