TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Deep Dive on React Native [video]

199 pointsby arasmussenover 10 years ago

21 comments

joemaller1over 10 years ago
I&#x27;m very excited about this, but can someone <i>please</i> write something down? The videos are nice an all, but information-wise they&#x27;re incredibly low-density. If I have an hour to spend on React Native, I&#x27;d rather read for 10 minutes and experiment for the remaining 50...
评论 #8972332 未加载
评论 #8972140 未加载
评论 #8971988 未加载
yazaddaruvalaover 10 years ago
I&#x27;m curious about animations. That is one thing React hasn&#x27;t <i>really</i> figured out on the web. I think the last experiment I saw was to do all the animations manually using component state. I wonder if this is the same on Native?<p>Ideally a cross pollination of ideas about animations would make both ecosystems better.
评论 #8972986 未加载
评论 #8971455 未加载
pavlovover 10 years ago
React Native is a cool project, but the deafening hype is slightly puzzling.<p>Creating and calling native UI components from JavaScript is nothing special in itself. It&#x27;s obviously possible to do it from JS just as well as from any other language -- you just need to provide the API. There you have two choices: either a bridge that translates the native API directly, or a wrapper class hierarchy.<p>Examples of bridges include Xamarin&#x27;s Mono that lets you build iOS user interfaces in C# code, and RubyMotion that lets you build Mac UIs in Ruby. Because these are bridges, the entire Cocoa API is exposed. The downside is that the bridge does nothing to smooth over platform differences: you can write in C# on all platforms, but you still have to learn Cocoa.<p>A prominent example of a wrapper API is Titanium Appcelerator that lets you build cross-platform mobile apps. Another good example is GTK+ for desktop apps: it&#x27;s smart enough to leverage native Windows components where possible, but the GTK+ API is higher level than that of native Win32.<p>React Native is primarily in the latter category. Based on jordwalke&#x27;s comment in another HN thread, they currently have cross-platform wrappers for View and Image:<p><a href="https://news.ycombinator.com/item?id=8965044" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8965044</a><p>But it appears you can also create platform-specific views, and for that they presumably have some kind of bridge. (It could also be that they provide manually written wrappers for platform-specific views, e.g. UIMapView becomes a &lt;Map&gt; and so on.)<p>In sum: React Native doesn&#x27;t magically translate your JS+HTML app into a cross-platform native app. They&#x27;re a long way off from having a full cross-platform API (unless your app is so simple that it can be described in terms of &lt;View&gt; and &lt;Image&gt;). And, like all wrapper APIs, there is a degree of impedance mismatch between the underlying platform implementation and the cross-platform interface on top.<p>There&#x27;s a lot to like about React Native, though. The layout model and binding logic seems cool. The React team&#x27;s accomplishments in the browser environment are impressive. With time, React Native could become for mobile what Qt is on the desktop -- and that&#x27;s high praise in my books.
评论 #8971288 未加载
评论 #8971252 未加载
评论 #8972209 未加载
评论 #8973122 未加载
评论 #8971132 未加载
jdubover 10 years ago
Keep in mind that this is <i>NOT</i> (primarily) about cross platform application development. As the developers say, &quot;Learn once, write anywhere&quot;.<p>It&#x27;s about building native applications in the React style (declarative, componentised), with very rapid turnaround because much of your logic and layout is defined in JavaScript. Instead of recompiling your app&#x27;s native code all the time, you&#x27;re just reloading JavaScript within it.<p>It&#x27;s possible that some components could be shared between platforms, but ultimately I think most of them will be different, reflecting the UI structure of the target environment. There&#x27;s probably more scope for sharing higher level non-UI-element components.
pmontraover 10 years ago
All of this looks great and I&#x27;ll give it a try as soon as I get some spare time, but there are a couple of things I didn&#x27;t understand.<p>1) Is this cross platform or are you still going to have separate code bases for the UIs of iOS and Android? Looking at the code in the demo there are components like View, Text and Image. As basic as they are, are they the same on iOS and Android (same behaviour, same arguments)? It was pretty clear from the first minutes of the video that View is build on top of the native view of iOS (he showed the objC code). Is that React code building for Android?<p>2) I guess that one must still be proficient in iOS and Android, unless they make the monumental job of rewriting all the iOS and Android documentation for the React components they implemented. I expect to have to reference the native docs to understand the meaning of the arguments and do the job of mapping React to native. That has always been a pain point in many UI abstraction layers.
评论 #8971432 未加载
评论 #8971409 未加载
评论 #8971121 未加载
lemmingover 10 years ago
This looks really nice. One question that I&#x27;ve found conflicting information about - is JavaScriptCore JITed on iOS 8? I know it isn&#x27;t on iOS 7 and earlier, my understanding was that it was on iOS 8 but it&#x27;s hard to find a definitive answer. Anyone know?
评论 #8970368 未加载
epagaover 10 years ago
The 5-minute demo at the end (22:24) is incredibly impressive: <a href="http://youtu.be/7rDsRXj9-cU?t=22m24s" rel="nofollow">http:&#x2F;&#x2F;youtu.be&#x2F;7rDsRXj9-cU?t=22m24s</a><p>That just seems SO much easier, quicker, and more efficient than storyboarding and coding UIViews. I am very much looking forward to being able to play around with this and discover downsides, because there have to be some...right?
m1elover 10 years ago
I see that they&#x27;re using display:flex for layout, for <i>all</i> elements, which makes things like inline styles impossible or extremely inconvenient.<p><a href="http://jsfiddle.net/u8wd8kdL/5/" rel="nofollow">http:&#x2F;&#x2F;jsfiddle.net&#x2F;u8wd8kdL&#x2F;5&#x2F;</a><p>If I am wrong, please provide me an example of how to layout that text with display:flex.
评论 #8975315 未加载
thoman23over 10 years ago
I&#x27;m definitely interested in seeing what React, and React Native, can do, but I have to say these people cheering like Ofrah just gave them a free car are kind of turning me off.<p>&quot;This is a native component&quot;. &quot;WOOOOOOOOH!!!&quot; &quot;YEAH!!&quot; &lt;high fives&gt;
评论 #8970562 未加载
wildpeaksover 10 years ago
They picked a great timing for the announcement because I needed to use native components with a React app, similar to how Ejecta (<a href="http://impactjs.com/ejecta" rel="nofollow">http:&#x2F;&#x2F;impactjs.com&#x2F;ejecta</a>) reimplemented the WebGL API to run js apps without DOM&#x2F;WebView) but had settled with Cordova plugins because it would have taken probably too long to implement otherwise, so I have high hopes for React Native :)
pj4533over 10 years ago
Since I already know ObjC &amp; Swift, the most interesting part of this is at 8:17. &quot;What if we could server-side run native apps? ...we could do it&quot;.<p>Hmmmm.<p>An interesting idea, however Apple might have something to say about that (App Store Review Guidelines):<p>2.7 Apps that download code in any way or form will be rejected<p>2.8 Apps that install or launch other executable code will be rejected<p>Still...I like the idea of pushing the boundaries of native iOS development.
评论 #8972188 未加载
评论 #8972256 未加载
评论 #8972194 未加载
pandeiroover 10 years ago
Has anyone who&#x27;s seen the actual code comment?<p>From what I understood on the video, this is going to be distributed via a repo that is essentially already an iOS or Android template?<p>There wasn&#x27;t much talk about the compilation process. Maybe the details (for the open source version) haven&#x27;t been ironed out?
oliyoungover 10 years ago
I&#x27;ve been down on &quot;cross platform native apps&quot; because they&#x27;re always the lowest common denominator of the language and platform, but this looks intriguing.
JamesSwiftover 10 years ago
The next logical step here is that this gets wrapped by an Om-like and then we are writing native apps in clojure! That is pretty exciting to me.
lynndylanhurleyover 10 years ago
The one thing that&#x27;s prevented me from using flex-box is browser support.<p>Because flex-box has been re-implemented in JS, does this mean that the css-layout project [1] will provide flex-box support for older browsers?<p>I looked, but I couldn&#x27;t find a &quot;compatibility&quot; section anywhere in the repo.<p>[1] <a href="https://github.com/facebook/css-layout" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;facebook&#x2F;css-layout</a>
评论 #8970568 未加载
评论 #8970715 未加载
mandeepjover 10 years ago
<a href="https://www.infinum.co/the-capsized-eight/articles/running-javascript-in-an-ios-application-with-javascriptcore" rel="nofollow">https:&#x2F;&#x2F;www.infinum.co&#x2F;the-capsized-eight&#x2F;articles&#x2F;running-j...</a><p>This article have lot of details about how JS is getting executed on the Native platform. Lot of components are provided by Apple like JS VM
boholover 10 years ago
I get that people are excited, but it seems like time and time again these abstractions fail to solve the underlying problems.<p>It&#x27;s like how we never got a fix for making cross platform applications. And regardless how much people wants the new way of doing things to work, the results speak for themselves. Atom, the editor, can&#x27;t even handle window re-sizing smoothly.
评论 #8971234 未加载
gosia-mover 10 years ago
Seems like the time has come for the synergy of native + JavaScript. React.js are not the only ones working on it... Tabris.js works on a similar principle (combine the best of native and web) and offers features like instant debugging of JavaScript on your device. It&#x27;s currently invite only.
Nilzorover 10 years ago
I&#x27;m not sure I got how the Javascript code executing? For the case of Android, is the library spinning up a WebView to get access to the V8 engine?
评论 #8971367 未加载
bsaulover 10 years ago
i&#x27;m not using react for the web so maybe this is a silly question, but how do you pass data from your obj-c controllers ( or any native object) to those reactjs views ?<p>Also, the constraint solver could be a good riddance but is there going to be any support for uikit dynamics ?
morenoh149over 10 years ago
This looks really exciting. The fast code edit to relanch time is a really big deal to me.