Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I work on React Native Open Source at Facebook. We are not attaching React Native to Expo in any way. This tool simply helps developers get started with fewer dependencies than before. We are happy to collaborate with any company that makes React more accessible- not just Expo.


I find React Native dev/build environment quite straightforward (and I'm not even a "JavaScript developer"), so what exactly Expo adds to that?

Slight off-topic: is it possible to use C++ code cross-platform way for performance-critical parts? i.e. to have single C++ code for iOS and Android, in React Native.


Re: the C++ thing.

Yup you can! That's actually how Expo's `GLView` (which exposes OpenGL ES as a WebGL'y API in React Native's JS context) works. The binding is done in common C++ code for both iOS and Android. Calling to that from Obj-C is straightforward, for Java you use JNI. This is binding is done manually and built once (not auto-exposed), then you can use the GL stuff in JS!

https://github.com/exponent/exponent/blob/master/cpp/EXGL.cp... Here's the code


The native build environment is tricky for a few reasons. On iOS it takes a slow download of Xcode and simulator, plus an Apple Developer account. Before CRNA, there was no open-source way to get start building an iOS app on Windows or Linux. As for Android, there are a long list of native build dependencies and environment variables that need to be correctly established before you can build your app.

It is definitely possible to create a cross-platform C++ library to share performant across platforms, but unfortunately you need to do the plumbing for each platform by hand.


As I remember, DropBox put some tool/lib for making plumbing (JNI & friends) easier.


One of the big advantages is that you can develop for your iOS device using Linux or Windows.


I wouldn't go so far to say that you are not 'attaching React Native to Expo in any way', this tool which will soon be the default way to create React Native projects installs the Expo SDK. This is by definition attaching Expo to the projects I create using this tool.


I wouldn't say that this tool "will soon be the default way to create React Native projects". We want React Native to recommend the set of tools that is most suited to developers, but not be tied to a particular one. For example, we have at times recommended Genymotion when we thought it was the best recommendation, even though it's tied to a private entity. We would like to hear from the React Native community what methods of getting started are the most well-regarded, before changing any recommendations on the React Native website. If you don't want to use Expo that is totally fine, you can just use `react-native init` which isn't going away.


I believe that 'react-native init' is not going away. But I'm sure that in all documentation going forward 'create-react-native-app' is going to be used as it is a simpler tool to uses the verbs people know in npm. So by that logic it will be basically be the default way.


If you have all the native dependencies, you can always make a RN app the old-fashioned way- `react-native init`. This is not going away.

The Expo client is open source, so you can fork it for your needs if you want.

Also, if you do start an app with CRNA, and decide that you want to avoid everything-Expo-related, you can eject to a native app with one command.

In summary, we have been careful to craft the CRNA solution to have absolutely zero lock-in.


CRNA includes an "eject" command similar to CRA's. So anyone could eject to bare React Native (like react-native init) if they want or need that option.


Does the eject command remove the Expo SDK? If not then I would not call it bare React Native.


It does. There's an option to include the sdk in the ejected app, but it's not the default.


I see you included this warning: https://github.com/react-community/create-react-native-app/b.... I still don't understand why this had to ship with the Expo SDK. You are only going to have Newbies equate React Native with Expo. I am still of the opinion that this is not a right move for a development tool. If you want to help make 'create-react-native-app' then great, but it should not favor a private entity.


I'm very sensitive to the concerns you've raised in this thread. I've discussed these issues quite a lot, and ultimately decided that it's better to provide a net win to the React Native tooling ecosystem, and try to smooth out the gaps between React Native and Expo. I do think CRNA is a good improvement over the current state of "getting started" in React Native.

Regarding your concerns about "private entities," React Native is open source. Expo is open source. React Native was created and is maintained by Facebook, a private entity. Expo was created by and is maintained by Expo, a private entity. Do you have the same concerns about the recommendation in the RN docs to use Airbnb's maps library?

In order to use CRNA, you need to have a client that can fetch and load the JavaScript bundles. CRNA is agnostic to which client you use, which is why app.json puts any Expo specific configuration under an `expo` namespace. Anyone is welcome to implement their own client and use that if they prefer. I'd be very happy to review PRs which support loading React Native JavaScript in an alternative client. As an implementation detail of the Expo client, a number of native APIs are exposed, and it would be infeasible to block CRNA apps from accessing them.

We don't push users towards the Expo SDK, and the template project doesn't make use of any Expo APIs. If users choose to include a dependency on Expo's code, then we warn them that ejecting will break that dependency -- that's it. We choose a default choice in that prompt on the basis that we don't want to push users towards breaking their app.


Exactly you are trying to to smooth out the gaps between React Native and Expo. You have every right to help your company succeed but the way this is presented here is that you did it as a neutral party, you did not. You crossed that line as soon as you included the Expo SDK by default.

"Do you have the same concerns about the recommendation in the RN docs to use Airbnb's maps library?" No because that is not even an apt comparison. An apt comparison would be if AWS Engineers helped make 'react-create-app' and they bundled the AWS SDK as well merely to be 'helpful'. That would be an apt comparison not a recommendation on the official documentation to use a certain library.

If you don't push people towards the Expo SDK then remove it from the default 'react-native-create-app', I'm okay with it being in certain templates but a private entity should not be in a default. You clearly benefit from this decision, yet your pretending that it is only because it's in the community best interest.


The beauty of open source is that you're free to fork the repo to include your own tooling if you so wish. Those who share the same concern as you can then go ahead to use your fork.

Nobody is pushing anyone to use Expo's SDK. You are free to choose whether to use it or not. In the same way, you are free to use Facebook's React Native framework or not (bear in mind Facebook is a listed entity with its own corporate objectives as well).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: