Buck sounds like a great tool for both iOS and Android projects but I have not been abel to find any information on how to use it for react-native projects.
Update
Looks like there is some work being done on this but it may not be recommended yet.
https://github.com/facebook/nuclide/issues/31#issuecomment-164897170 https://github.com/facebook/buck/tree/master/test/com/facebook/buck/js
Update 2
Product Pains link https://productpains.com/post/react-native/add-buck-as-a-build-option
Update 8/6/2017:
I tried following my steps below for integrating React Native into an iOS app with Buck but I ran into issues when using React Native 0.47. Instead I have a new simpler approach for getting React Native working with Buck on iOS by linking to prebuilt libraries. I forked the Buck sample project repo and have it working with React Native in this repo. I also updated the README in that repo with instructions for running the demo Buck React Native iOS app and how to integrate yourself.
Note there are a couple issues with this approach documented in the README that may or may not be a problem for using this in a production app.
That repo also doesn't bundle the JS for production yet.
Older answer:
I got Buck working with an iOS project. It is very much a work in progress, but works. A few notes:
node_modules/react-native/React
andnode_modules/react-native/Libraries
(see folder structure below).-w
andWno-error
flags to each library because the main project had treat warnings as errors and I didn't want to see all of these React Native warnings in Xcode.reactnative.xcodeproj
in thevendor/reactnative
folder (see below).Here is my
vendor/reactnative/BUCK
file:Here is the folder structure inside a vendor folder in my project:
Then in the
deps
of my main BUCK file I add:There's no official documentation / template for building RN apps with Buck yet but it shouldn't be that hard. You'd need to add a BUCK file that does the equivalent of what your
build.gradle
file does.It's mostly just:
android_binary
rule to do that)