Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is Eric, from the React Native team.

We're starting with iOS and Android, which will keep us busy for the foreseeable future. That said, we will open source soon, and we'd be happy to accept help targeting other platforms!



Very interesting. Microsoft allows you to build fully native (not webview wrappers) apps using WinJS, and they have shown that React (along with Angular) can be used to build those apps [1]. I wonder if Microsoft will put resources into bridging the gap between React Native and Windows 10.

As a long time web oriented .NET developer wanting to pick up mobile who has been wondering whether to go Cordova or dive in fully native (ObjC/Java/Xaml) this is going to make the choice very difficult.

[1] https://github.com/winjs/winjs/wiki/Using-WinJS-with-React


Honest question: Would you even need something like react on windows given that wpf/winrt already support dependency properties and data binding?


TL;DR to below: focusing on JS instead of Xaml seems like a smarter play for a .NET developer that hasn't used Xaml in WPF or SL previously.

I put "web oriented .NET developer" in my response for this specific type of question. I kind of defaulted (11 years ago) into ASP classic and ASP.NET as a result of ad hoc consulting/support work for MS technologies back in 2000. But despite my affection for C# I abandoned ASP.NET's faux desktop event driven emulation for MVC as soon as it was released. Ever since then I felt sort of stuck in between thinking of myself as a Web Developer vs thinking of myself as a .NET Developer.

Which brings my long winded response back to your original question about WPF and data binding. WPF and Xaml are pretty foreign to me (I still have no idea about how WPF/SL/WinRT Xaml differ it all seems like Xaml to me) despite a long history with C#. But I am interested in native app development, so I have been torn on whether to go all in with C# knowing I could take it cross platform with Xamarin but need to reorient myself into the Xaml world or go all in with HTML5 knowing Cordova could be "mostly good enough".

I'm a Microsoft fan (I actually enjoy my Surface RT and Windows Phone) so WinJS on Windows 8 seemed like a good hedge for not throwing away all my JS knowledge (which is becoming a predominant part of my work with SPAs) but still letting me go fully native. But the overall Windows dev community seems to have spoken, Xaml is it and WinJS is a pariah, MS doesn't help much by staying mum on the matter but I think they are trying to shove WinJS into the Cordova camp and double down on Xaml for Win 10 with WinJS eventually fading away.


I program in WPF in C# with absolutely no XAML. I used to use dependency properties/data binding a lot, I even made a wrapper [1] so you could write things like:

    w0.Right.Bind = w1.Left + w2.Width;
And that would automatically generate a one way data binding in WPF (so if w1's left property, w2's width property, or w0's width property changes, w0's left property is automatically recomputed).

I've since moved on to my own dependency management (rebranded hence forth as managed time) system called Glitch [2], but that's because I'm trying to invent what's next.

I'm an MS employee but I have no idea what what is being done in this area. I do have lots of respect for WPF, it was weird that the other platforms couldn't put forward a decent UI platform for so long (well, JavaFX, but it didn't go anywhere).

[1] http://bling.codeplex.com/

[2] http://research.microsoft.com/en-us/people/smcdirm/managedti...


I should have mentioned that I don't actually have a problem with WPF or Xaml from a technical standpoint (I've been watching several Pluralsight and MSVA courses and the binding certainly looks very powerful). My wavering between WPF/C# vs HTML/JS/C# is more about where I think development will be going in the future and how that works out for me professionally. That is why I really was hoping WinJS would take off so I could get the best of both worlds, being able to develop for an OS (WP/Win8) I actually enjoy but also not letting my web dev skills atrophy. I'm very curious to see if WinJS gets mentioned at Build this year or if it will fade quietly into the background.


React, as the developers argue, is a step beyond data binding. It emphasises immutability and a single data flow, rather than the combinatorial interdependency of the data binding approach.


One way data binding is supported by WPF also, I mean, two-way data binding is the unusual odd man out. And of course, the one way data flow functions have to be immutable and you have to take a dependency whenever when you read a property imperatively.

What they've done with react native sounds a lot like how WPF works anyways (scene graph updated in UI thread, rendering thread then renders scene graph). Now, there is nothing wrong with that, I think its all good. But I don't think there is a good reason to use React in Windows project since most of the problems it solves have already been solved.


Having worked on production software with both WPF and React, I can tell you why React's "data binding" approach is categorically different (better, in my opinion) than WPF's.

Like many abstractions in WPF, bindings have a "shadow world" feeling, where they are their own little isolated DSL. With the React model, "bindings" are just JavaScript expressions. Sure, with WPF you can overload operators and create "ExpressionBinding" converters and play other tricks, but you can feel the seams between the subsystems.

On the topic of the scene graph: React's scene graph is an abstract service that you can only interact with in limited ways. WPF's scene graph is a big mutable machine with most of its moving bits exposed. To a first approximation, React's rendering strategy is laziness and WPF's rendering strategy is fixed point iteration. The former is much more likely to produce easy to understand and high performing UIs, even if it comes at the cost of making a few special use cases harder. In such cases, you can bypass the abstraction and muck with the platform guts, which seems to be the default choices in the dependency properties context.


Right, WPF's declarative databinding support is separated from imperative semantics, even if they can interact a bit (a databinding relationship can be formed and destroyed imperatively). But I've moved away from WPF to Glitch, which doesn't have that problem: all code runs in the same world, with dependency tracing, re-evaluation on dependency change, and logging to support rollback as needed. In that case, now I'm curious how React compares to what I'm working on right now.

I've never heard anyone claim that laziness leads to more performant UIs. It has always been the opposite in my experience: by loosening up evaluation orders and allowing for glitching, you reduce the amount of book keeping needed to come up with optimal DAG-style re-computation orders. For example, consider a double-indirect (flat-map-style) dependency:

    countLabel.Content = folderView.Selected.Count;
If count changes, you update the label. But if selected changes, you have to stop observing the previous selected folder's count property and start observing a new selected folder's count property. Carefully tearing down and building back dependency chains is tough, but if you just play lose with the dependencies, it is actually quite easy to handle (you might get some spurious re-evaluations). Note that WPF can't handle this without lots of hackery, which is one reason I moved all my UI work to Glitch (the other is that WPF is totally inappropriate performance wise for writing compilers and language-aware editors). I'm curious how React handles indirect state? Or does it need to do dependency tracing at all (it wouldn't if its not incremental; I can't tell by looking at the website)?


It doesn't have to track dependencies at all, but it is certainly still incremental. Maybe you should study it before judging it.


I've looked at the examples; I guess we just have different definitions in what incremental means.


cause I'm starting to excell in javascript and never even touched C#?


Honest question: you don't mind switching from a modern well-designed static language to legacy hastily-designed dynamic language?


I do a lot of Javascript for the front end SPA of our WCF based api, so I'm content with both js and C#, I try not to get too hung up on either language's respective baggage.


This is awesome.

I can't wait for the API docs and sources to be released.

Tweets and videos are lousy at conveying information : )


Nice! What about windows phones?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: