April 13, 2016 10:20 am

React Native on the Universal Windows Platform

Today, Microsoft and Facebook announced at Facebook’s developer conference, F8 2016, that we’re adding Universal Windows Platform (UWP) support to React Native. This is provided as an open source, community-supported framework. The new UWP support extends the reach of these native apps to a new market of 270 million active Windows 10 devices, and the opportunity to reach beyond mobile devices, to PCs, and even the Xbox One and HoloLens. For Windows app developers, it also means an opportunity to embed React Native components into their existing UWP apps and to leverage the developer tools and programming paradigms that React Native offers.

In addition to this work on the core framework support, Microsoft is also providing open source tools and services to help developers create React Native apps.  The React Native extension for Visual Studio Code brings an intuitive, productive environment to author and debug React Native apps. Coupled with CodePush, an open source service that can push updates directly to users, Microsoft is helping the React Native community build and deploy apps faster than ever.

For those unfamiliar, React Native is the fastest growing open source project of 2015, amassing over 30,000 stars on GitHub. As opposed to a “write once, run everywhere” kind of framework, React Native expects each platform to differentiate with distinct features and capabilities that apps can, and should, uniquely capture. Instead, they use the phrase “learn once, write everywhere” to capture the fact that React Native is as much about the programming model and developer tools that populate its ecosystem as it is about sharing code.  The same goes for React Native on UWP; an app written for UWP with React Native should feel just as natural as an app written directly in XAML.

As an example, let’s look at the F8 conference schedule app, which shows off many of the modules that are available on React Native for Windows. The app looks and performs great on both the Windows 10 mobile and desktop device families.

1_confschedule

2_confschedule

Under the hood, React Native enables app builders to declare their UI using JavaScript and React, and the framework translates the React DOM from JavaScript into method calls to view managers on the native platform, allowing developers to proxy direct calls to native modules through JavaScript function invocations. In the case of React Native on UWP, the view managers and native modules are implemented in C#, and the view managers instantiate and operate on XAML elements. We use Chakra for the JavaScript runtime, which can be consumed by any UWP app without any additional binaries being added to the app package.

Today’s announcement and releases are just the beginning. This release provides initial platform support in a standalone GitHub repository. Moving forward, we will work to add additional capabilities and bring our implementation into alignment with the original project.

You can learn more about reference implementations and our experience in building and publishing the F8 Developer Conference app for Windows 10 using React Native at the Decoded Conf in Dublin on May 6th. Come out and meet the team – we’ll be there discussing the project in detail. We invite developers to check out the implementation, to get involved, and to follow us on GitHub.

Written by Eric Rozell, Software Engineer, Microsoft Developer Experience

Join the conversation

  1. This is great news and it is good to see UWP recognized by a platform such as Facebook. However, consider how MSFT developers can interpret this. Basically what this says is that MSFT developers should use JavaScript-based technologies for all their client development as it can work everywhere (even the browser). Conversely, .NET can work in all native scenarios (via the Xamarin acquisition), but not the browser. Because of this, JavaScript development has more reach (which means more customers and more money) whereas .NET has less reach (meaning less customers/money) and is actually more expensive now as you now need to create a JS-based application anyways to get the reach that you are missing from .NET development — resulting in two different codebases in two different/incompatible technologies/languages that a developer/organization has to support and maintain.

    And if you are going to build a JS-based application (that is truly ubiquitous) anyways, why even bother with .NET? This is increasingly a question being asked by organizations and ISVs everywhere. It would be great to see MSFT make a corresponding announcement at some point to put .NET (back) in the browser and level the playing field with JavaScript (not to mention, stem the exodus of .NET developers to heading over to JS tech). If you are a .NET developer, please add your voice to the growing movement and vote for this very ask here: https://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/10027638-create-a-ubiquitous-net-client-application-develo

    Thank you for any consideration and support!

  2. It would be really nice to see the following:
    – Local debugging of iOS, android and windows devices through Visual Studio.
    – Remote compilation of iOS apps similar to what visual studio is able to do right now with Xamarin and Cordova apps.
    – Full support of react native apps for iOS, Android and UWP through Visual Studio Enterprise.

    Thanks!