Microsoft looks to React Native as a way to tackle the cross-platform development puzzle

Windows and Office teams shun Xamarin in favour of JavaScript/C++ solution

Ignite Microsoft has hinted that cross-platform development framework React Native is a key solution to the problem of writing applications that span both Windows and mobile.

Cross-platform development is critical for Microsoft since both first-party and third-party apps accessing Office 365 or Azure services need to run on iOS and Android as well as on Windows. Underlining the point, the company has announced Surface Duo, a dual-screen Android device expected towards the end of next year.

In 2016 the company acquired Xamarin, enabling development for iOS, Android and macOS using C# and .NET. Microsoft has also invested in .NET Core, which runs on Windows, macOS and Linux.

Initially aimed at server development, .NET Core is evolving to support desktop Windows applications. Microsoft has also said that .NET 5 will be available in late 2020, and will "target Windows, Linux, macOS, iOS, Android, tvOS, watchOS and WebAssembly and more".

Despite all this activity, Microsoft is not depending entirely on .NET for cross-platform development. There are a couple of reasons for this. One is that the Windows team has historically been wary of .NET and the overhead of the Common Language Runtime (CLR), preferring to develop in C++ for performance reasons. WinUI, which is the next-generation API for Windows desktop applications, is built in C++. Second, the company is keen to appeal to developers beyond the .NET community, especially the huge number who are familiar with JavaScript and web technology.

Usage patterns expressed on a Developer DNA board at Build 2019

Tangled in .NET: Will 5.0 really unify Microsoft's development stack?


React Native ticks all these boxes. The React web framework was developed by Facebook for building a user interface in JavaScript. In 2015 Facebook released React Native, which lets you use React for mobile applications for iOS and Android. React Native for Windows, sponsored by Microsoft, enables the framework to target Windows 10 UWP (Universal Windows Platform) or WPF (Windows Presentation Foundation) for Windows 7 and higher. The UWP version uses native WinUI controls. Developers can code in JavaScript or TypeScript, and tooling is provided for the popular Visual Studio Code editor.

UWP with C++ is best for performance, according to Microsoft

UWP with C++ is best for performance, according to this slide from Microsoft

React Native for Windows generates .NET code, but this will be replaced with a C++ implementation in an upcoming release, currently called vNext. Presenting the plans at Ignite, Microsoft program managers Kalita Saintonge and Steven Moyes said that the vNext version, which should be production-ready by the end of 2019, reduces memory requirements and improves performance. They also noted that React Native is much leaner than the Electron framework, another cross-platform solution, because it does not require an embedded browser engine.

There are several clues concerning the importance Microsoft attaches to React Native. One is that it is already being used by the Office team. If you right-click in the latest Word, for example, and add a comment, the pop-up box that appears is written in React Native. So too is the forthcoming Office Calendar application, now in preview. These applications use the vNext implementation, rather than .NET.

"You might be thinking, could I use React Native to target the new [Surface] devices? The answer to that question is, we hope so," said Moyes, showing a slide depicting Surface Duo. "React Native is building native applications, it stands to reason that React is a great platform for building apps that target multiple platforms."

Microsoft's official line is that Xamarin and React Native are equally good choices for targeting Windows and mobile, and that Xamarin is the sensible choice for those with existing C# code or skills, but it looks like React Native with C++ code generation is favoured by the Windows and Office teams for best performance.

What about Windows 7? This is an issue for business applications in companies that still use Windows 7, or for any Windows developer who wants the widest reach. You can do this in React Native using the WPF version, but Moyes was not keen. "I believe we have a WPF component as well but most of our active investment is happening in the UWP layer. WPF… is more of a community module," he told Ignite attendees. ®

Similar topics

Broader topics

Other stories you might like

  • Meet Wizard Spider, the multimillion-dollar gang behind Conti, Ryuk malware
    Russia-linked crime-as-a-service crew is rich, professional – and investing in R&D

    Analysis Wizard Spider, the Russia-linked crew behind high-profile malware Conti, Ryuk and Trickbot, has grown over the past five years into a multimillion-dollar organization that has built a corporate-like operating model, a year-long study has found.

    In a technical report this week, the folks at Prodaft, which has been tracking the cybercrime gang since 2021, outlined its own findings on Wizard Spider, supplemented by info that leaked about the Conti operation in February after the crooks publicly sided with Russia during the illegal invasion of Ukraine.

    What Prodaft found was a gang sitting on assets worth hundreds of millions of dollars funneled from multiple sophisticated malware variants. Wizard Spider, we're told, runs as a business with a complex network of subgroups and teams that target specific types of software, and has associations with other well-known miscreants, including those behind REvil and Qbot (also known as Qakbot or Pinkslipbot).

    Continue reading
  • Supreme Court urged to halt 'unconstitutional' Texas content-no-moderation law
    Everyone's entitled to a viewpoint but what's your viewpoint on what exactly is and isn't a viewpoint?

    A coalition of advocacy groups on Tuesday asked the US Supreme Court to block Texas' social media law HB 20 after the US Fifth Circuit Court of Appeals last week lifted a preliminary injunction that had kept it from taking effect.

    The Lone Star State law, which forbids large social media platforms from moderating content that's "lawful-but-awful," as advocacy group the Center for Democracy and Technology puts it, was approved last September by Governor Greg Abbott (R). It was immediately challenged in court and the judge hearing the case imposed a preliminary injunction, preventing the legislation from being enforced, on the basis that the trade groups opposing it – NetChoice and CCIA – were likely to prevail.

    But that injunction was lifted on appeal. That case continues to be litigated, but thanks to the Fifth Circuit, HB 20 can be enforced even as its constitutionality remains in dispute, hence the coalition's application [PDF] this month to the Supreme Court.

    Continue reading
  • How these crooks backdoor online shops and siphon victims' credit card info
    FBI and co blow lid off latest PHP tampering scam

    The FBI and its friends have warned businesses of crooks scraping people's credit-card details from tampered payment pages on compromised websites.

    It's an age-old problem: someone breaks into your online store and alters the code so that as your customers enter their info, copies of their data is siphoned to fraudsters to exploit. The Feds this week have detailed one such effort that reared its head lately.

    As early as September 2020, we're told, miscreants compromised at least one American company's vulnerable website from three IP addresses: 80[.]249.207.19, 80[.]82.64.211 and 80[.]249.206.197. The intruders modified the web script TempOrders.php in an attempt to inject malicious code into the checkout.php page.

    Continue reading

Biting the hand that feeds IT © 1998–2022