12 ms·
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
by jordwalke 12y ago
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.
- Feeble 12y agoHi Jordan, when you say native apps what platform(s) will it be possible to target? E.g. windows, osx, ios, android etc?
- arasmussen 12y agoWe're currently working on just iOS and Android.
- mcjiggerlog 12y agoCan 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?
- zpao 12y agoiOS and android right now. And yes, native components can be rendered directly with JSX. And you won't need to mix with DOM. <h2> For example doesn't mean anything on iOS.
- deleted 12y ago[deleted]
- deleted 12y ago[deleted]
- jordwalke 12y agoReact has, from day one, sought to liberate itself from the underlying low level building blocks of a particular environment. There were always good reasons to so (normalizing browser inconsistencies etc). There is another benefit of the specific way in which we've built this library level layer of abstraction - we've formed a serializable boundary that allows vanilla React to sit on one side, and any set of lower level building blocks on the other. Before today, we simply had the DOM renderers sitting on the other side of that boundary. React Native replaces the DOM renderers with native renderers which allows people to render platform <View>/<ScrollView>/<NativeWhatever> instead of <div>/<span>. Other than that, you get to use the exact same React API that you already know (even down to the event bubbling). You can bridge to things that are only available on the platform, and can in general make higher performance granular building blocks that cannot be accomplished with web technology (such as <Image> components that decode images more efficiently or with different concurrency models). As with everything, JSX is not required to take advantage of this - and you can use any of the compile-to-js languages that you use with React today.
- danabramov 12y agoDoes it run using JavaScriptCore? Can we implement something like Hot Module Replacement a la react-hot-loader[1] for it? I dreaded my Xamarin build times.. [1]: http://gaearon.github.io/react-hot-loader/ http://gaearon.github.io/react-hot-loader/
- spicyj 12y agoYes, that should be possible – it loads JS packages from a custom server right now but there's no reason it can't use Webpack. You'll be able to reload immediately (without recompiling) already by pressing Cmd-R in the simulator.
- danabramov 12y agoOh that's sooooo great. Thank you.
- peterhunt 12y agoThere 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 flexbox layout system) * Designed to take advantage of native platform views, NOT be the next Java Swing
- josebalius 12y agoCannot wait!
- phoenixbox 12y agoBananas
- bceagle 12y agoSo it won't actually use web views? Interesting.
- drcode 12y agoPlease, please have constraint-based layout support- I know you want to have it, given your work on react-gss :-)
- yuchi 12y agoGiven the presence of https://github.com/facebook/css-layout 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.
- drcode 12y agoCan I create the largest possible square div in a rectangular div with this library? That is my standard test as to whether a layout framework is advanced enough to meet my basic needs. (vanilla CSS fails this test of course, even with the most recent extensions, AFAIK)
- thramp 12y agoHow does it compare to AsyncDisplayKit?
- dkasper 12y agoAccording to FB it is conceptually a continuation of AsyncDisplayKit https://twitter.com/fbOpenSource/status/560512580326674432 https://twitter.com/fbOpenSource/status/560512580326674432
- peterhunt 12y agoI believe AsyncDisplayKit is a dependency of the iOS plugin for React Native.
- arasmussen 12y agoReact Native uses similar principles of AsyncDisplayKit (doing as much work as possible on a background thread and only doing what we absolutely need to on the main/UI thread) but does not depend on AsyncDisplayKit.
- mrdrozdov 12y agoIs there sample code? Will this be open sourced?
- kcorbitt 12y agoI know it's a bit of an orthogonal concern, but will this project provide a way to style native apps using web technologies (e.g. CSS) as well? I'm very excited about building native apps with React, and would be even more so if I could also leave behind the very-poorly-designed Android style primitives.
- peterhunt 12y agoYes, a subset of CSS was ported
- dengar007 12y agoI'm not at the conference and haven't had a chance to read too much into this yet (so if the answer is just wait you'll see that's good :D) Can I use the same kind of jsx I am on the web today or is there going to be something different? Will sharing components between web and native mobile apps be possible?
- hitlin37 12y agoare you targeting arm platform support as well? I'm interested to know if any plans to have it on embedded devices.
- rajington 12y agoI understand Facebook Groups for iOS uses it, but how mature is the current component library (compared to Ionic for example)? If it's still small do you plan on the majority of future components to be first-party or third-party (community)? Extremely exciting either way, wish there was a livestream of tomorrow.
- arasmussen 12y agoThere won't be a livestream but presentation videos will be uploaded shortly afterwards!
- zkhalique 12y agoWow. It looks like we're going to have to make our platform (http://platform.qbix.com http://platform.qbix.com) integrate with React out of the box. This sounds pretty awesome. In short, how will it work and do you have any links we should check out, or people I can contact? The React virtual DOM has all kinds of elements that map to DOM elements, so how would it render in a native app? What about native APIs and Javascript that can interface with it e.g. like it does in PhoneGap? What is the equivalent here? Is it like Titanium in some way?
- mcintyre1994 12y agoSince we've heard Facebook Groups is built with it, and it's said to be iOS/Android - to what extent is the choice to build Groups with this responsible for the fact it's not in the Play store? Basically, if Groups is ever coming to Android is this helping or hindering porting?
- Xuzz 12y agoFacebook Groups is available for Android: https://play.google.com/store/apps/details?id=com.facebook.groups https://play.google.com/store/apps/details?id=com.facebook.g...
- mcintyre1994 12y agoI think that answers my question! Sorry, I only searched on my phone and it didn't show up.
- arasmussen 12y agoActually currently only the iOS Groups app is built on top of React Native. (I'm Andrew, I work at FB on React Native)
- nunocostapt 12y agoHey Andrew, this https://itunes.apple.com/us/app/facebook-groups/id931735837?mt=8 https://itunes.apple.com/us/app/facebook-groups/id931735837?... app is build on top of ReactJs?
- arasmussen 12y agoA significant portion of it, yes
- curiously 12y agoJordan, where is this conf taking place and what time (PST here). You say this is not DOM or some hybrid solution? Either this is too good to be true or ground breaking stuff. Do you mean that react could completely get rid of having to write stuff in Java or Objective-C?
- spicyj 12y agohttp://conf.reactjs.com/ http://conf.reactjs.com/ Yes, with React Native you'll be able to write native mobile apps completely in JavaScript.
- jnbiche 12y agoAny word on SVG support?
- malandrew 12y agoWill this layer be released as a separate project so that other projects like raynos/mercury [2] or elm [1] can target this interop layer? mercury was fully decoupled from virtual-dom [0] (such that you can use virtual canvas or virtual-gl). Would be really nice if this stuff can be used by other libraries easily. [0] https://github.com/Matt-Esch/virtual-dom https://github.com/Matt-Esch/virtual-dom [1] http://elm-lang.org/ http://elm-lang.org/ [2] https://github.com/Raynos/mercury https://github.com/Raynos/mercury
- doublerebel 12y agoYes pleaseeeee tell me I can take advantage of just the View layer and use my own Model and Controller setup. With Titanium views are 'just' JS objects, so I can use Spine, Backbone, and other libraries for business and data logic.
- danabramov 12y agoUm, you can do that in React just fine. It's just you don't really need Backbone with React because plain object/array models are more convenient, and controllers aren't needed because there's no need to “orchestrate changes” between view and model. Check out Flux as an example of architecture (not a framework) that works really well with React.
- mercer 12y agoExactly. I once started a project with backbone and used React for the view layer. I quickly realized I didn't need the Backbone models and collections, and ended up only using the router and a few small other things. Eventually i replaced these remaining parts with some 'micro-frameworks' like lo-dash, page.js, superagent, etc.
- magnatronus 12y agoApologies - In at the deep end with a very specific (hardcore?) question. In Titanium it is difficult, if not impossible without resorting to a Native plug-in (which kinda defeats the object of using it IMHO as this is not 'Learn once, use anywhere'), to re-create an interface similar to the Facebook app. i.e. the vertical scrolling timeline with embedded horizontal scrolling images in each post. (on Android it really does suck) due to issue with memory, threading etc. So I guess my question is, is it something to that React Native could cope with, or would it potentially suffer from the same memory, threading issues? And my guess is that at some point it has to surface, so a good architectural comparison would be fab. Perhaps the Hyperloop/React Native race is on :-)
- jordwalke 12y agoI also covered some of the performance related questions in another HN thread here ("zero DOM not virtual DOM"): https://news.ycombinator.com/item?id=8964935 https://news.ycombinator.com/item?id=8964935 I'll try to address some of the other more specific questions inline.