News for hackers. Stuff that matters.
Re:Introducing Create React Native App by baron816 on Monday March 13, 2017 @05:15PM (#13862465)
What are people's feelings towards React Native vs actual native mobile development these days? Are people starting to get the sense that this is the future and coding in Swift/Objective-C/Java for mobile is dying off?
Re:Introducing Create React Native App by stevepotter on Monday March 13, 2017 @05:41PM (#13862709)
I've been doing iOS and Android for about 6 years. My latest project uses React Native. We just finished an app for both iOS and Android that has over 100 screens and did it in only 3 months with a small team. So I'm a good authority on this subject.

I found React Native to be a mix of joy and frustration. I was amazed at how quickly our devs, who came from the web, could build polished screens that performed beautifully. Then I would become baffled at how, for example, you couldn't do a background upload in React Native. Here - it does is upload a file in the background: https://github.com/Vydia/react-native-background-upload

In RN, you have to connect JavaScript to native code with "bridges". If a bridge exists for, say, getting GPS data, you are fine. But if it doesn't, welcome to the club. I finally became relatively adept at writing these bridges, but I would have much rather have spent that time writing code for my app.

Their build system is weak. For example, the build scripts hardcode 'dev mode' unless you have a build scheme in iOS and Android called 'release'. It felt like nobody else had built RN apps that have beta and staging environments. Crash reporting sucks and we finally got it working with sentry.io and some custom build scripts to upload source maps so we could get decent JS error reports.

But that stuff will go away in time. I was blown away at the progress we made. It was painless for web devs to jump right in an be productive. So for us it's a net positive.

If you're starting something new, try it out. Make your platform choice carefully. RN isn't the only game in town. See what works for you. And don't get fooled into thinking that you don't need any native knowledge to make an app. Maybe hello world, but nothing industrial grade.

Re:Introducing Create React Native App by htormey on Monday March 13, 2017 @06:43PM (#13863216)
Pretty much agree with everything you said. I'm an iOS/Android dev with about 7 years of mobile development experience and I have shipped two apps using React Native.

I think the biggest problem with adopting React Native in a shop that already has a native team is politics. Lots of Native developers don't want to touch it.

I think it's a great fit for companies who already have a React front end team and who's mobile teams are at least open to giving it a try.

Re:Introducing Create React Native App by j2kun on Monday March 13, 2017 @11:38PM (#13864788)
> Their build system is weak.

I feel like this is a huge understatement. Doing anything non-default takes ages to configure, and there's so little documentation to help you out.

Re:Introducing Create React Native App by stevepotter on Tuesday March 14, 2017 @12:07PM (#13868709)
Not only that, the team is resistant to enhancing the build system. Example of one of my struggles: https://github.com/facebook/react-native/pull/11711

On a side note, their build scripts are all js and node is probably my last choice for build scripts. As a result, you have callbacks and promises everywhere. I understand they don't want people installing more dependencies but using something common like Ruby would make it much easier to build great build tools.

Re:Introducing Create React Native App by DenisM on Monday March 13, 2017 @05:50PM (#13862778)
>RN isn't the only game in town.

What else is there that's similar? NativeScript?

Re:Introducing Create React Native App by SureshG on Monday March 13, 2017 @06:16PM (#13862996)
Flutter - https://flutter.io/ , but it's in Dart!
Re:Introducing Create React Native App by woogley on Monday March 13, 2017 @06:16PM (#13862993)
I heard about https://weex-project.io/ by way of the Vue docs. There might be other projects too
Re:Introducing Create React Native App by sheraz on Monday March 13, 2017 @07:04PM (#13863387)
There is Appcelerator Titanium which has been in the javascript native mobile app game for 5+ years.

https://www.appcelerator.com

Re:Introducing Create React Native App by tqkxzugoaupvwqr on Monday March 13, 2017 @07:25PM (#13863531)
I used Appcelerator Titanium to build a couple of apps a few years ago (2011–2012).

The positive: If you know JavaScript, you can get started quickly because they provide a JavaScript API and all your code is in JavaScript. Under the hood the JavaScript connects to native code. So you get a native look and feel on iOS and Android. You have a single codebase.

The negative: Back then it was impossibly hard to get an app working and/or looking correctly on both iOS and Android at the same time because Titanium was full of bugs. So many bugs. This is because for each platform they have to provide native code. Sometimes their iOS code had bugs, sometimes their Android code. It was absolutely frustrating. I often had to find workarounds which caused a lot of delay so I had to double down to keep the deadline. Titanium was a reason I quit that job after 1.5 years.

On paper it’s nice, but the implementation was terrible. I went back to web apps and have since been happy.

Re:Introducing Create React Native App by mgkimsal on Monday March 13, 2017 @08:09PM (#13863788)
It seemed to me Appcelerator sort of abandoned the smaller/hobbyist/indie market for enterprise. I was using it in 2013/2014 and went to one of their conferences in 2014 - activity seemed to really slow to a crawl in public (hyperloop was announced, and the demo looked great, but I never saw much after that).

$40/month, but no visual builder. Eclipse-based IDE tooling (which was always flakey ime). $100/month/seat to get hyperloop and visual builder. Still not sure what 'arrow' is exactly.

The demos always looked good, but my day to day was... frustrating after a while. Possibly could have stuck with it and justified with "sunk cost" but I started looking more closely at cordova stuff. Yes, it's not pure 'native' (why I liked titanium) but the ecosystem is more flexible (or so it seems).

Re:Introducing Create React Native App by ourcat on Monday March 13, 2017 @07:58PM (#13863736)
I've been using Titanium for years. Still do. It can be frustrating at times yes, but through using it so long, I've now learned enough Objective-C and Java to fix things or build modules to add functionality. Not enough to build an app, but it's been an enjoyable learning curve.
Re:Introducing Create React Native App by raarts on Monday March 13, 2017 @06:40PM (#13863198)
Re:Introducing Create React Native App by s369610 on Monday March 13, 2017 @07:04PM (#13863384)
Xamarin with Xamarin Forms Xaml
Re:Introducing Create React Native App by whatever_dude on Monday March 13, 2017 @09:24PM (#13864172)
All of those comparisons are missing the point.

RN is not perfect, but it's leagues ahead of Cordova, Xamarin, and etc in a combination of performance and easiness of UI development.

Re:Introducing Create React Native App by yellowapple on Monday March 13, 2017 @06:15PM (#13862987)
Cordova comes to mind (in the "write 'native' apps like web apps" sense, at least).
Re:Introducing Create React Native App by georgefrick on Monday March 13, 2017 @10:30PM (#13864486)
Ionic (2) ? I've been using that with great results.
Re:Introducing Create React Native App by WaxProlix on Monday March 13, 2017 @06:18PM (#13863021)
Not JS/webdev friendly, but things like Xamarin or Kivy (or Qt or whatever) come to mind for cross-platform native-esque user interface building.
Re:Introducing Create React Native App by crystalPalace on Tuesday March 14, 2017 @01:02AM (#13865145)
FreePascal compiles to Android and iOS.
Re:Introducing Create React Native App by zerr on Sunday March 19, 2017 @01:07PM (#13908271)
Embarcadero Firemonkey.
Re:Introducing Create React Native App by the_mitsuhiko on Tuesday March 14, 2017 @02:59AM (#13865605)
> Crash reporting sucks and we finally got it working with sentry.io and some custom build scripts to upload source maps

For what it's worth for react-native proper we are investing a lot of time into this now. With latest sentry-cli getting sourcemaps going is a one-line change to your build script.

https://docs.sentry.io/clients/react-native/#updating-build-... (you only need the line with react-native-xcode)

Re:Introducing Create React Native App by farm_code on Monday March 13, 2017 @10:18PM (#13864426)
How is the maintenance of the app compared to the native code in terms of upgrading?
Re:Introducing Create React Native App by dsirola on Tuesday March 14, 2017 @01:53AM (#13865331)
I just spent whole day yesterday trying to upgrade RN0.40 -> RN0.42. It's a nightmare because there are conflicts in xcodeproj file and you have to manually merge them.
Re:Introducing Create React Native App by stevepotter on Tuesday March 14, 2017 @12:08PM (#13868726)
It sucks. Their default upgrade tool does more harm than good. Currently I start a new RN project then do a diff to see what I have to update on our actual app. Fun, right?
Re:Introducing Create React Native App by cbhl on Monday March 13, 2017 @05:31PM (#13862621)
There have been frameworks for writing native-like apps since the very first iPhone was released.

At some point, you reach the limit of what the framework provides, and you need to write some native code.

I've always felt that most frameworks required you to rewrite your app in native code once you hit these limits, so it was better to just start with native code in the first place. React Native is the first framework that doesn't make me feel this way.

Re:Introducing Create React Native App by bigiain on Monday March 13, 2017 @06:37PM (#13863176)
Sure, but that limits get further away with each advance in js/webrender speed, and as the fleet of devices you're targeting becomes newer (and more powerful) over time.

We pitched (and won) against a competitor who was proposing to use Outsystems last year - who's product creates a React.js Cordova app - and it's mostly only 'cause they demoed badly that we beat them, I was impressed with the capability of their tool (and without doubt their autogenerated react.js thing is well under development to produce react native apps very soon...)

Some apps will always be native code - if for no reason than to gain access to new device capabilities on launch day instead of sometime down the track when bridges or native plugins for the hybrid tools ship - but a vast number of apps can (or are being) reasonably built using hybrid tools these days...

Re:Introducing Create React Native App by kitsunesoba on Monday March 13, 2017 @08:32PM (#13863913)
It's likely not a popular opinion, but I hope React Native and similar frameworks don't come to dominate or be the only option considered in most situations. That's not to say that they have no place in the mobile space, but I do not enjoy web-style development at all. It's half the reason I'm a native mobile dev and not a front end web dev. If RN becomes king, I'll take it as my cue to find a different niche in software development.

I'd much rather see some of the positive traits of JS/RN/etc find their way into Swift/UIKit/etc so I don't have to trade away what I like about native development in its current form.

Re:Introducing Create React Native App by elyobo on Monday March 13, 2017 @11:10PM (#13864647)
The major plus for me is not having to rewrite large parts of my app for different platforms.
Re:Introducing Create React Native App by ccheever on Monday March 13, 2017 @06:12PM (#13862960)
React Native or something like it is almost definitely the future. It's totally unreasonable to write two totally separate copies of your app using languages that take a while to build and compile.

React Native basically solves this and solves it well, and can perform well in most cases.

And if there is some screen where it doesn't (ex. if you were building Snapchat and were going to work on live video filters), you can implement that in Swift/Java/Obj-C and just make that a native module that's part of your RN app.

My personal prediction is that almost all apps will be started in RN in the medium term future and most will end up mostly RN.

Re:Introducing Create React Native App by yulaow on Monday March 13, 2017 @08:58PM (#13864053)
If the js ecosystem taught us something is that react and his derivates are going to fall and being replaced by another iteration of new tools very shortly, and then repeat.

Honestly I think in 1-2 years at max reactnative will have the same popularity of Ionic and Phonegap at max, and probably far less if react will fall against the newcomers of the web-frontend space (vue.js, inferno.js, riot.js, etc) as fast as it seems doing right now, remembering closely the time of angular1 eof vs react beginnings.

Re:Introducing Create React Native App by intrasight on Tuesday March 14, 2017 @12:12AM (#13864928)
>replaced by another iteration

As has been the case with all human artifacts since humans started creating them.

I'm fine with iteration as long as:

a) each one increases developer productivity

b) they remain stable for at least two product release cycles.

Re:Introducing Create React Native App by fatbird on Monday March 13, 2017 @05:28PM (#13862599)
Having run through an app building exercise myself, and starting to shepherd coworkers through the same exercise, my feeling about it is the same as it was for earlier platforms (like Appcelerator) that I tried: good for certain classes of application that are mainly built around text, lists, and UI logic; weak for performance demanding areas like games. React native brings a nice dev pipeline to app development and speeds development for a lot of garden variety app development tasks, making it a real advance for prototyping or rapid iteration; it doesn't bring anything that's going to unseat native app development where native is strongest, in drawing intensive tasks.

It's still early exploration for me, so I might change my mind on this, but I'm not expecting RN to be a game-changer. Definitely useful, but not really going to upend anything.

Re:Introducing Create React Native App by alaskamiller on Monday March 13, 2017 @05:36PM (#13862662)
In the real world of contract software and digital agencies, RN has been a game changer over the last year.

Mobile app projects under $20k are definitely react native. It also makes mobile app projects at the $10k level now viable. At the $40k level it'll be a tough choice, with the fact that the project wants to reuse parts for a web app being the clincher.

The other obvious reality is of course that RN isn't meant for 3D, games, or so on. But that's been the understanding from the get go. What started out as replication of whatever UI components that the first and second class FB apps were making use of has now grown into a community that covers many, many different UI cases.

RN is pushing Swift, ObjC, and Java engineers upwards to focus on the upper end but it's wiping out the bottom by letting the web devs into the mobile devs world.

Re:Introducing Create React Native App by fatbird on Monday March 13, 2017 @06:15PM (#13862991)
At my employer I can easily imagine deploying react native apps for a variety of uses, especially as we do service design : being able to run real experiments with, say, gov't services with real apps or companies looking for mobile assist on new service offerings is a huge win.

At the same time, I'm sceptical that RN has escaped the earlier performance ghettos of Appcelerator, Phonegap et al., which aren't just in games, but also in complicated UIs with a lot of elements. On building a simple sudoku app, I ran into noticeable micro-lag that seems to come from overuse of Views to structure the grid--and noticeably, the performance was better on a non-retina device, causing me to remember the swamp that Java's AWT got caught in with its 'native peering' arrangement, namely that cumulative overhead killed performance in virtually all non-toy cases. React's virtual DOM is an obvious plus in the browser; I'm not so sure where native apps are concerned.

Re:Introducing Create React Native App by intrasight on Tuesday March 14, 2017 @12:04AM (#13864899)
>complicated UIs with a lot of elements

That's a problem for your designer to solve

Re:Introducing Create React Native App by fatbird on Tuesday March 14, 2017 @12:11AM (#13864927)
Not when it's a limitation of one toolkit that another toolkit doesn't have. Then it's just a reason to choose on over the other.
Re:Introducing Create React Native App by intrasight on Tuesday March 14, 2017 @12:29AM (#13865005)
By all means, if one toolkit is more powerful and more productive, then us it. But good design is much about working with constraints.
Re:Introducing Create React Native App by cbhl on Monday March 13, 2017 @05:32PM (#13862637)
Agreed -- if you're doing audio/video effects, or making a non-trivial video game, you'll probably want to be writing in C++ (and on Android, using the NDK).
Re:Introducing Create React Native App by lacker on Monday March 13, 2017 @06:12PM (#13862958)
React Native is definitely more aimed at applications that tend to use the typical mobile UI controls, rather than games. If you're building a 2D or 3D mobile game and you want to get the cross-platform efficiency of React Native, you might want to check out Unity instead.
Re:Introducing Create React Native App by ferologics on Monday March 13, 2017 @05:33PM (#13862646)
Worked with RN for a year now, after 2 years of native iOS dev with Obj-C/Swift.

Declarative UI, hot loading, code reusability, modularity, etc. You name it. Because of all these I feel like a dinosaur whenever touching non-react code.

Native covers the parts where React is clunky - for example some unorthodox UI elements that can't be created with simple views and flexbox styling

Core functionality is there already and with time it's only expanding.

I don't intend on turning back.

Re:Introducing Create React Native App by Andrex on Monday March 13, 2017 @08:16PM (#13863817)
I've done a little Android programming over the years ever since the first beta SDK (m3) hit in November 2008. Android Studio was a revelation, but like I said, I do very little native programming and a lot of Web stuff. I haven't messed with iOS yet.

My experience is: finally, I can program like I do on the Web! And not just in the sense it uses JS, but like, double typing R to "reload" the app being super fast and seamless. Coding my first React Native app has been the most enjoyable experience I've had creating a native mobile app ever. Even small stuff like being able to use the Fetch API over whatever native gobbledegook API Android uses is a massive quality of life improvement for me.

I actually don't particularly care for React itself (the Web version), but that's because its download/execution costs are still iffy for me and I don't think JSX has a place on the web long-term. I also don't think it's opinionated enough and the roster of React "plugins" reminds me of the bad side of jQuery widgets. (If you couldn't tell, I've moved to being more of a Vanilla JS purist in recent years as the ECMAScript standard has evolved.)

With React Native though, none of those points really matter and I'm able to enjoy the "breakthrough" of self-contained JavaScript components combined with super fast debug iterations. It's a win-win in my eyes.

Re:Introducing Create React Native App by spicyj on Tuesday March 14, 2017 @02:04AM (#13865382)
Curious: why is JSX on web worse than on native? And if you're overwhelmed by React "plugins", we certainly suggest you not use them. Most of them are just components you can write yourself.
Re:Introducing Create React Native App by traviswingo on Monday March 13, 2017 @05:26PM (#13862586)
Personally, for me, it comes down to trade-offs. How quickly do you want to be able to push changes? Do you want to hire a new developer for mobile, or have an existing developer plug away on the project? Are you building a game, or does your app require very low-level code control?

React native, Ionic, etc. are great for most apps out there. There is nothing special required to get a great app published in very little time, and existing developers can jump on the project and get it done - which probably results in much cheaper overhead for a startup. It really is a win-win.

The only reason I'd consider going full native these days is for mobile gaming, and anything requiring low-level control.

Re:Introducing Create React Native App by codazoda on Monday March 13, 2017 @05:38PM (#13862673)
I doubt the other languages are "dying off". Javascript isn't the most elegant language but it's certainly getting better with ES6.

I've been building a React Native app and there are a couple big positives for it.

l. All the web developers at my company can manage in JS. You don't need special talent or training like you do for the other languages. Our native apps are built by completely different teams because of their native skill sets.

2. The app we're building shares most of its code between iOS and Android. This prevents you from building the same app twice in two different languages (and as I pointed out, for us, in two different teams).

Re:Introducing Create React Native App by santaclaus on Monday March 13, 2017 @05:27PM (#13862592)
Swift and Obj-C are pretty high up in popularity rankings [1], and I imagine a majority of their use cases are mobile.

[1] http://www.tiobe.com/tiobe-index/

Re:Introducing Create React Native App by suyash on Monday March 13, 2017 @05:50PM (#13862777)
React Native is for JavaScript developers. Native development is for hard core native developer, totally separate audience.
Re:Introducing Create React Native App by htormey on Monday March 13, 2017 @06:46PM (#13863237)
I dunno, I'm a pretty hard core native developer (7 years mobile, mainly doing iOS) and I'm enjoying developing in React Native ;)

One of the reasons I like React Native a lot is because it makes it so easy to drop back to native code when I need to.

Re:Introducing Create React Native App by tootie on Monday March 13, 2017 @06:00PM (#13862870)
They're all app developers. If RN developers are cheaper and faster, then "hard core native developers" will go extinct pretty quickly.
Re:Introducing Create React Native App by teacup50 on Monday March 13, 2017 @06:46PM (#13863238)
Sit-down restaurants won't go out of business just because a McDonalds opens across the street.
Re:Introducing Create React Native App by cmoscoso on Monday March 13, 2017 @07:53PM (#13863705)
People cannot even develop a game with RN, so I would not count on that.
Re:Introducing Create React Native App by nikki93 on Monday March 13, 2017 @08:29PM (#13863893)
Not saying you can make hardcore things on it yet, but: https://github.com/exponent/floatyplane ;)

Expo includes a `GLView` component that provides a WebGL-like API to OpenGL ES. Things like three.js run on it directly! But CPU-side JavaScript becomes a bottleneck (the shaders themselves run at normal speeds).

Re:Introducing Create React Native App by pjmlp on Monday March 13, 2017 @06:34PM (#13863152)
Those web developers need someone to write plugins for them.

They will have a hard time if we become extinct.

Re:Introducing Create React Native App by tootie on Wednesday March 15, 2017 @09:12AM (#13875814)
You act like web developers are a lower class of human being. There are plenty of fullstack devs capable of writing Java/Swift/Obj-C but are just far more productive in a web stack. Plus the benefit of being cross-platform is a huge cost savings.