reactgonative
Current Status
Currently in pre-alpha. Code currently successfully generates Android bindings.
Roadmap
- Add tests to Android elements
- Create iOS integration
Context
This tool is born out of experimentation with creating a single development platform that allows one set of code to run across both Android and iOS platforms. (In principle this could be extended to Desktop but not considered at present)
The Go language, through GoMobile along with react-native have created two methods to enable mobile development on a shared codebase. This tool aims to allow externalising any business logic to a common Go component, with the React components handling pure UI.
Communication between React and Go are via the use of Promises. The generated code is not packaged but instead placed within your code folders. They can be edited as required.
Constraints
- One return type (of simple type i.e. String, int) from Go method. Plans to introduce mapping to allow multiple returns, and object returns.
- Tool does not check if generated code already exists, nor if the call is run from the wrong location.
- At present relies on GOPATH being set, and you GO package being present in the GOPATH
Usage
To install:
$ go get -u go get github.com/steve-winter/reactgonative
To use:
$ cd $MYANDROIDFOLDER
$ reactgonative $MYGOPACKAGE
