Live data from Hacker News

Use ReactJS to Build Native Apps

twitter.com

81–90 of 175 posts

Re: Use ReactJS to Build Native Apps

#83

Hi, I'm Jordan from the React team. I'm happy to answer any questions about React Native, but @vjeux will be giving a more thorough talk tomorrow that you won't want to miss (if you're at ReactJSConf), so I might wait for him to answer some of them. This is not the DOM. This is not a web view. If you know ReactJS, you can build native apps with React Native.

There will be more detail tomorrow, but at a high level: * JS engine on a background thread * Communicates via batched, async messaging protocol to a native (objc or android) server running on the main thread (basically create_view(), update_view(), destroy_view(), on_event() etc) * Plug-in for React that speaks that protocol * Tools to make cross-platform dev a bit easier (standard text component, cross-platform fle…

ha "NOT be the next Java Swing"

TBH, I don't use React right now but this is a game changer.

Re: Use ReactJS to Build Native Apps

#84
post #72

Earlier quoted context omitted.

There will be more detail tomorrow, but at a high level: * JS engine on a background thread * Communicates via batched, async messaging protocol to a native (objc or android) server running on the main thread (basically create_view(), update_view(), destroy_view(), on_event() etc) * Plug-in for React that speaks that protocol * Tools to make cross-platform dev a bit easier (standard text component, cross-platform fle…

How does it compare to Appcelerator Titanium? That's also a JavaScript-to-native-UI layer utilizing a JS runtime. http://www.appcelerator.com/titanium/ I know one complaint among many was that wrapping native API in a new framework can limit access to functionality and customization; you're limited to the choices of the framework designer. Another is debugging is harder since native tools don't understand the framewo…

That’s why they (Appcelerator) have a pretty solid but not well documented plugin infrastructure. At the same time they are moving to a more native-friendly infrastructure, code-named Hyperloop.

Re: Use ReactJS to Build Native Apps

#86
post #64

Earlier quoted context omitted.

There will be more detail tomorrow, but at a high level: * JS engine on a background thread * Communicates via batched, async messaging protocol to a native (objc or android) server running on the main thread (basically create_view(), update_view(), destroy_view(), on_event() etc) * Plug-in for React that speaks that protocol * Tools to make cross-platform dev a bit easier (standard text component, cross-platform fle…

Please, please have constraint-based layout support- I know you want to have it, given your work on react-gss :-)

Given the presence of https://github.com/facebook/css-layout it will probably flex-based. Not cool as a constraint based layout but good enough for easier portability of knowledge.

Re: Use ReactJS to Build Native Apps

#87
post #58

Earlier quoted context omitted.

Can you let us know a bit more about what this is? Native to what? Android / iOS? Desktops? Does it allow you to render native components with JSX as opposed to only DOM elements? Can you mix the two, somehow?

iOS and android right now. And yes, native components can be rendered directly with JSX. And you won't need to mix with DOM. For example doesn't mean anything on iOS.

[deleted]

Re: Use ReactJS to Build Native Apps

#88
post #58

Earlier quoted context omitted.

Can you let us know a bit more about what this is? Native to what? Android / iOS? Desktops? Does it allow you to render native components with JSX as opposed to only DOM elements? Can you mix the two, somehow?

iOS and android right now. And yes, native components can be rendered directly with JSX. And you won't need to mix with DOM. For example doesn't mean anything on iOS.

[deleted]

Re: Use ReactJS to Build Native Apps

#89
post #75

Hi, I'm just reading through the ReactJS docs for the first time, and I found something peculiar. Let me explain. So, as I understand ReactJS invokes a render() method defined by the user (programmer), and the result of that is diff'ed to previous results of the same method, and as a result, the DOM is modified. I can understand this, but... The DOM is already incrementally rendered by the browser. That is, changes t…

There are added benefits for an immutable / FRP style of building a UI, but I think you're more interested in the rest of my answer.

Nothing to be confused about, you have a valid hypothesis: "Rendering and Diffing in Javascript is slower than DOM manipulation". However, all hypothesis need to be experimented before having any real meaning.

It just happens that testing this hypothesis and finding it invalid was the foundation for React.

Watch this video[https://www.youtube.com/watch?v=XxVg_s8xAms] I think it does a good job discussing this hypothesis and why they chose not to worry about it.

Re: Use ReactJS to Build Native Apps

#90

Earlier quoted context omitted.

ahem. my bet - https://github.com/facebook/css-layout cannot wait for more details.

Seems like you won the pot. @vjeux will be giving a bigger talk about it tomorrow and he's the biggest contributor to the css project ( https://github.com/facebook/css-layout/graphs/contributors ).

relevant talk by @vjeux: https://speakerdeck.com/vjeux/react-css-in-js
Post reply on HN