Slashdot Mirror


Facebook Brings React Native To Native Mobile Development

the_insult_dog writes Despite a lack of dev tools, samples, tutorials, documentation or even a blog post or press release, Facebook's announcement that it's bringing the popular React.js JavaScript library to iOS and Android native mobile development stirred up comments like "groundbreaking" and "game changing." In a series of videos from the recent React.js Conference 2015, Facebook engineers said they're rejecting the "write-once, run-anywhere pipe dream" in favor of a "learn-once, write-anywhere" paradigm. All efforts to duplicate native performance and look-and-feel actually feel like "s__t", an engineer said in explaining the company's new approach to native development in a conference keynote video. Yet to be proven, with tools in the works, it's supposedly a huge success internally at Facebook and experts said the new approach could shake up the whole mobile dev industry.

49 of 78 comments (clear)

  1. Hype by Dan+East · · Score: 2, Informative

    Hype much? If your JavaScript isn't portable enough to run on a modern mobile browser than you suck. The fact that they can make something happen that is supposed to happen by default doesn't exactly excite me.

    --
    Better known as 318230.
    1. Re:Hype by Anonymous Coward · · Score: 1

      You both missed the point. It's more about porting facebook's react framework to iOS and Android so no matter what language you are writing in, you will have a familiar framework to work in.

    2. Re:Hype by msobkow · · Score: 2

      I thought Apple specifically banned interpretive languages for iOS, such as Java. If it were merely a matter of compiling to the target machine, there are many which could have done so for deploying Java code on iOS with a little bit of porting.

      --
      I do not fail; I succeed at finding out what does not work.
    3. Re:Hype by gstoddart · · Score: 4, Funny

      I thought Apple specifically banned interpretive languages for iOS

      LOL, I hope you meant "interpreted".

      Otherwise all I get is "this code symbolizes the despair and longing of the programmer".

      --
      Lost at C:>. Found at C.
    4. Re:Hype by Em+Adespoton · · Score: 1

      They did... and then a few years back they changed their minds, after Java was no longer an issue. As such, there are cross-compiled .Net/Mono apps on iOS now.

      But besides that, this is a case of Facebook creating an iOS-specific library that implements React.js in native code -- so by the time the binary hits the App store, there's no interpretation going on. I'd call that an improvement, myself.

    5. Re:Hype by Anonymous Coward · · Score: 2, Funny

      Otherwise all I get is "this code symbolizes the despair and longing of the programmer".

      That applies to all of my code!

    6. Re:Hype by sribe · · Score: 1

      I thought Apple specifically banned interpretive languages for iOS...

      Not exactly. They ban downloading and interpreting code in anything except the Javascript interpreter which they provide. So there is exactly one option for interpreting code--the one over which they have control for security issues.

    7. Re:Hype by mikecase · · Score: 1

      I think you meant "the one over which they have control for profit issues"

    8. Re:Hype by sribe · · Score: 1

      I think you meant "the one over which they have control for profit issues"

      Really. Explain exactly how disallowing alternative interpreters increases their profit.

    9. Re:Hype by flopsquad · · Score: 2

      No, all three of you missed the point.

      "Facebook engineers" are "game changing" the game by "rejecting" the "paradigm" that is "popular" (they're closing Facebook), instead embracing a "yet to be proven" "new approach" where your "pipe dreams" "look and feel like s__t " (unclear, they probably mean 'shat', which is short for William Shattner, who will buy the empty husk of Facebook and fold it into the Priceline Syndicate).

      Focusing on a "groundbreaking" new business model, they'll be "approaching natives" (aboriginal peoples) with "samples and tutorials" that will give them "huge success internally" (Levitra and a lesson on handjobs). This new approach will definitely get the natives "stirred up", but will ultimately cause them to "React" poorly (an erection lasting more than four hours).

      See how easy that was?

      --
      Nothing posted to /. has ever been legal advice, including this.
    10. Re:Hype by Sudline · · Score: 1

      That is a moving target!

    11. Re:Hype by something_wicked_thi · · Score: 1

      Are you certain there was a point to be missed? I'm not entirely sure there was.

    12. Re:Hype by msobkow · · Score: 1

      SNL Sprockets: "Enough coding! Now we dance!" :P :P :P

      --
      I do not fail; I succeed at finding out what does not work.
    13. Re:Hype by gbjbaanb · · Score: 1

      Really?
      I know mono can produce real native machine code - no VM or such involved, not like Microsoft's ngen that only pre-JITs.

      If they have JS compiled to native code too, then that might be interesting.

    14. Re:Hype by flopsquad · · Score: 1

      Oblig Bash.

      --
      Nothing posted to /. has ever been legal advice, including this.
    15. Re:Hype by omfgnosis · · Score: 1

      All code symbolizes the despair and longing of the programmer.

    16. Re:Hype by omfgnosis · · Score: 1

      Yeah, insofar as interpreted code may present a way to escape sandboxing, which in turn could lead to security problems, which in turn could lead to plummeting profits.

  2. Judging by .. by Anonymous Coward · · Score: 2, Insightful

    Judging by the Facebook App. This react is a piece of shit. Just use Objective C or Swift and stop wasting everyones time.

  3. I have a dream ... by farble1670 · · Score: 4, Informative

    Facebook engineers said they're rejecting the "write-once, run-anywhere pipe dream" in favor of a "learn-once, write-anywhere" paradigm

    I'm sure that is Facebook's dream: an oversupply of software developers with the skills required for employment at Facebook.

    1. Re:I have a dream ... by Anonymous Coward · · Score: 1

      Nah, I think they're saying learn one framework and code using that framework everywhere. Basically the same as write-once, run-anywhere except you'll have more code duplication.

      And they're talking about trying to manually make web page controls (like buttons) look exactly like the OS' buttons. I'm not a web developer. Why don't browsers handle that with a button tag? Why does every website need to recreate all the basic controls? As an desktop application developer, the web seems so bad in every way to me. Its learned nothing from the desktop and is instead recreating every mistake possible but calling them all new, never before seen features! Yawn. Let me know when a website can make a resizable spreadsheet with editable cells, sortable columns, resizable rows and columns, and lets you move the columns around in less than around 20 lines of code (ignoring boarder plate code). You can do that in Java (with the addition of one 3rd party library). Doesn't the JVM use native widgets on some OSes if you ask it to too?

    2. Re:I have a dream ... by gstoddart · · Score: 1

      You know what I suspect the other part of this dream is?

      Ensuring there's a library of tools which will have code embedded in to to have every app phone home to Facebook and violate your privacy.

      There is no way in hell Facebook is writing any tool which doesn't benefit them ... which means by default I'm sure it will be set to call home to Facebook, and it would take lots of effort by developers to disable that.

      Sorry, no, but apps which want to integrate with Facebook are annoying ... no, I do not wish to share this shit online, and if I have a Facebook account, it's none of your damned business.

      Annoyingly, most mobile apps are just vehicles to sell ads, and integrate with social media.

      --
      Lost at C:>. Found at C.
    3. Re:I have a dream ... by SQLGuru · · Score: 2

      It's less of an issue of recreating all of the "basic" controls and more a factor of every single designer wants to style buttons differently. You either buy into the native aesthetics or you don't complain when you don't have a native experience.

    4. Re:I have a dream ... by jdeisenberg · · Score: 1

      On what basis do you conclude that "phone home" code will be included, and that it will be difficult to remove? Does the current React.js include such code? If not, is there a reason to believe it would be included on the React native? As per TFA, Facebook did write it to benefit themselves, but that certainly doesn't mean it is useful only to them.

    5. Re:I have a dream ... by gstoddart · · Score: 1, Insightful

      On what basis do you conclude that "phone home" code will be included

      Because Zuckerberg and Facebook are greedy douchebags who want the marketing/personal information?

      Does the current React.js include such code?

      Irrelevant, this is a binary, which means you don't really know everything it does.

      As per TFA, Facebook did write it to benefit themselves, but that certainly doesn't mean it is useful only to them.

      My inherent distrust of Facebook says it will be self-serving library -- because that's kind of what they do.

      Maybe I'm wrong. Maybe I need to up my meds. Maybe I should apply another layer of tinfoil.

      But I trust Facebook as far as I can throw Zuckerberg off a roof ... and so far they've not allowed me to throw him off a roof, so I just assume I can't trust them at all.

      --
      Lost at C:>. Found at C.
    6. Re:I have a dream ... by phantomfive · · Score: 1

      The "learn-once, write-anywhere" paradigm is overrated. How hard is it to learn Java for Android, or Objective-C for iOS? If it takes any significant amount of time compared to the total time building the project, then you don't have a very complicated project.

      Seriously, for shared code, make a C library and it'll run on both Android and iOS. Problem solved. Mobile programmers have been doing this for years.

      --
      "First they came for the slanderers and i said nothing."
    7. Re:I have a dream ... by farble1670 · · Score: 1

      The "learn-once, write-anywhere" paradigm is overrated. How hard is it to learn Java for Android, or Objective-C for iOS?

      Well i agree in principle, I've seen Java written by C developers, and Python written by Java developers. There's definitely a knack for doing something in clean way in each language.

      Seriously, for shared code, make a C library and it'll run on both Android and iOS. Problem solved. Mobile programmers have been doing this for years.

      really?

      IMHO, the amount of actual platform-agnostic code is very, very small. for example, you may have to interface w/ location services on both platforms, but the way you go about it is going to very different.

    8. Re:I have a dream ... by phantomfive · · Score: 1

      really?

      Yeah, it's a common strategy. The only thing that remains will be UI code, which is a small part of the application unless it's a trivial application. If it's a trivial application, it doesn't matter what strategy you use, because you can rewrite the whole thing for either platform fairly quickly.

      Incidentally, there are some really nice HTML5 apps out there too. The fact that Facebook couldn't get theirs to work is more a reflection on Facebook than on the technology.

      --
      "First they came for the slanderers and i said nothing."
    9. Re:I have a dream ... by farble1670 · · Score: 1

      Yeah, it's a common strategy.

      It's a common fantasy. It's why things like PhoneGap exist.

      Mobile apps aren't just UI code and generic business logic. The platform provides everything: bluetooth, location, account management, database tools, patterns for background tasks and database access, camera, graphics tools ... and the list goes on and on. All of these things are specific to the platform. You can generalize them w/ abstractions, but that's a massive, massive effort and is obviously a very different approach than a shared library.

    10. Re:I have a dream ... by phantomfive · · Score: 1

      It's a common fantasy. It's why things like PhoneGap exist.

      OK, so you don't do it lol.

      btw, if you're really having trouble with your developers writing lousy objective-C code, send them to bignerdranch for training, and they'll be writing above average Objective-C code after a week.

      If a week seems like too big of an investment, then once again, you're not building any kind of substantial app anyway, so it doesn't matter.

      --
      "First they came for the slanderers and i said nothing."
    11. Re:I have a dream ... by farble1670 · · Score: 1

      OK, so you don't do it lol.

      no, it's not done, for the reasons i already stated. lol back at you friend. i'm talking Android and iOS which is what matters.

      but hey, don't take my word for it. go and write a simple app that gets the users' location and displays it on a map. see how much you can factor into a shared library. the average app isn't a bunch of generic number crunching algorithms. it's platform specific code. it's interfacing with the file system, maps, databases, keystores, bluetooth, location, and so on. none of that can be shared because the API for using it isn't common across the platform.

      and to your point of if it's a simple app then don't bother, i'd say if you *can't* do it for even a simple app, then it sort of indicates a problem in the plan.

    12. Re:I have a dream ... by phantomfive · · Score: 1

      no, it's not done, for the reasons i already stated.

      You're wrong, and here is the reason I will give you: I've seen it done. There it is, all your hypothetical reasons proven wrong because of data.

      --
      "First they came for the slanderers and i said nothing."
    13. Re:I have a dream ... by farble1670 · · Score: 1

      You're wrong, and here is the reason I will give you: I've seen it done. There it is, all your hypothetical reasons proven wrong because of data.

      you clearly have no specific domain knowledge on this or you'd be giving examples. i suspect when you do give example, you are going to point out sharing of some math libraries or something similarly platform-inspecific, or sharing across mobile platforms that are based on similar architectures.

      i'm talking iOS and Android, which is really what matters here.

    14. Re:I have a dream ... by phantomfive · · Score: 1

      you clearly have no specific domain knowledge on this or you'd be giving examples.

      ROTFL no doubt I don't.

      i'm talking iOS and Android, which is really what matters here.

      Oh really? And here I thought we were talking about popcorn.

      --
      "First they came for the slanderers and i said nothing."
    15. Re:I have a dream ... by BasilBrush · · Score: 1

      It's done in specific circumstances, such as games, where there's a lot of logic that is platform independent. But for most mobile apps other than games, it's more talked about than actually done. For exactly the reason the OP suggests.

  4. Hype by Anonymous Coward · · Score: 4, Interesting

    I think you missed the point. The article is talking about running javascript without the browser layer (i.e, "native" on the OS) and getting better performance out of it. This has nothing to do with javascript browser compatibility.

  5. Write Once Run Anywhere Can Work by VernonNemitz · · Score: 1

    If the code is written in JavaScript, and if "anywhere" involves a compiler, not just an interpreter, then the performance of the software should be nearly optimal anywhere. And, somewhere along the years, I got the impression that JavaScript compilers were becoming rather popular. I might be mistaken about that, but the notion should still be true, that if every platform included a JavaScript compiler, write-once/run-anywhere could work.

    1. Re:Write Once Run Anywhere Can Work by RingDev · · Score: 1

      My understanding in this case (which may be incorrect) is that they are doing OS specific versions of React.js to allow them to take advantage of different OS optimizations.

      For anyone leveraging React.js, it would still be write-once/run-anywhere assuming that those developers do not also intend to leverage OS optimizations. Or, if they are intending on switching languages/platforms, the port would be significantly easier because even though the code in React changes based on OS, the API remains the same.

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    2. Re:Write Once Run Anywhere Can Work by omfgnosis · · Score: 1

      If you use a strict subset with a defined API, it can be close to native performance. This has been seen with asm.js already. It may be that specific domain logic suffers, because that will likely break the boundaries of "strict subset" for a framework like React, but that is going to be a smell in GUI code no matter what your environment.

  6. Uh huh. by Anonymous Coward · · Score: 1

    I'm still baffled at how piss-poor Facebook's apps are. I think it's less a "pipe dream" in general and more a "pipe dream" for them in particular. They need to stop pretending everyone else is at fault and smell the coffee - you guys suck, not the tools you're complaining about. Your fault if you gave up on them, if you couldn't get such a simple service working in a browser. Stop bolting on extra shit before you get your core app right, that's the lesson to take home here. If I can write a cross-platform, cross-browser, multi-resolution app UI which many actual workers don't complain about, you should be able to get your glorified yearbook-with-distractions working for people who just want a pretty UI instead of a functional one. Stop bitchin' already and do your jobs.

  7. Interesting... but by slashdice · · Score: 2, Funny

    It's interesting technology (both react and react native). But the javascript ecosystem and tooling is a bag of shit. People put up with it on the web because you don't have a choice. The only reasonable explanation for node.js to exist is that some people are too stupid to learn php. javascript on the server or desktop or pocket is a massive step backwards. But this caters to people who are too stupid to understand that so I'm sure it will be wild success. Sometimes I think intel is bankrolling the javascript hype to sell faster processors to compensate for slower and dumber code. I also wonder if wonder if wearing skinny jeans causes mind-numbing crotch pain to the point that, relatively speaking, javascript is a pleasure to use.

    --
    Copyright (c) 1990 - 2014 Dice. All rights reserved. Use of this comment is subject to certain Terms and Conditions.
  8. Definitely hype by gabereiser · · Score: 1

    I used React.js, then I dropped it in favor of html, because after all, html is how you build UI in... ...html. Sure I use templates, I use client-side javascript view-model binding, but I found React.js over engineered and not worth using. To me it's always screamed "flavor of the month" against other, more mature javascript libraries like Backbone and Ember. But to each their own I guess.

    1. Re:Definitely hype by Shados · · Score: 2

      Backbone is a piece of shit. It had its time of glory, for like... 6 months. It has so many problems and design flaws, its ridiculous.

      That said that isn't the point of React. If you want easy to use/maintain...yeah, you can use it, but there are significantly better libraries for that. The point of React is to generate the most efficient UI update batch job possible whenever you change your state, because if you do it yourself, either you'll end up with a totally absurd amount of code, or you'll do it in a sub optimal way. It also lets you use the same code to render the initial load on the server for deep linking and SEO purpose.

      So basically React has the sweet spot between performance and maintainability. Most apps don't need that performance. If you just have a bunch of forms, a few menus, a couple of charts...whatever. Netflix was bragging on their blog about how awesome React was to them. You can look at their UI...it isn't a case where React was necessary. If they like it, sure, no problem, but it was just 1 of dozens of options that would have worked for them.

      When you have a single page app with lots of interrelated dynamic updates happening constantly, then React is a good fit. Shit like Angular or Ember (even with htmlbar) go to a crawl in these scenarios no matter how good your code, and Backbone requires you to micro-manage your code like crazy.

    2. Re:Definitely hype by gabereiser · · Score: 1

      Except react's update tree is WAY MORE than something like knockout.js or others. Hell, even Angular.js is better. So don't give me that crap about all that complexity being for performance, because it's not, I've benchmarked it.

    3. Re: Definitely hype by gabereiser · · Score: 1

      I agree, backbone has worked well for me for a while now. I use what I need (controllers, views, models) and leave what I don't (routes). I use underscore templates for the views, and compress all that shit down to like 200kb. Which is still a lot. I'm so sick of page bloat that I fundamentally go out of my way to criticize people who think 1mb page loads are ok.

  9. Difference between what exists? by SuperKendall · · Score: 1

    There's already a ReactiveCocoa, I wonder how the Facebook framework differs? Apart from being able to be used cross platform that is...

    The cross platform stuff I try off and on through the years, but it always leaves be cold compared to whatever tools exist specifically for each platform.

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
  10. Everybody wants your phone number by Trax3001BBS · · Score: 1

    Search engine wise, it's innocent enough, to prove your account; I've yet to give it to any of them.

    I read an article that said Facebook wanted into the mobile market, well here they are.

  11. As long as I can... by s.petry · · Score: 1

    Block JavaScript from unwanted sources like Facebook I don't care what they do!

    --

    -The wise argue that there are few absolutes, the fool argues that there are no probabilities.

  12. Re:That's unpossible by omfgnosis · · Score: 1

    React isn't a standard, it's a GUI framework. They're proposing compatibility layers for other GUI frameworks on other platforms, with no intention of replacing those other frameworks. Of course it's possible, because other such compatibility frameworks are available and quite successful. What React offers that the others do not is that the development environment is familiar to web developers.

  13. Wrong article title by thisisauniqueid · · Score: 1

    This article should be entitled "Will Facebook's Reactive Native shake up the whole mobile industry?". This story is in need of a textbook application of Betteridge's Law.