Live data from Hacker News

First Impressions Using React Native

jlongster.com

151–160 of 195 posts

Re: First Impressions Using React Native

#151

Earlier quoted context omitted.

Sweet. I'll watch out for wherever you guys end up. Might be worth reading one of the react native devs about why animations might still be hard: http://jlongster.com/First-Impressions-using-React-Native#co... This idea is also why I hooked up the css-layout project ( https://github.com/facebook/css-layout ) to a live demo to play around with: http://layout.jlongster.com/

Yes, in browsers, JS animations are still hard (I might even say impossible to do well for large apps with a lot going on). One anecdote: I spent a month trying to build a 60fps scrolling list view in JS from scratch (JS driving all the animations). No matter how hard I tried, I couldn't make it work on the web. I believe it was image decoding interfering but it's difficult to say why. Then I took that same example,…

Interestingly, this comment, while probably being of the most technical detail / value in the thread, was downvoted by someone :)

Re: First Impressions Using React Native

#152

Declarative UI is boss. I know Andy (former UIKit team) was quoted in the intro thread but I'll do it again: >I say with confidence as a former UIKit author: React's model for the UI layer is vastly better than UIKit's. React Native is a huge deal. https://twitter.com/andy_matuschak/status/560511204867575808 If you're averse to React because of JSX, “mixing templates and views” and similar superficial “best practices…

JSX mixing presentation logic and views seems to me like they have reinvented PHP. PHP is derided for this, but also for it's shaky implementation and semantics. JSX seems like Good PHP and that's a big deal because PHP is wildly successful despite being awful.

Re: First Impressions Using React Native

#153

Earlier quoted context omitted.

Sweet. I'll watch out for wherever you guys end up. Might be worth reading one of the react native devs about why animations might still be hard: http://jlongster.com/First-Impressions-using-React-Native#co... This idea is also why I hooked up the css-layout project ( https://github.com/facebook/css-layout ) to a live demo to play around with: http://layout.jlongster.com/

Yes, in browsers, JS animations are still hard (I might even say impossible to do well for large apps with a lot going on). One anecdote: I spent a month trying to build a 60fps scrolling list view in JS from scratch (JS driving all the animations). No matter how hard I tried, I couldn't make it work on the web. I believe it was image decoding interfering but it's difficult to say why. Then I took that same example,…

what's wrong with -webkit-overflow-scrolling: touch? doing scrolling in js is so last year.

Re: First Impressions Using React Native

#155

Earlier quoted context omitted.

I've been thinking about this as well yesterday, but to be honest I'm not sure where the benefits are. In theory the browser is doing the rendering in a separate thread anyway, i.e. CSS layout and things like scrolling are handled by the browser. If you're doing a long algorithmic (CPU-intensive) computation in JS then you should probably do that in a WebWorker anyway. Otherwise I'm not sure the overhead is worth it,…

Exactly. I think moving everything but React into the web worker is enough. But that itself isn't easy as far as my limited knowledge, you need to have separate script files. Perhaps a webpack plugin that manages that for you?

I think simply moving any function that takes more than 10ms to a web worker is enough frankly.

Re: First Impressions Using React Native

#156
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…

Someday you'd think they might just go ahead and add multi-threading, shared memory to Javascript? It is definitely a can of worms, but the current web worker situation is just not workable for many use cases.

WPF has a UI and a separate closed off rendering thread, which works quite well performance wise.

Re: First Impressions Using React Native

#157

Earlier quoted context omitted.

MS have been doing declarative UIs for literally 8 years (XAML).

That isn't declarative in the same way... that's markup. The kind of declarative that is used in React is more like functional programs. You write programs, using actual code, that compute ("declare") exactly what the UI should look like from top to bottom, given each possible input. This is in contrast to a model where you mutate an existing UI model each time something interesting happens.

Declarative is a vacuous word that means anything you want it to depending on context. We used to call functional programming "functional" and logic programming languages like Prolog "declarative." Then declarative started meaning markup, then declarative started meaning...immutable functional code? In PL, we mostly just avoid the word altogether these days since everyone has a different idea about what it means.

React is closer to an immediate-mode UI model: you write programs that compute exactly what the UI should look like on each frame, rather than mutating a scene graph each time something interesting happens (as occurs in retained-mode UI models). Substitute DOM for scene graph, and the distinction might hold.

But I'm not sure.

Re: First Impressions Using React Native

#158
post #47

Earlier quoted context omitted.

The other libraries intentionally left out shouldComponentUpdate because they don't think it's something a developer should have to worry about. I don't know of any evidence to suggest that React is faster because of this feature. And declarative nesting is a feature of all of the frameworks I've come across, I'm not sure why you think that's unique to React. The advantage feature I would credit React for is the size…

>declarative nesting is a feature of all of the frameworks I've come across, I'm not sure why you think that's unique to React Declarative nesting of lifecycle-ful and stateful components without going full FRP. I'm actually excited to learn about other frameworks that do this! Which do you have in mind?

WPF (even completely ignoring XAML), JavaFX both support declarative nesting with interesting databinding features to support it. They are based on retained scene graphs, however.

If you are interested in academics, I published such a system at ECOOP in 2006:

http://research.microsoft.com/pubs/179366/mcdirmid06superglu...

Re: First Impressions Using React Native

#159

Earlier quoted context omitted.

Yes, in browsers, JS animations are still hard (I might even say impossible to do well for large apps with a lot going on). One anecdote: I spent a month trying to build a 60fps scrolling list view in JS from scratch (JS driving all the animations). No matter how hard I tried, I couldn't make it work on the web. I believe it was image decoding interfering but it's difficult to say why. Then I took that same example,…

what's wrong with -webkit-overflow-scrolling: touch? doing scrolling in js is so last year.

You can't build the equivalent of UITableView (which is a very important component in almost any iOS app) without frame-by-frame scroll events.

Re: First Impressions Using React Native

#160
post #135

Earlier quoted context omitted.

You're really just complaining about the phrasing of it and saying that it should have been worded in a mealy-mouthed way. That's silly, it's just an expression of an opinion.

This is absurd. Are you serious? The way you express your opinions is enormously important. It could easily be the difference between getting a raise and getting fired. Expressing your opinions in a way makes sense to other people and they take well to is the farthest thing from silly ever, it's like a #1 essential skill for life. On top of that, phrasing informs the message, and in this case I was not just complaini…

> React is the best way to build all apps no matter what

When you alter a quote, you're only illustrating your own bias, not that of the author.

Post reply on HN