React Native for Android
code.facebook.com
code.facebook.com
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.
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.
React Native and NativeScript seem to have all the upside of Cordova (transference of web dev skills to native platforms) with none of the downsides (lag in new OS feature implementation, webview wrapped apps), I wonder if Cordova's days of relevance are numbered.
However, what's even sadder to me is the fact this continues to be true despite the fact that, believe it or not, the web has been the platform where most of the innovation in UI development paradigms has been taking place in the past few years. And I don't just mean in terms of the sheer number of new things coming out.
The web community pioneered UI development paradigms involving functional programming techniques and immutable data, and have brought its benefits to other platforms (through projects like React Native). I personally would never want to go back to the old way of building UIs. And I suspect I'll feel the same way about client-centric data fetching when I get to try out Relay/GraphQL, Falcor, Om Next, etc in production.
I really want Firefox OS to be successful for this exact reason. I don't want to have to make compromises between the best experience for my users and the best experience for myself as a developer. With a platform that makes web the native UI technology, we shouldn't have to make this compromise in theory, but Firefox OS's execution thus far has left much to be desired.
As someone with lots of native UI experience, that has to occasionally support web projects, the web is just plain clunky and playing catch up with the RAD tooling we enjoy since the mid-90 on native platforms.
https://github.com/gaearon/babel-plugin-react-transform/
I believe I used something similar called fam in the 90's but that may have only been on SGI.
These new hot reload implementation allows your app to be reloaded with your new changes without affecting the state of the application, and is not practical unless your application has been developed with a focus on functional techniques and careful management of application state.
This probably doesn't sound like a significant difference, but in practice, it is a huge boost to productivity, especially in a non-trivial app where reloading the entire app and then reproducing the app state manually with every file change can become quite tedious.
In the types of apps I think we're talking about, typically most state is in the database and not much is going on in the client.
* CHANGE-CLASS (change the class of an object to a different class),
* update-instance-for-different-class (updating the object after a class change, one can provide methods which will be lazily called when needed),
* update-instance-for-redefined-class (updating the object after redefining a class, one can provide methods which will be lazily called when needed),
* LOAD (load source or machine code),
* EVAL (eval expressions)
* COMPILE (compile code in memory to memory), ...
One then always develops with a live application. Classes and objects can be updated in-place...Hey cool, I can change these classes live!
Let's solve this tricky problem by changing the class at runtime. Cool, it works, now on to the next problem.
2 years later...
What's causing this super-weird bug? It's like the code isn't doing what it says at all.
1 week of debugging and head-banging later...
Oooh, something got screwed up in that runtime class change code. Fixed.
2 years later, repeat...
It's a pretty amazing technical feat that this works at all, but I have a hard time imagining this would work well in practice for changes to anything other than maybe method bodies and templates though. Java's style of object orientation generally means there's plenty of tight-coupling between application state and operations on the application state, which would probably make life very difficult for any hot-reload implementation.
But regardless, it does exist and apparently works well for a lot of people. It looks like I was just ignorant when it comes to native tooling.
Only one way to find out tho :) Trying it out for oneself.
Or designing GUIs WYSIWYG with Delphi, XAML with Blend, the UNIX 4GL in the 90?
Tooling for web development has probably been heavily inspired by the tooling available for CL and Smalltalk, but I don't think it's fair to say it's still playing catch up. The tooling ecosystem for the web has long since caught up to the best native ever had to offer, and is now advancing the state of the art faster than any other tooling ecosystem out there today.
Along with other things such as the app manifest, Chrome on Android is leading the pack in terms of making the mobile web feel native. Previously this title belonged to iOS Safari, unfortunately Apple dropped the ball a long time ago.
I've been a long time Firefox user and I'm using Firefox on Android as well. But I do think they could do a better job, I mean I'm all for Firefox OS and what that means for Mozilla, but I feel their Android effort is subpar and that's a shame, given that Android is the modern Windows and there's plenty of room for Firefox on it. I mean right now Firefox is the only app I have that wasn't updated for the material design guidelines and they didn't even try to fake it. And that would be OK, but I've been waiting for things to get fixed ever since forever, like the Add to Homescreen functionality which is completely broken.
But anyway, people that bemoan web interfaces are usually ignorant of present day web interfaces that people use.
You can't name an email client that's more usable than GMail's web interface. And surprisingly FastMail on a mobile browser is almost as usable as native GMail, being all web. Facebook and Google Maps are 2 other example of having awesome mobile web interfaces. Of course, people focus on shiny rather than utility. But I don't care how usable or shiny your iMessenger or your FaceTime is, because I don't own an iOS device, not anymore. And your native app might be great, but if it doesn't have a web presence, I personally don't care much about it because I change devices often.
I won't use the full client because it eats my battery, and they separated the messenger interface requiring yet another app with battery eating features.
> 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.
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.
Which is already done for you in Ionic -- including disabling the 300ms delay.
My hacker news app is a hybrid app. Available on iOS/Android/Windows/Mac and web, and I harldy see any one compalining about not being native.
There are some legit issues and peole think only way to fix is go native. Only reason I have not fixed those issues because I don’t have time, or I don’t use that functinality.
1. I get an error message "Unable to load xxxx" at times (forgot the exact message) and the app closes.
2. If I switch between article/comments it always reloads
3. At times clicking on the comments icon doesn't work when you are in article mode.
4. I can't long press on links in comments to share it to browser/pocket etc
Compared to reddit apps like Relay, the HN app does feel much more basic.
http://blog.ionic.io/built-with-ionic-sworkit/
I did a pet project using the vibration feature and it worked pretty well, but haven't tried on an iphone.
I can't speak for pushing the limits of the hardware though.
But if your app is more advanced like a drawing app you should not use these cross platform stuff.
I have ran into some roadblocks that required stepping into native development to fix up issues with Cordova Plugins (specifically for background operation), but I suspect that won't be necessary for a large majority of apps out there.
Personally, I find the Hosted Web App spec a very promising alternative to Cordova for app development with web technologies. You simply use the open web APIs (notifications, geolocation, camera, etc) for features that would normally require messing with plugins in Cordova, and they would just work.
https://developer.mozilla.org/en-US/Marketplace/Options/Host...
It's such a shame that the biggest players (Android and iOS) probably have no plans to support it natively since it would greatly reduce developer lock-in. In the meantime, the ManifoldJS project can provide Cordova-based polyfills for your Hosted Web App, but then you'd have to resort to messing with plugins all over again for the only two mobile platforms that really matter...
Different cross-platform tools have different approaches, but as a concrete example take Corona SDK. You need no native platform knowledge and your app runs inside the Corona runtime, which makes some difficult things easy but some easy things -- third-party SDK integration, install source tracking -- difficult. And if the creator of the cross-platform environment has chosen not to support certain things, you're out of luck (and you're probably always going to be lagging even for things that are supported). On the other hand, you have only a single codebase to maintain and single-click builds for a lot of platforms.
As for Cordova, we spent some time testing if the performance was sufficient when building an early version of Recent News (https://recent.io -- v1.0 just released three days ago!). We concluded it was not. Boot times were slow, the UI felt very non-native, and overall performance didn't meet our requirements. Now that was a while ago and Cordova may have improved, and hardware performance certainly has improved, so maybe it's a better option today.
There's the rub. If you don't know anything about the native platform then you "don't know what you don't know". The NativeScript demo shows how to pull in a native ObjC function (a string related method I think), but if you start with no background in the native libraries how would you even know when you could be leveraging a native library function instead of trying to recreate a sub-optimal approximation in JS. But if you have the foundation and know the native platform, why jump ship to JS at all? And then I'm right back where I started :)
I'm a (native) Android and JS developer. The primary reason I'm excited about React Native is that I don't have to go through the tedious compile-install cycle for every little UI change. React Native will make prototyping/iterating on Android as easy as it is on the web. However my reasoning assumes that there will be almost no friction in terms of creating complex views in React Native. I'm curious to see if that pans out.
No, that's the beauty of it. All you need to do is shake your phone and tap the "Reload JS" option. Those JS files are served by some sort of a server that starts up on your dev machine when you first deploy the app. See https://facebook.github.io/react-native/docs/tutorial.html#d... (search for "reload js").
I dabbled w/ Cordova and friends before, and did some work to wrap webapps in thin native shells earlier on, but there was always a very strict separation between the "sandboxed" webapp and the native code, if any.
Webapps can and do work just fine for CRUD applications, but right now, I'm of the opinion that if you want to really leverage the hardware APIs or the native ecosystem, you're better off learning the native platform, because you get no syntax mismatch friction on Stack Overflow etc, compared to Xamarin / React Native / Ambly / whatever
Also, this opinion might be unpopular among the js devs who like lightweight text editors (disclaimer: I'm one), but the heavy IDEs for Java/ObjC/Swift are actually immensely useful once you get familiar w/ their features. The static typing provided by those languages helps a lot in large refactors, in API discoverability/autocompletion and in reasoning about the codebase in general.
After you write/run a lot of tests to make sure the app does what it's supposed to (there's paid services for this kind of testing too) http://googletesting.blogspot.ca/2013/08/how-google-team-tes...
This React abstraction can use Chrome Developer Tools for debugging though, that's pretty awesome.
Personally, I see little to no disadvantage with using these particular types of tools, especially if it means you can use languages like Scala, C#, and F# instead of Objective-C and Java.
https://github.com/facebook/react-native/commit/42eb5464fd8a...
This comes in time for Facebook to meet its pledge.
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.
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.
"At the time of shipping Ads Manager for Android, that approach yielded around 85 percent reuse of app code."
The only place that I usually end up making platform-specific changes is where Ionic has an iOS-specific layout change that breaks the look of a custom component on iOS. That and sometimes native-only features like Push Notifications that need to be handled slightly differently on each platform. But the latter is about a half dozen lines of stock code that take the iOS result and hand it to a common handler.
I'm probably sticking with Ionic for now, though I'm planning to try out Meteor for my next project that has backend requirements. Meteor can install the Ionic SCSS as a plug-in, so you CAN get the best of both worlds.
There are dozens of platform-specific styles in the CSS that make each target behave more like a native app. A custom-styled native app, but one that follows platform conventions.
I also absolutely abhor the fact that React mixes HTML with JavaScript. It just feels so completely wrong to me.
React Native is much more a step in the right direction IMO, although the Ionic team's work on Ionic 2 with Angular 2 could provide an interesting paradigm to compete on that front.
Ionic is using HTML widgets , not actual IOS or Android widgets like React Native , Titanium or others. So you are basically developping an HTML client inside a webview and calling it an APP. Of course you'll be able to reuse 98% of the code that ran into a web browser. But it will look like an HTML website.
This is simply not true anymore. For simple CRUD apps, our customers can't tell the difference between a native app and an Ionic app. The ionic team has done a great job simulating the native animations and interactions of iOS and Android.
If you don't believe it just try it. It costs 30 secs to install Ionic via npm and deploy one of the demo apps to an Android or iOS device.
For more complex apps I'd consider using a native framework tho. As usual it all depends on the use case.
React Native has been absolutely amazing so far. So excited for Android!
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.
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.
Good catch. Didn't know this feature, thanks!
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...).
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?
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.
EDIT: screenshots were added :)
Do you?
Not trying to discourage the use of it - just that "Facebook uses it in production" isn't really a big sell for me.
Anyway, the point is that it doesn't run in a WebView. The JavaScript is executed by JavaScriptCore.
With React-Native, it's really easy to be lazy. If you want to be on Android, but you don't want to change your designs to fit Android's UI standards, screw it, just write a wrapper around some of the iOS components and call it a day.
For example, I believe that both the navigator components for React Native in iOS currently suffer from either bugs or performance issues. The more native one has an open issue related to UI flicker, and the JavaScript-based one drops frames when subviews are complex.
That statement might not be true tomorrow or next week, because the ecosystem is developing quickly. Generally I am very happy with React Native.
This is one of the strengths of React Native. Don't emulate the native UI - use it, just access it via JavaScript.
Running in node, you already have pretty good access to native apis via native node libraries.
Jordan Byron already contributed a port of React Native to Apple TV: https://github.com/facebook/react-native/issues/2618#issueco...
All you would need is a React wrapper around the UI controls, like this one: https://github.com/winjs/react-winjs
Shameless plug for my own project, AppHub: 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.
Let's meetup to learn it together: http://www.meetup.com/SF-React-Native-Meetup/events/22536022...
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.
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.
I don't think I've been this excited for a platform release.
I'm using a 2013 Moto X on Android 5.1.
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...
By this:
return fileWatcher.getWatchers().then(([watcher]) => !!(watcher.watchProjectInfo && watcher.watchProjectInfo.root));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.
// 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.
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.
var React = require('react-native');
var { Platform } = React;
if (Platform.OS === 'ios') {
// lol steve jobs
} else { // lol robutts
}Android also has a `Version` property on `Platform`.
- Certain features are not idiomatic on both platforms: where you might use TabBar on iOS you are going to use a Drawer on Android. NavigatorIOS is a wrapper around UINavigationController that is not maintained as part of the core React Native project, but is a community effort -- nobody at Facebook uses it, and nobody who makes any serious apps with React Native use it either; instead, they use the cross-platform Navigator component, written entirely in JS. Similarly, if you really want to use a TabBar on Android, there exists at least one excellent JS implementations of this that you can use: https://github.com/exponentjs/react-native-tab-navigator
- This is still a very early release! In fact, it is the first day it is released. There are plans to bring the APIs together where it makes sense. For example, SwitchAndroid and SwitchIOS will be brought together under a Switch component that has the same API on both platforms but uses their underlying native implementations.
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?
I write mobile apps natively in my spare time, but use Qt at work I wish that Qt was more solid for this.
Why is this becoming popular ?
I've been in Windows for a long time and it uses to be the opposite a long time ago - everything would be released on Windows only and Macs were left abandoned - so I guess I'm seeing the other side now. Not a super fan of Microsoft, but still annoyed I'll have to eventually switch just because of stuff like this.
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.
Apple has no incentive to make it easier for app developers to port their code to other platforms.
You have to learn a whole new Apple-only programming language to do iOS (Swift or Objective-C) in addition to the iOS framework/libraries. Not to mention buying a Mac and paying Apple $100 for a developer account.
Android, on the other hand, was pretty straightforward to get started with for me as someone with Java experience.
Why Google hasn't done this, I don't know. Seems like it is in their best interest and something they're already doing internally. They use the shared web/Android/iOS code concept for Inbox (but not HTML/JS)[1] and probably other projects.
[1] http://arstechnica.com/information-technology/2014/11/how-go...
Are there any "unicorn" apps that are Android only and intend to stay that way?
Chrome? Also Gmail, Google Now, and Facebook Messenger on iOS are garbage compared to Android.
I could be wrong but I am pretty sure I am typing this response in Chrome on a Windows box right now, so maybe not the best example of an Android only app.
It's just stuck being the Chrome around UIWebView instead of fully featured Chrome, which is unfortunate.
[1] https://play.google.com/store/apps/details?id=org.prowl.torq... [2] https://itunes.apple.com/us/app/foreflight-mobile/id33325263...
https://github.com/domokit/sky_engine and https://github.com/dart-lang/fletch
Right now Fletch looks pretty awkward/painful to use though. Writing views completely natively (ObjC/Swift/Java) and then calling into a DartVM for business logic doesn't sound like a fun way to develop to me. I could be wrong, I haven't tried to use Fletch - just read some examples, but right now I don't see the benefit.
Sky is basically Cordova as far as I can tell. It dumps native looking views into a webview and calls it a day. The demo app on Google Play (https://play.google.com/store/apps/details?id=org.domokit.sk...) does not make me terribly excited for it :(
Also, looks like they will name it as Flutter: https://flutter.github.io/getting-started/
The only reason you think it's not easy is because you're using Titanium, and not embracing the different platforms' native toolkits.
If you don't need to push the features envelope of the mobile platforms you are targeting, and if you are OK with having L&F that isn't native, and if you are OK with the pace at which your cross-platform tools chase the native platforms, then cross-platform tools like React Native can be fine for you.
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.
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?
Take a look at components in sidebar here: http://facebook.github.io/react-native/docs/getting-started....
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.
I believe larger companies are currently working towards React Native apps though.
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.
[1] https://facebook.github.io/react/docs/reconciliation.html
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.
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?
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).
Quip uses React.
You should choose React because it makes building reusable (web)components for applications much easier.
> Facebook Ads Manager is built entirely using React Native.
https://code.facebook.com/posts/1014532261909640/react-nativ...
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.
Let me spell this out for you...
A Facebook app, is an app made by facebook, which obviously i'm referencing the one that they are talking about in the article your commenting on. And yes, it was made using React Native. Any more questions before you read the article?
1) There are a ton of native APIs that accomplish exactly the same things, but have different APIs because different people built them and there's no pressure to make them consistent. Examples: layouting (just calculate x, y, width, height's of a view tree), animation, storage, networking, touch handling, the list goes on... it's a waste to have to learn the implementation specific quirks of each platform.
2) We've focused on making sure we can make apps at least as good as the native ones for the platform. Specifically this has meant exposing platform specific apis (e.g. Android's material touch ripple, iOS's gaussian blurs, etc), allowing arbitrary new ones to be added, and encouraging designers to still design their apps for each platform individually.
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?
You can say it is a fair practice for a private company, however I am wondering what business operations and founders are thinking.
> 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.
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.
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.
Edit: > The license granted hereunder will terminate, automatically and without notice, if you (or any of your subsidiaries, corporate affiliates or agents) initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software.
This does seem like it would be a standard clause for any patent agreement with another party, but IANAL.