4 ms·
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 d
by evv 10y ago
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.
- RubenSandwich 10y agoI 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.
- evv 10y agoIf 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.
- lacker 10y agoI 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.
- RubenSandwich 10y agoI 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.
- jameside 10y agoCRNA 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.
- RubenSandwich 10y agoDoes the eject command remove the Expo SDK? If not then I would not call it bare React Native.
- dikaiosune 10y agoIt does. There's an option to include the sdk in the ejected app, but it's not the default.
- RubenSandwich 10y agoI see you included this warning: https://github.com/react-community/create-react-native-app/blob/master/react-native-scripts/src/scripts/eject.js#L18 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.
- dikaiosune 10y agoI'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.
- zerr 10y agoI 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.
- nikki93 10y agoRe: 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.cpp https://github.com/exponent/exponent/blob/master/cpp/EXGL.cp... Here's the code
- jesseruder 10y agoOne of the big advantages is that you can develop for your iOS device using Linux or Windows.
- evv 10y agoThe 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.
- zerr 10y agoAs I remember, DropBox put some tool/lib for making plumbing (JNI & friends) easier.