4 ms·
Remember this day, because React Native is going to be a game changer (patent clause stuff aside). Others like Phone Gap tried to make it so you could build nat
by DigitalSea 12y ago
Remember this day, because React Native is going to be a game changer (patent clause stuff aside). Others like Phone Gap tried to make it so you could build native apps using HTML/Javascript but they failed because they focused on running said HTML/Javascript within a performance limited WebView and not the other way around.
This weekend I am going to try and get a working application built using React Native. Facebook are absolutely killing it in regards to their open source contributions. The learn once, write anywhere paradigm is smart as opposed to what others have done via their write once, deploy anywhere approach which just doesn't work for web and native applications.
- WalterGR 12y ago> they focused on running said HTML/Javascript within a performance limited WebView and not the other way around. Could you explain that? I'm not familiar with phone development and I'm having difficulty figuring out what "the other way around" is.
- dcre 12y agoWith React Native, instead of writing HTML/CSS and running it on a crappy browser embedded in an app, you write code that looks like HTML/CSS (it's actually JSX)[1][2] and it is translated to native code. [1] https://facebook.github.io/react/docs/displaying-data.html https://facebook.github.io/react/docs/displaying-data.html [2] https://facebook.github.io/react/docs/jsx-in-depth.html https://facebook.github.io/react/docs/jsx-in-depth.html
- oyvindkinsey 12y agoIt's not translated. The JS runs to create a declarative description of what the ui should look like, which is reduced to a diff representing the changes that needs to be made to the native ui. These change commands are then marshalled to native code which simply implements the changes (add this thing, move this thing, remove this thing).
- dcre 12y agoOh, right. Thank you.
- ChrisLTD 12y agoPhone Gap tried to mimic native Android and iOS UI using HTML, CSS, and JS. React Native uses JS to control 100% native UI.
- TheMakeA 12y agoFor some definitions of "100% native UI." I'm a little concerned because, for example, a button is not implemented as a native UIButton, and a ListView doesn't use UITableView. Instead they are composed of native UIViews with a lot of JavaScript glue. That being said, Facebook has more experience writing iOS apps than me, so it may be possible that those things don't really matter (and doesn't preclude 1:1 components from being added down the road).
- woah 12y agoThe native uibutton is made of uiviews too
- TheMakeA 12y agoAbsolutely. My primary concern is with the controls feeling native. Reimplementing controls with UIViews doesn't seem much better than reimplementing them with HTML/CSS (save for performance). There's still surface area to break the illusion. Some food for thought: what if you kept HTML and CSS but instead of using a WebView to render it, you rendered the DOM manually using UIViews? You could even make overflow: scroll; turn into UIScrollViews automatically.
- ErikHuisman 12y agoIf you write JSX. What would be the benefit of using html anymore? Your own components can be the same on web or native. The base components might be a bit different but that isn't difficult to learn. <Carrousel> <Item></Item> <Item></Item> </Carrousel> On the web you might use a div with overflow:scroll on native a scrollView.
- 12y ago
- nwienert 12y agoI think there's a lot of proof that it does work, given there's 300,000 Ionic apps, tons in production. I downvoted you not because I don't agree that Native will be compelling but because I hate to see all this hate that's come out against hybrid apps in general that's even been propagated by React Native devs. Webviews will get there. WKWebView is already a huge step forward. I think Native is great, but it's not a clear winner in many cases. I even like "learn once apply everywhere" (though it doesn't really go against the web in any way), but I would say the mountain of hybrid apps out there actually disprove that it "just doesn't work".
- dustingetz 12y agoWebviews have been "getting there" for like 5 years now
- nwienert 12y agoThey've only existed for 8. We the rest of eternity. I get downvoted but I'm just refuting your unbased claims with facts.
- jayd3e 12y agoYeah I'm sorry, but web views are incredibly substandard to native apps. I've never found I hybrid app that I found comparable to its native counterpart. Simple things like scrolling can be very spotty most of the time.
- nwienert 12y ago>> Simple things like scrolling can be very spotty most of the time. That's just FUD. Only hybrid apps that use non-native scrolling are jittery, and for years now you can use '-webkit-overflow-scrolling: touch` to get native scrolling with bouncing.