Electrode Native is a platform based on React Native, that simplifies development and reduces the friction of integrating React Native components into existing mobile applications. Electrode Native requires minimal changes to the existing mobile code base and infrastructure.
The core of the Electrode Native is written in TypeScript and ES6. Some parts also contain native code: Java and Swift--mostly in the form of Mustache templates used for native code generation. Some modules of Electrode Native are pure native projects--for example our Electrode Native Bridge is a native Android/iOS library/framework project.
Electrode Native is composed of several modules that can be accessed using the Electrode Native CLI. Electrode Native runs on Node 6 runtime or newer versions. Electrode Native runs on Mac OS X only. Windows support is scheduled to follow. Electrode Native also runs on Linux; however only minimal testing has verified this support.
Electrode Native modules and features are briefly described below. You can find more information about each module in the specific module documentation.
The Electrode Native CLI is the command line tool that contains the commands and sub-commands that developers will use to work with the Electrode Native platform. The commands are very similar to React Native commands. For example, instead of using the
react-native start command, you'll use the
ern start command. For information about using the Electrode Native CLI commands, refer to the Electrode Native CLI documentation.
Even though the Electrode Native bridge is a standalone native module that can be used in your React Native projects (even without Electrode Native), if you are using Electrode Native, you'll mostly not directly interact with the Electrode Native bridge in your MiniApps or in your mobile applications. Instead, you'll use Electrode Native APIs. The Electrode Native APIs are generated from a Swagger schema.
At some point you'll need one or more MiniApps to interact with your mobile application--to access data or to trigger an action. Or, your mobile application may need to interact with your MiniApps. That's where Electrode Native APIs generation come into play.
There are two components to Electrode Native APIs: the API module itself and the API implementation.
The Electrode Native container is a native library similar to common third-party libraries that Android and iOS developers are familiar with. The container is generated entirely by the Electrode Native platform and packaged as an Android (AAR) library for Android and as a Framework for iOS.
Each mobile application has its own custom Electrode Native container.
A Cauldron is a centralized document database that is used to store information about mobile application versions, native dependencies, and information about MiniApps. There is one Cauldron per mobile application. With appropriate permissions, you can use the Electrode Native CLI commands to access and modify the data stored in a Cauldron.
Setting up a cauldron is basically the same process as creating a Git repository and storing the data in the repository. To host your cauldron, you can use any provider offering Git repository storage. GitHub and BitBucket are probably two of the most popular providers. Within our documentation, we mention GitHub but you are free to use the provider of your choice.
While the Electrode Native cauldron makes sure that no misaligned or non-supported native dependency version makes it into your mobile application--the Electrode Native manifest aligns native dependency versions across multiple MiniApps in the first place.
Each Electrode Native platform version is associated to an array of supported native dependencies along with their versions.
The Electrode Native platform stores its master manifest in a GitHub repository. The master manifest is public and open sourced so that anyone can add native dependency support. By default, Electrode Native relies on the master manifest. For more advanced use cases, it is possible to override the master manifest with your own.
The Electrode Native platform contains two runners, one for each mobile platform (Android and iOS). Both runners are very simple and light-weight mobile applications--similar to new application projects in Android Studio or Xcode.
The Electrode Native runner application is used to run your MiniApp standalone so that you can effectively develop, debug, and test your MiniApp--before releasing a new or updated version of the MiniApp.
An Electrode Native runner application is automatically generated the first time you use the Electrode Native
ern run-ios or
ern run-android commands for your MiniApp. Relative to your MiniApp root directory, the runner application is generated in new Android and iOS directories.