-
Notifications
You must be signed in to change notification settings - Fork 135
Description
Introduction
Following is mostly valid for iOS.
Currently react-native-cli doesn't provide any support for plugin developers to install and link native modules like frameworks, static libraries, projects.
One can write custom link script and register it in rnpm's postlink phase and "misuse" not very well documented local-cli link scripts. However even with this approach, plugin needs to carry it's native dependencies. With more and more packages, this is slowly becoming a problem. I'm already aware of clang's linker error "IOS build error duplicate symbols for architecture x86_64"
caused by two plugins linking same library.
Another popular option is to manage plugin dependencies via cocoapods.
However IMO cocapods/carthage are kind of alien in world of react-native. User need to know, how to install it, how to create podfile, etc. Linking modules should be implementation detail and users should be able to link all modules with just single react-native link
command.
The Core of It
For all above reasons I decided to work on project I internally call native-modules. It will:
- augment common native libraries (like fmdb) with package.json with instructions how it should be linked in react-native project. Such a modules will be published to npm and could be used by any rn plugin.
- provide new react-native linker (and new clean xcode project parser) which will install and link all dependencies registered in app package.json
Discussion points
I understand I'm pretty brief here, but before going to deep into describing specification I would like know, if there is broad interest in such a thing.