Live data from Hacker News

First Impressions Using React Native

jlongster.com

81–90 of 195 posts

Re: First Impressions Using React Native

#81
post #55
post #24

Earlier quoted context omitted.

I'm aware of these. But React gets all of the attention despite its warts like local component state or encouraging singletons for Flux.

Agree that singletons for Flux are bad, but they're totally not necessary (e.g. https://github.com/acdlite/flummox ). And if you don't like Flux, don't use it. I don't see how that's can be a demerit against React, since they're completely separate things.

React doesn't have a good pattern for passing information up the tree other than Flux. Prior to Flux they told everyone to pass functions through props which is fine up until a certain point but it doesn't scale to large apps. Flux does solve it, and is a generally good idea, but the singleton pattern breaks when applied to the server.

Re: First Impressions Using React Native

#82
OK, so how long before we backport the Android UI toolkit to WebGL using GWT and get rid of HTML and CSS altogether? Or even just write a sane new one?

Very interesting that this stuff comes from Facebook, who have very little concern about being indexable by search engines.

Re: First Impressions Using React Native

#83
post #69

I'm assuming React Native can load external JS files over the network? If that's the case, then I understand why Facebook is building this. They could have control of their application and behavior and make even more changes than before without re-submitting to the App Store.

Except, you know, the App Store rules explicitly forbid downloading new code over the network.

Re: First Impressions Using React Native

#84

Earlier quoted context omitted.

You are speaking my language! I would love to see a prototype of this. I've been thinking about it since I saw React Native. I wonder if there's even value in something like an asm.js-compiled layout system, which absolutely positions elements. One of the insights of React Native is that to build apps, we really only need a small subset of the web's layout algorithms. Only flexbox, really. So if we recognize this sub…

Me me! I'll be exploring this soon and I'm sure I'll reach out for help before I get too far. Could do a lot of stuff off thread, from data to layout calcs. My profile should have some info related to the hybrid stuff.

Very cool! I'll keep an eye on your work!

Re: First Impressions Using React Native

#85

The code style really reminds me of ExtJS circa 2.x (not sure what it's like now), which was pretty good at what it set out to do. However, React Native requires compiling down to various different platforms which means having to maintain multiple compatibility layers to continually shift to keep up with the native vendors. You're also pretty much stuck with proprietary distributors as well. Fun. Fun. This does look…

I suspect your perspective is a bit skewed as most companies are building native apps first and only doing a webapp when / if it becomes necessary. Native apps have won the this round and their momentum isn't slowing down. IIRC, Facebook is seeing 78% year over year growth on their mobile app, while desktop usage is declining. Instagram is another huge use-case where the web app is a second-class citizen.

Re: First Impressions Using React Native

#86

OK, so how long before we backport the Android UI toolkit to WebGL using GWT and get rid of HTML and CSS altogether? Or even just write a sane new one? Very interesting that this stuff comes from Facebook, who have very little concern about being indexable by search engines.

And yet React for Web browsers is the first framework in its class to do server-side rendering out of the box... a feature Facebook doesn't even use. Pretty funny.

Re: First Impressions Using React Native

#87

I love the concepts behind React, and I agree this is a huge deal...I just wish it weren't javascript. It is a terrible language, and the languages that compile to javascript are a poor substitute (bloated code sizes, interop issues, poor runtime performance, etc). For a framework that is all about state machines (a good thing! All UIs are state machines), I hate that there aren't better ways to model them in the lan…

> It is a terrible language As Douglass Crockford says, JS is a great language with some terrible parts. I don't understand why some people can't get past that.

Well, then. What about the language should make me think "wow, this actually is a great language"? And I mean the actual language itself, not the ecosystem around it.

Re: First Impressions Using React Native

#88
post #69

I'm assuming React Native can load external JS files over the network? If that's the case, then I understand why Facebook is building this. They could have control of their application and behavior and make even more changes than before without re-submitting to the App Store.

There's no technical reason it couldn't work, but we have no plans to load code over the network.

Re: First Impressions Using React Native

#89
post #60

I think it's a very strong point that moving script code off the main thread can help achieve smooth UIs. No more GC pauses, no more slowdowns if the JS engine hits a snag, etc. I think this is actually possible on the web as well. Someone could write a UI framework which runs JS in a Worker, and sends messages to the main thread, on which there is HTML and minimal JS to receive the messages and handle them. I'm surp…

> I'm surprised this hasn't been done, or has it and I just haven't heard about it?

N2O framework might do that.

https://github.com/5HT/n2o

Book:

https://synrc.com/apps/n2o/doc/book.pdf

One pattern you can do is send events to the server, server renders data asynchronously (maintains state for each client in a lightweight process), then ships result back to client via websocket binary frames.

You also decide how much rendering happens where. Can even do whole HTML elements on the server if you want.

Re: First Impressions Using React Native

#90
post #83
post #69

I'm assuming React Native can load external JS files over the network? If that's the case, then I understand why Facebook is building this. They could have control of their application and behavior and make even more changes than before without re-submitting to the App Store.

Except, you know, the App Store rules explicitly forbid downloading new code over the network.

Unless it's JavaScript.

...running in a WebView. So yes, RN apps will not enable this.

Post reply on HN