News for hackers. Stuff that matters.
Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @03:28PM (#13861453)
I'm a bit unsure about this decision. Because this is tying React Native to a private entity, namely Expo, that has not open sourced it's toolchain used here. Expo takes your code and builds it on their servers and then serves it to you. That toolchain unlike React Native is not open source. This is creating a walled garden around Expo who can easily decide to charge for their server fees. Yes it is a much easier of an boarding experience then installing Xcode and Android Studio but at least with Xcode and Android Studio you own the whole toolchain. Because of this fact I don't think this is comparable to React Create App, which is excellent.

Edit: Expo has open sourced their code, see below. And CRNA does not build code on their servers, I assumed it had the same workflow as their XDE tool. It does not. But I'm still unsure of this decision. It makes Expo a vital part of React Native, or at least puts them in the position to have that position.

Re:Introducing Create React Native App by dikaiosune on Monday March 13, 2017 @03:31PM (#13861474)
Hi! Expo is definitely a private entity, but the tools used by CRNA are also definitely open source:

https://github.com/exponent/exponent

https://github.com/exponent/exponent-sdk

https://github.com/exponent/xdl

Also, the RN packager runs locally on your machine, there is no dependency on Expo's build services when working with Create React Native App.

The concerns you raised were front and center when we were working on this project, and we worked hard to make sure that CRNA has no service dependency, it works completely offline.

Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @03:32PM (#13861487)
What about the build server?
Re:Introducing Create React Native App by ccheever on Monday March 13, 2017 @03:35PM (#13861515)
(I work on Expo)

CRNA doesn't use our app building service (which is free) or integrate with it, though you can take a CRNA project and use it with the rest of our tools like the app building service.

Also, CRNA does support ejecting which gives you an Xcode project and an Android Studio project. You can really control everything you want to control here.

Re:Introducing Create React Native App by jesseruder on Monday March 13, 2017 @03:35PM (#13861517)
Like dikaiosune said, the standalone app workflow isn't part of CRNA. The scripts used by the build servers are open sourced though: https://github.com/exponent/exponent#standalone-apps
Re:Introducing Create React Native App by dikaiosune on Monday March 13, 2017 @03:33PM (#13861497)
Which build server? If you have an Expo account you can create a "standalone app" with our service, but that's not a part of CRNA's workflow and it's certainly not required to use this tool.
Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @03:35PM (#13861520)
Okay I assumed that it followed the same workflow as the Expo service. I'll edit my comments to state that.
Re:Introducing Create React Native App by dikaiosune on Monday March 13, 2017 @03:37PM (#13861543)
Sorry for piling on! This is definitely something we could be clearer on in the docs.
Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @03:55PM (#13861726)
No worries. I understand that you want to get the story straight. I do think you should specifically state in the blog update that this is a new tool and not a reuse of Expo's tools.
Re:Introducing Create React Native App by hesarenu on Tuesday March 14, 2017 @04:22AM (#13865887)
Can i create a standalone app without Expo account?
Re:Introducing Create React Native App by dikaiosune on Tuesday March 14, 2017 @11:07AM (#13868045)
You do need an Expo account to create a standalone app. If you want to create an app for the App or Play Stores yourself (i.e. without an account), then you'll need Xcode and/or Android Studio.
Re:Introducing Create React Native App by evv on Monday March 13, 2017 @03:53PM (#13861705)
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.
Re:Introducing Create React Native App by zerr on Monday March 13, 2017 @04:11PM (#13861885)
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:Introducing Create React Native App by nikki93 on Monday March 13, 2017 @04:28PM (#13862027)
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

Re:Introducing Create React Native App by evv on Monday March 13, 2017 @06:26PM (#13863098)
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.

Re:Introducing Create React Native App by zerr on Monday March 13, 2017 @06:56PM (#13863322)
As I remember, DropBox put some tool/lib for making plumbing (JNI & friends) easier.
Re:Introducing Create React Native App by jesseruder on Monday March 13, 2017 @05:04PM (#13862359)
One of the big advantages is that you can develop for your iOS device using Linux or Windows.
Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @04:10PM (#13861876)
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.
Re:Introducing Create React Native App by lacker on Monday March 13, 2017 @04:21PM (#13861963)
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.
Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @04:30PM (#13862040)
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.
Re:Introducing Create React Native App by evv on Monday March 13, 2017 @04:20PM (#13861953)
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.

Re:Introducing Create React Native App by jameside on Monday March 13, 2017 @04:51PM (#13862234)
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.
Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @05:02PM (#13862328)
Does the eject command remove the Expo SDK? If not then I would not call it bare React Native.
Re:Introducing Create React Native App by dikaiosune on Monday March 13, 2017 @05:03PM (#13862349)
It does. There's an option to include the sdk in the ejected app, but it's not the default.
Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @05:35PM (#13862657)
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.
Re:Introducing Create React Native App by dikaiosune on Monday March 13, 2017 @05:56PM (#13862824)
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.

Re:Introducing Create React Native App by RubenSandwich on Monday March 13, 2017 @07:52PM (#13863703)
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.

Re:Introducing Create React Native App by altern8tif on Tuesday March 14, 2017 @12:12AM (#13864929)
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).