
React Native for Android - Kajdav
https://code.facebook.com/posts/1189117404435352/
======
jbigelow76
Question for everybody doing some sort of cross platform mobile dev.

How common is it to have NO experience with a platform's native libraries? In
other words you didn't go from ObjC or Java to React Native/Cordova/Xamarin to
try and re-use code but because you know JS or C# and weren't concerned about
learning the native platform.

For any that started out with no native platform knowledge did you start to
dip into it as you got more experience with the cross platform tool and
started bumping up against any potential limitations?

I've been flirting with Swift when I have some (rare) downtime, to get a
foundation, but maybe that's not even necessary anymore given the effort
companies like Facebook/Xamarin/Telerik* are putting into abstracting away the
native platforms.

[*] I intentionally left Cordova off that list as "native" native and
"phonegap" native are two different things.

~~~
nabaraz
I would love to see some discussion around this as well. I have been playing
with Apache Corodova and Windows 10 SDK lately and they look very promising.
Being a web developer, I found them to be easy to get started.

Are there complex apps built using phonegap/swift/cordova? What are the
limitations? I know Facebook tried with a 'web app' approach and reverted back
to native solution. But that was years ago.

~~~
o_____________o
Using Cordova, you will always be behind any and all Mobile Safari WebKit et
al bugs. This not a big deal when pushing layout around a webpage, but it can
be crippling for app development as the app grows in complexity and you crave
native-quality interactions. Mobile Safari's Webkit implementation has a
staggering list of severe bugs. Developing under it can become a nightmare of
hacks and backpedaling. Been working on Cordova nearly full time for two years
now. So much wasted time. React Native is a big deal, and is very different.

~~~
GrinningFool

        > This not a big deal when pushing layout around a webpage, 
        > but it can be crippling for app development as the app 
        > grows in complexity and you crave native-quality 
        > interactions 
    

Even on the fastest phones, web-based (including wrapped web components)
simply don't offer the native experience. They come close, but there's always
a slight but perceptible performance difference; and often a visual difference
depending on what you're using.

I realize people really like the theoretical write-once behavior that you get
for simple apps when using a javascript platform, but I've been waiting for
years for web-based interactions to provide native quality - and I begin to
suspect we'll never get there.

If you want native-quality interactions, the only solution is a native
application and not common tooling via a javascript layer that runs atop the
already not-as-performant-for-UI browser level. This makes your life harder as
a developer, but gives your users the best possible experience for their
platform.

Alternatively, if you're willing to give your users a good-but-less-than-
native-quality experience, that's the niche filled by those tools.

~~~
windsurfer
> Even on the fastest phones, web-based (including wrapped web components)
> simply don't offer the native experience. They come close, but there's
> always a slight but perceptible performance difference

Honestly I used to believe this, but not after the release of the iPhone 5 and
6. Though there is no perceptible difference, it takes a lot of work to mimic
the UI in terms of animations, opacity, and response actions, so most apps
just use the default web technology which include things like a built-in 300ms
delay, no response to clicking a link, etc.

~~~
SomeCallMeTim
> it takes a lot of work to mimic the UI in terms of animations, opacity, and
> response actions,

Which is already done for you in Ionic -- including disabling the 300ms delay.

------
mrdrozdov
"Today, we're happy to release React Native for Android."

[https://github.com/facebook/react-
native/commit/42eb5464fd8a...](https://github.com/facebook/react-
native/commit/42eb5464fd8a65ed84b799de5d4dc225349449be)

This comes in time for Facebook to meet its pledge.

[http://www.reactnativeandroid.com/](http://www.reactnativeandroid.com/)

~~~
vjeux
Big props to the person that bought the domain and setup the countdown. It
stimulated the team to actually meet this deadline :)

~~~
scrollaway
What was there before and why? (I'd assume a countdown, but it's not in the
web archive)

~~~
kcorbitt
It was counting down from 6 months. I think it had got down to about 3 weeks
before this announcement came. The countdown was originally set based on a
comment that vjeux made in a blog post when React Native for iOS was released,
where he asked for 6 months of patience from the community before releasing
the Android version. the reactnativeandroid.com website wasn't exactly the
most patient reaction, but count me among those who are glad that it served to
motivate the team to get their great work out the door. :)

------
kcorbitt
I have a fair amount of experience developing native Android apps in Java, and
have an app for work that I'm developing/maintaining right now. I've also used
React in a couple of medium-sized web apps.

I'm extremely excited about the possibility of developing future functionality
for our Android app using React Native. It's not about the language (I find
using dynamically typed languages for large systems frustrating, despite how
expressive they can be) or even the iOS/web reusability for me -- it's the
fact that the React way of seeing the world just makes so much sense.
Describing views as a (pure, as long as you're careful) function of state
feels so clean to me.

~~~
moonchrome
>I find using dynamically typed languages for large systems frustrating,
despite how expressive they can be

Maybe you can find a middle ground in TypeScript ? I think it's really best of
both worlds solution when it comes to JS.

I think they are working on JSX integration in the latest version.

------
ahupp
When porting a React Native app to android 85% of the iOS version was reused:

"At the time of shipping Ads Manager for Android, that approach yielded around
85 percent reuse of app code."

~~~
vjeux
One realization I had when designing the API of React Native is that if you
want to be able to share _any_ component you need to have the lower level
primitives to be shared. So I went on making them: View, Text and Image. I
also realized that the same layout engine was required so implemented a shared
layout which ended up being flexbox.

What amazed me the most during this journey is that most platforms have
actually very similar low level building blocks but unfortunately slightly
incompatible in many ways.

The 85% number is mind blowing, it turns out that those few building blocks
are actually a large part of what it takes to build a high quality mobile app.

~~~
swhipple
> What amazed me the most during this journey is that most platforms have
> actually very similar low level building blocks but unfortunately slightly
> incompatible in many ways.

I've been looking at porting a React application to React Native, and was
somewhat concerned about this myself. I have several custom components that
make up the UI, which might not have a 1:1 translation between HTML/CSS to
native components or may behave slightly differently across platforms. A
different route I've considered is using Crosswalk as a shell around the
application and exposing Android/iOS APIs through JavaScript with Crosswalk
extensions. It may not feel perfectly native but it would be more consistent
across platforms.

I'm a novice in this area, so I'm curious if anyone else has looked into the
different approaches and the conclusions they've drawn.

------
Corrado
I think the best part of this article was the small link to the F8 2015 "Big
Code" video [0] where they go into detail about switching from Git to
Mercurial, building their own IDE around Atom, and detailing their continuous
integration process. It's a long video but it's very watchable using the
YouTube speed multiplier. :)

[0]
[https://www.youtube.com/watch?v=X0VH78ye4yY](https://www.youtube.com/watch?v=X0VH78ye4yY)

~~~
drinchev
> it's very watchable using the YouTube speed multiplier.

Good catch. Didn't know this feature, thanks!

------
wasd
Slightly off topic but I'm curious about using React Native vs WebView with
native wrapper and components.

I'm a developer who primarily codes in Ruby. I'm working on a side project
that will be mostly CRUD and have no DOM updates. The application will need to
support web, mobile, and tablet. I'm considering using React so I can use
React Native but I'm afraid I'm adding a level of unnecessary complexity.

Originally, I was planning to use web views and wrapping them in native
components (navigation, specific ui elements) like Basecamp does (described
here: [https://signalvnoise.com/posts/3743-hybrid-sweet-spot-
native...](https://signalvnoise.com/posts/3743-hybrid-sweet-spot-native-
navigation-web-content)).

I'm proficient with Java and Javascript. My experience with js frameworks is
mostly with jQuery and Angular but I've created toy apps in React.

Time is a limiting factor since this is a side project. My goal is to turn
this side project into a business, not learn new technical skills. Ruby and
Rails is very comfortable for me.

What do you think? Should I learn RN or just stick with Rails?

~~~
s73v3r
I would just make the project a webapp, and make sure that the site works well
on mobile. Later on, when you have traction, and probably users, you can code
up a native app for it (or if you have a lull of things to do and get bored
:P)

~~~
BinaryIdiot
> Later on, when you have traction, and probably users, you can code up a
> native app for it (or if you have a lull of things to do and get bored :P)

Maybe. Maybe not. Nowdays it's all "mobile first" so I'm not sure a web app is
necessarily the base way to gauge user engagement.

------
edgyswingset
Why are there only iOS screenshots in an Android blog post? I want to see the
results of creating an Android app.

EDIT: screenshots were added :)

~~~
mjohnston4
We've updated the post with a comparison of screenshots, sorry about that!

~~~
edgyswingset
Thanks!

------
afsina
Google has been working with the alternative already:
[https://flutter.github.io/](https://flutter.github.io/) . Probably usable in
some months.

~~~
outside1234
It uses Dart. Which despite looking like a nice language, approximately nobody
knows. So I'm not sure this is really an viable alternative.

~~~
afsina
Most android developers have Java background. Dart fits better there.

~~~
s73v3r
Most web developers do not, which I believe is the target for these
frameworks.

~~~
afsina
No, they are talking about native widgets AFAIK

------
icpmacdo
The general feeling on HN is that it is better to focus on Native development
on both platforms because Cordova hybrid apps have a overall bad user
experience. Is this still the case with React Native or is it becoming the
most effective option?

~~~
mrinterweb
I believe Cordova apps being associated with a "bad user experience" is
related to the amount of effort developers put into their Cordova app. I've
seen some terrible Cordova apps. I've also seen a couple good ones. I've been
developing a Cordova app using Ember.js and it works well in Cordova. There
are a couple places in my app that need to be better optimized for Android,
but overall, a non-discerning user would likely never know the app was a
Cordova app. One trap that I've seen many apps do is to try to emulate the UI
of native apps. Emulating a native UI rarely succeeds in execution. Make the
UI your own. There are ways of delivering a good user experience with Cordova.
It depends on the app you're building, and how the app is developed.

~~~
myko
> One trap that I've seen many apps do is to try to emulate the UI of native
> apps.

This is one of the strengths of React Native. Don't emulate the native UI -
use it, just access it via JavaScript.

~~~
mrinterweb
I'm excited to try React Native for that reason alone. I love Ember.js, but
developing good mobile applications with ember and Cordova (while possible) is
not easy.

------
nolanl
Interestingly, they seem to be using JavaScriptCore instead of V8 as their
JavaScript interpreter: [https://github.com/facebook/react-
native/blob/42eb5464fd8a65...](https://github.com/facebook/react-
native/blob/42eb5464fd8a65ed84b799de5d4dc225349449be/ReactAndroid/src/main/jni/react/JSCExecutor.cpp)

~~~
vjeux
We designed React Native to run with any JS engine: jsc, v8, (wk)webview,
inside of Chrome/Safari/Firefox, inside of Node, ... We released it with JSC
today mostly for convenience: we had JSC setup from iOS and it works. But
we're open to ship with a different engine if there are performance benefits.

~~~
s73v3r
Why not use the JS engine that the platform provides?

~~~
kzzzf
Android does not provide JS environment that is consistent across all device
types/os versions we'd like to support

------
harperlee
This might be a stupid question, but, would it make sense to have React Native
also for Windows, Linux, OS X, etc.?

~~~
dcre
It's certainly possible, but for now you could just write an app in plain
React and wrap it in a web-to-native app wrapper, using something like
Electron or MacGap (which Slack uses for their Mac app).

[http://electron.atom.io/](http://electron.atom.io/)

[https://github.com/MacGapProject/MacGap1](https://github.com/MacGapProject/MacGap1)

------
arbesfeld
Really exciting to see an effective way to do cross-platform mobile dev, this
has been a long time coming.

Shameless plug for my own project, AppHub:
[https://apphub.io](https://apphub.io)

React Native makes it easy to write cross-platform JavaScript, we're trying to
make it just as easy to deploy to every platform.

~~~
squints
We're using AppHub to update our React Native app. It's amazing. Bringing one
of the biggest benefits of the web to native!

------
shaohua
There was a lot of hesitation around ReactNative iOS because people are not
sure when the Android version is coming out. Now, it is finally here!!! So
excited....

Let's meetup to learn it together: [http://www.meetup.com/SF-React-Native-
Meetup/events/22536022...](http://www.meetup.com/SF-React-Native-
Meetup/events/225360223/)

------
BinaryIdiot
Wow, I was literally looking at this today to see if Android was announced
yet. I'm working on a little side project and I was using C++ as the common
language across both iOS and Android platforms. While I do, in fact, like C++
it just doesn't have the same support as more dynamic languages to do even
basic things (even string splitting or trimming requires separate libraries or
rolling your own code; how does a standard string library not include such
things?). This looks pretty good.

I'm going to look into this. I'm mostly curious about how building works and
how easy it is to setup, say, a single (or two) build script(s) that can
package for either platforms and grab the necessary, common JavaScript. I'm
also curious as to how easy (or difficult) it is if you wish to create custom
UI components for either platform.

------
Bjorkbat
I like this. I tried Ionic, didn't like the complexity or the fact that one of
the downsides of the "write once, run everywhere" approach is that my app
looked too identical and didn't respect the design conventions of the platform
it's running on.

It's interesting how you work with views named after their phone counterparts.
Makes it far easier for a fairly experienced phone developer to make the
switch.

I'm going to have to give this a try. I have a little side-project, a Golang
hacker news clone, that I think deserves a mobile app.

------
kendallpark
This is exactly what I needed right now. <3 <3 <3

I don't think I've been this excited for a platform release.

------
eloisant
Anyone got the Android skeleton working? I'm getting a red page "unable to
download JS bundle" despite having the dev server running.

I'm using a 2013 Moto X on Android 5.1.

~~~
andreicoman11
Make sure your phone can connect to your machine: check
[https://facebook.github.io/react-native/docs/running-on-
devi...](https://facebook.github.io/react-native/docs/running-on-device-
android.html#content)

~~~
eloisant
Indeed, I had to input the local IP of my machine with "Debug server host for
device". Thank you!

Then I got a NPE:

[21:36:12] <START> request:/index.android.bundle?platform=android TypeError:
Cannot read property 'root' of null at
/Volumes/Devdisk/Perso/ErwanReact/node_modules/react-native/packager/react-
packager/src/DependencyResolver/crawlers/index.js:16:84 at tryCallOne
(/Volumes/Devdisk/Perso/ErwanReact/node_modules/react-
native/node_modules/promise/lib/core.js:37:12) at
/Volumes/Devdisk/Perso/ErwanReact/node_modules/react-
native/node_modules/promise/lib/core.js:103:15 at flush
(/Volumes/Devdisk/Perso/ErwanReact/node_modules/react-
native/node_modules/promise/node_modules/asap/raw.js:50:29) at doNTCallback0
(node.js:408:9) at process._tickCallback (node.js:337:13)

I was able to fix it by replacing this line:

[https://github.com/facebook/react-
native/blob/master/package...](https://github.com/facebook/react-
native/blob/master/packager/react-
packager/src/DependencyResolver/crawlers/index.js#L16)

By this:

    
    
        return fileWatcher.getWatchers().then(([watcher]) => !!(watcher.watchProjectInfo && watcher.watchProjectInfo.root));

------
robertfw
I was googling to find out if this had come out late, late last night. Found
the countdown site and figured it'd be here within a month, so might as well
start laying down some wireframes and plans for the app I've been wanting to
build with it. Lo and behold, this morning...

Suffice to say I am very excited for this. I've been really impressed with
React and what it has done for frontend development, and I can't wait to see
how it translates.

------
robterrell
I don't see how you can make a single cross-platform experience from a single
JS / JSX file. The sample has two different main.js files, one for each
platform:

    
    
         // iOS 
         var React = require('react-native');
         var { TabBarIOS, NavigatorIOS } = React;
    
         // Android
    
         var React = require('react-native');
         var { DrawerLayoutAndroid, ProgressBarAndroid } = React;
    

How can you determine the platform at runtime and dynamically build the layout
for each? I'm guessing, we'll have to expose a native function that returns
the active platform, although it seems weird this doesn't already exist.

I wonder why the team decided not to abstract the functionality a bit, like
Xamarin did with Forms, so something as common as tab view could be
constructed in a cross-platform manner? I understand the urge to keep the
platforms feeling native, but a little abstraction could go a long way.

~~~
aboodman
That is by design. React native isn't intended to be write-once, run-anywhere.
iOS and Android UIs are just too different for that to work well.

Instead, React Natives gives you a place (javascript) where logic can be
shared between iOS and Android, and a common approach to rendering that leads
to lots of shared code.

------
oblio
A sort of strange question. Has anyone tried Qt as a cross platform toolkit
for mobile? What was your experience with it?

I ask this because I'm thinking about creating a cross platform app, desktop +
mobile and I'm wondering which would be the best way forward. Qt? ReactJS +
web browser + React Native? Something else?

~~~
rhodysurf
Qt is less than optimal on mobile. It uses QML mostly and the widgets do not
look native to iOS or Android out of the box.

I write mobile apps natively in my spare time, but use Qt at work I wish that
Qt was more solid for this.

------
volent
"OS X - Only OS X is currently supported"

Why is this becoming popular ?

~~~
sero
There's unfortunately a lot of non-overlapping work so we decided to release
what we have finished incrementally. Most of the team uses OS X for
development so it was a natural first choice. We're planning on adding the
missing Windows and Linux support soon!

~~~
drewstiff
Do you want to give us a time-frame so we can go create
[http://www.reactnativeandroidforwindows.com/](http://www.reactnativeandroidforwindows.com/)
and put a countdown timer on there?

------
Sir_Cmpwn
Can I work on React Native Android apps on Linux?

~~~
vjeux
There is no technical reason it shouldn't work but we haven't focused on it
yet. Pull requests are more than welcome if you see any issue :)

~~~
Sir_Cmpwn
Cool, thanks :)

------
yavi
Congrats on shipping on schedule! My experience with React Native for iOS has
been pretty pleasant so far given how young the libraries are. My main
frustrations so far have been with the Navigator component (both the 'fully
native' and the 'emulation native' versions) and some inconsistent
documentation, though the latter I suspect is the result of rapid API changes.
Pretty short learning curve, though, and the results have performed well, so
I'd recommend anyone with moderate experience with React to check it out.
Looking forward to diving in to the Android version soon.

------
srameshr
Great to see that some Cordova plugins are available for react-native
(Background geo location). I think it is just a matter of weeks before this
becomes the main stream for web developers who would like to write native
apps. Don't know how Ionic can even compete with this, considering Angular2,
which can render anything and not just the DOM. By the time Angular2 is stable
and out of dev-preview react-native would have perfected native-rendering. Its
going to be Angular2 + React-native for native apps in future.

------
josteink
My interest in this when it was iOS only was about >< this big, but now I may
actually start skimming into things and see if this is something we'd want to
use at work :)

------
vijayr
Noob question - is it possible to learn React and build mobile apps for
someone who is a web developer and has no knowledge/experience in mobile
development?

~~~
mkonicek
It is possible to build an app purely in JS. The Facebook Ads Manager was
built by a team where some people had mobile development experience and
several people only had JS experience.

~~~
vijayr
wow, we can expect whole lot of mobile apps then? There must be 10x web
developers as mobile developers, at least?

~~~
mkonicek
Don't know the numbers exactly but I would say it's less than 10x.

------
jbob2000
Yes! I've been working with React-Native on a side project for a few weeks
now. WHAT A GODSEND! Before this, I was using Titanium, which is heavy, slow,
and difficult to integrate with. React-Native felt like home.

On a related note; Why is it up to Facebook to develop something like this?
Why aren't Apple and Google making it this easy to develop apps? ObjC is a
nightmare, 90% of apps out there don't need that level of control.

~~~
jbigelow76
_Why aren 't Apple and Google making it this easy to develop apps?_

Apple has no incentive to make it easier for app developers to port their code
to other platforms.

~~~
rail2rail
Has Apple ever chosen a non-native app for its annual design awards?

~~~
whatever_dude
You mean not including the vast number of Unity based games that are there?

------
andresmanz
I'm sorry for the stupid question, but I'm in a hurry: I don't really want to
write the whole app logic in JavaScript. Is it possible in an easy way to have
a React Native UI on top of a common C/C++ code base? I don't know React yet,
but it gets _very_ interesting now and I'd like to give it a try. Maybe it
could completely replace Qt for me.

~~~
sero
I'm not exactly sure of your circumstances, but this sounds doable.

The public React Native API allows you to expose arbitrary pre-existing Views
and expose new native functionality in modules accessible from JS. These can
be written in java (or in C/C++ and exposed via JNI -- and if you structure
your code properly you can also share that native module with an iOS RN app if
you'd like).

We also support having just part of the app, e.g. some of the screens, written
with React Native. This is what we do with the Groups app.

The main thing to be aware of is that splitting app logic and data management
between JS and native will mean that you need to be careful with cache
consistency between the two.

~~~
andresmanz
Thank you very much for your detailed answer. That really helps and I will
finally learn React now.

------
danr4
A question for the devs:

If somone writes a React Native component, that doesn't touch native APIs, its
usable across platform am I right? From what you've seen/built, how likely is
it for components not to use native APIs?

Do you expect seeing components named react-native-ios-sidebar?

~~~
cuu508
> Do you expect seeing components named react-native-ios-sidebar?

Take a look at components in sidebar here: [http://facebook.github.io/react-
native/docs/getting-started....](http://facebook.github.io/react-
native/docs/getting-started.html#content)

------
Wonnk13
really excited to dig into this, though i don't know much javascript or React.
I'm curious to see how material design comes across in these types of apps and
how easily it will be to tell apart a native app and the "react" version.

~~~
myko
Yeah, it's a bit unfortunate the 'Facebook Ads' app does not appear to use
Material conventions like ripples or a pretty transition when the FAB is
pressed.

I hope support for, well, the Android support library is in the works! Android
apps without Material flourishes are starting to look out of place.

------
akramhussein
Are there any high-profile apps using React Native other than those from FB?
Native dev here, but considering an Android port, so wondering if maybe RN
would be better.

~~~
browniefed
Not too many, you can see a showcase here [http://facebook.github.io/react-
native/showcase.html](http://facebook.github.io/react-native/showcase.html)

I believe larger companies are currently working towards React Native apps
though.

------
sheraz
Has anyone done a comparative analysis of appcelerator vs react native? I
might be up for it if anyone would like to join.

~~~
iLoch
I've used both but I'm not part of the Appcelerator cult like most people who
have invested in it apparently. Appcelerator is bad. Their OSS license is
sketchy last I checked. But that's not its only problem. The community is
driven by a module marketplace, which means a ton of okay-quality modules now
cost $5 each. Not necessarily a bad thing, but React Native developers are
releasing way more modules as FOSS, which is important to keep the community
growing and active. Another thing that doesn't generally seem possible in my
time with Appcelerator is being able to build a view hierarchy using native UI
components. That is, I can't for example create a camera viewfinder as a
background element and throw my UI inside of that element.

React Native in comparison has taken the path that is best for FOSS developers
at every step of the way, which makes me very happy about the future of the
platform.

------
amelius
I can't believe people (especially computer scientists) are buying into the
React craze. They took an O(1) algorithm, and turned it into an O(N)
heuristic, and popularized it by portraying it first as an O(N^3) problem [1]

[1]
[https://facebook.github.io/react/docs/reconciliation.html](https://facebook.github.io/react/docs/reconciliation.html)

~~~
z3ugma
Can you explain the assertion that DOM rendering is O(1)?

~~~
amelius
Of course. For example, suppose that there is a button in your UI that changes
color whenever you click on it. Changing the color of that button in response
to a click can be done in a simple Javascript function that takes O(1) time.
However, doing it the React way, all buttons on the screen have to be
traversed, O(N), and diff/patched into a new DOM, which is heuristically O(1).
However O(N+1) = O(N), so React takes O(N) time for something that can be done
in O(1) time.

Now, while React may still be fast enough in practice, I can't understand why
computer scientists find the situation acceptable. It feels like using bubble
sort instead of quicksort or mergesort because you expect your problem space
to never grow.

~~~
exogen
It's because anyone who has done any complex web app development knows that
you don't have one button changing color. You have 100+ UI components whose
state may depend on one another, and as the DOM nodes composing those UI
elements get state attached to them, it's EXTREMELY easy for them to both (1)
get out of sync, and (2) thrash and re-render entire trees of the DOM
unnecessarily. This is a real thing that happens frequently and is why people
think JavaScript causes pages to be slow and janky.

React lets developers pretend they CAN just re-render entire DOM trees from
scratch without those consequences, as if they were serving up a fresh server-
side render of the page.

Also, suggesting that before React, web apps were updating all their DOM nodes
in O(1) time is insane – even if it's not the absolute fastest, why does it
compare so favorably in actual tests, then?

~~~
amelius
Yes, I understand all of this. It can work for small websites. However, the
technique cannot uphold for larger systems. For example, consider writing a
word-processor using this style of programming. If the user is writing a
10-chapter book, and every character entered by the user requires a visit of
all characters in the book, that is not very usable. So even from a practical
viewpoint (not just theoretical) it is not workable.

Also, consider adding items in a streaming fashion (one-by-one). If there are
N items to be added, then the amount of items visited by this scheme is
1+2+3+...+N, which amounts to O(N^2). This is quite ridiculous.

Also don't forget about power consumption, which is of course very important
for mobile applications.

Finally, The solution is not satisfactory from an intellectual viewpoint.
Instead of trying to be smart, we are lazy, and abuse abstractions to make our
lives easier, and at the same time our software behave slower (especially now
that progress in speedwise performance in hardware seems to have stopped).

~~~
anezvigin
> For example, consider writing a word-processor using this style of
> programming.

Quip uses React.

------
david_ar
Possibly naive question: How does this compare to qml/qtquick?

------
elietoubi
That could really be a game changer in mobile development.

~~~
aikah
Abstractions like these always target the least common denominator. But React
has the "component" advantage so i'm not dismissing its usefulness. it's good
for a category of projects.

~~~
muzmath
Do you consider a facebook production app a least common denominator?

~~~
aikah
Do you really believe the facebook production app is built 100% with React
Native ?

~~~
sehr
yeah

> Facebook Ads Manager is built entirely using React Native.

[https://code.facebook.com/posts/1014532261909640/react-
nativ...](https://code.facebook.com/posts/1014532261909640/react-native-
bringing-modern-web-techniques-to-mobile/)

~~~
aikah
Ads Manager =/= Facebook app for "users"

~~~
sehr
I think I see where the confusion is, muzmath said 'a' facebook app (i.e. Ads
Manager), not 'the' facebook app. Main FB app is definitely not using 100%
react native.

That being said, Ads Manager users are still mostly just "users". I know a
middle aged woman using it to manage ads for her side business for example,
regular people are using 100% React Native apps daily.

~~~
muzmath
Your right, when I say a facebook app, I literally mean an application,
developed by facebook.

------
s73v3r
The article also seems to indicate that their repository strategy is not
properly set up for something like this.

Most people, I think, would initially set up a separate repository for iOS and
for Android, given that they are different codebases, and you wouldn't want
commit history pollution. But if you're planning on reusing a lot, like in
this project, it might make sense to have them both in one repo. Or have a
third for shared code, and include that in each individual one?

~~~
mkonicek
We've had two separate repos for iOS and Android and we're merging to a common
one. It's much easier to manage, especially when sharing C++ and now React
Native JS code between iOS and Android apps (e.g. the Ads Manager).

------
curiousjorge
yes been waiting for this for a long time!

------
andyl
At last. Now I can dig in...

------
loceng
Are any businesses avoiding using React because of the power it gives Facebook
- where they can sue you however if they infringe on your copyright or patents
or other then you can't sue them because you'll lose the license to use React
- along anything else they've released?

You can say it is a fair practice for a private company, however I am
wondering what business operations and founders are thinking.

~~~
spicyj
I'm not a lawyer, but you might have missed this clause in the patent grant:

> Notwithstanding the foregoing, if Facebook or any of its subsidiaries or
> corporate affiliates files a lawsuit alleging patent infringement against
> you in the first instance, and you respond by filing a patent infringement
> counterclaim in that lawsuit against that party that is unrelated to the
> Software, the license granted hereunder will not terminate under section (i)
> of this paragraph due to such counterclaim.

Also consider that most open-source licenses make no mention of patents at
all, so you have no assurance that the company won't come after you for
patents in their software.

~~~
loceng
Your example is solely if THEY initiate a lawsuit then you're allowed to
respond, not if they do something against you that warrants suing them first.

Edit: E.g. They can copy your whole business, design and all, and if you're
using React and sue them - then they can use that against you / you'd have to
immediately cease using it; I'm not actually sure what the outcome would be if
a license automatically expires.

~~~
matthewmacleod
_Your example is solely if THEY initiate a lawsuit then you 're allowed to
respond, not if they do something against you that warrants suing them first._

Note that this is specifically regarding a patent assertion; i.e. the patent
grant is not revoked if you bring legal action against Facebook for another
reason, including trademark or copyright issues.

 _Edit: E.g. They can copy your whole business, design and all, and if you 're
using React and sue them - then they can use that against you_

See above – this would specifically only apply to patents.

 _you 'd have to immediately cease using it_

This is not necessarily true – it just means that you lose your patent grant
to React. There is no assertion here that Facebook hold any patents on React.
It's obvious why this would be the case – if you bring a patent suit against
Facebook, then they revoke any patent license they've granted you. I would
expect any patent license – for open-source software or otherwise – to be the
same.

Granted, this does nothing to affect the wider issue of a broken patent
system.

