r/reactjs • • May 06 '19

Microsoft launches React Native for Windows

https://techcrunch.com/2019/05/06/microsoft-launches-react-native-for-windows/
510 Upvotes

91 comments sorted by

133

u/ritaly_fanboy May 06 '19

Don’t say it to my boss

113

u/swyx May 06 '19 edited May 07 '19

it to my boss

edit: obligatory edit to thank anon for the gold and also my mother its mother’s day soon people call your moms

edit: obligatory edit to thank anon for the silver and also washing machines. washing machines are great.

5

u/Scotthorn May 07 '19

This edit is awesome.

1

u/intertubeluber May 07 '19

You sick sonofabitch

-14

u/KinkyCode May 07 '19

it to my boss

1

u/[deleted] May 07 '19

Nice.

1

u/blinded_in_chains May 07 '19

Nah, it doesn't work twice.

33

u/Warbird01 May 06 '19

Hasn't this been around for a while? https://github.com/Microsoft/react-native-windows

Edit: This "launch" refers specifically to their C++ rewrite that the article mentions https://github.com/Microsoft/react-native-windows/tree/master/vnext

13

u/Bamboo_the_plant May 06 '19

Yes, it has, so I don't totally understand the hype.

But they feel ready to announce it now, and their repo mentions that it is intended to be merged into Facebook's core repo eventually rather than remaining independent.

2

u/swyx May 07 '19

i like to think this is how big launches work - test it out with early adopters to iron out kinks, then do the splashy PR push. the testing stage doesnt have to be secret at all.

1

u/XiMingpin91 May 07 '19

Was thinking this too. I guess it’s just mature enough that they’re willing to promote it now. I’m happy to see they didn’t give up on the project

72

u/inter_ception May 06 '19

So weird to see Microsoft pursuing so many open source projects. Edge now this. Landscape of the industry has really changed.

If they provide a Macos and Linux compatibility would be a nice alternative to electron.

64

u/Bamboo_the_plant May 06 '19

If they provide a Macos

They have, but nobody ever listens to me.

2

u/swyx May 07 '19

haha but this is a different sub :) congrats on getting your app to the front page of the mac app store!

1

u/Bamboo_the_plant May 07 '19

Thank you! 😭

0

u/[deleted] May 06 '19

[deleted]

4

u/Bamboo_the_plant May 06 '19

Marzipan is a game-changer, yes – I've produced the same app in both UIKit (for iOS, via Swift) and AppKit (for macOS, actually via React Native macOS), but even despite offering the macOS version for many times cheaper, it barely sells a fraction of the units of the iOS version. So for me, developing in AppKit was ultimately a great waste of time (even though AppKit apps can target to older macOS versions than Marzipan ones ever will be able to). Whether it's by Marzipan or by React Native macOS, any way to get a 'free' macOS app out of developing an iOS app is a great endgame in my mind.

4

u/argiebrah May 07 '19

And now Microsoft launched Visual Studio Online, an online code editor

3

u/Teh_Blue_Team May 07 '19

Why though? The download version is small, and robust. What's the benefit of an online editor?

11

u/fucking_passwords May 07 '19

Chromebooks? Using a machine you don’t own, without install permissions? Education?

1

u/vinnl May 07 '19

Although the server parts are not open source.

6

u/lambdaq May 07 '19

that's the first "embrace" step.

There are two more steps.

6

u/gitbrent May 07 '19

The three E days of Microsoft are over.

Satya seems to value being open and seeing the monetary value of mass appeal, but more importantly client ecosystems can’t be so easily monopolised.

-9

u/codeSm0ke May 06 '19

The market forced M$ to walk on the open-source path.

P.S. M$ cloud is built in Linux ... #funny

7

u/Devildude4427 May 06 '19

It was just bad admin for a few years that just didn’t understand the market at all.

The market didn’t force MS to do anything, MS just changed leadership and got with the times.

-12

u/James_Mamsy May 06 '19

Are they open source?? I might be mistaken (this is a react sub so I hope I speak truth) but isn’t react maintained by Facebook and chromium (edges new engine) by google?

14

u/inter_ception May 06 '19

They are maintained by the respective companies but it's open sourced under MIT licence.

7

u/James_Mamsy May 06 '19

TIL

8

u/Earhacker May 06 '19

Facebook had to make a big deal about this a while back. React was open source but licensed by Facebook in a very vague way that basically meant Facebook could rip off your patents and you couldn't sue them. So if Netflix are using React and Facebook decide to start their own movie streaming service, using the same React technology, Netflix can't sue for patent infringement.

Facebook fixed that shit, and now React is MIT licensed.

https://medium.freecodecamp.org/facebook-just-changed-the-license-on-react-heres-a-2-minute-explanation-why-5878478913b2

7

u/dominic_rj23 May 06 '19

Minor difference.

The patent grant says that if you’re going to use the software we’ve released under it, you lose the patent license from us if you sue us for patent infringement. https://code.fb.com/open-source/explaining-react-s-license/

You loose the right to use "open source" software from Facebook( react, react-native, relay, etc) if you decide to sue Facebook for any patent infringement. Facebook doesn't really need to be in the same business for that. Some people, erroneously, took it as far as to say that you can't sue Facebook at all.

2

u/Earhacker May 06 '19

Thanks for the clarity

0

u/[deleted] May 06 '19

[deleted]

12

u/Earhacker May 06 '19

I like the part where you correctly explained how it worked.

16

u/boxxa May 06 '19

Wow. Microsoft is doing some pretty awesome community focused stuff as of late.

3

u/yourjobcanwait May 07 '19

Who would had thought that if you build awesome free tooling that make it super easy to host on azure, that people will host their apps on azure?!?!

23

u/swyx May 06 '19

wonder how this will compete with Electron. electron is kinda “js native” for all desktops.

9

u/desmone1 May 07 '19

When just thinking about desktop, Electron will still be a solid choice vs react-native-windows. Howeverk, this is not Microsoft's end game it seems. They are also busy working on React-Native for MacOS as part of their work on ReactXP which aims to deliver the holy grail of writing code that will work on Web, iOs, Windows, MacOS and Android

1

u/wavefunctionp May 07 '19

Having worked on RN, I'd much rather see electron/PWA apps take off instead of more pseudo-native techs. Most application doesn't have a need for native controls beyond look/feel, and much of that could be addressed with exposing more rich controls in the browser. Maybe a new markup spec for browsers optimized for browsers. Bring apps as first class citizens in browsers instead of layered on top of a document spec.

17

u/Earhacker May 06 '19

Electron ain't great, though. I mean it works if all you need is an app that loads a web page (e.g. Slack) but it doesn't work if your app needs to do more than that (e.g. Spotify). This seems to be aimed at "real" apps, not just web wrappers.

33

u/swyx May 06 '19 edited May 06 '19

eh. you can do all node stuff in electron. use native modules for stuff you cant do in js. only reason Spotify isnt in Electron is probably because it was written before Electron. there are bad ways to write Electron, which makes it slow, but VScode indicates this isnt a necessary outcome of Electron.

edit: /u/Earhacker knows more than i do, i will concede i am wrong but am leaving this up.

37

u/Earhacker May 06 '19 edited May 07 '19

Spotify used to use Electron. They abandoned it for Chromium Embedded Framework because it worked better with how their dev team works (tribes building micro-frontends). Then they moved to a custom C++ framework.

VS Code uses a very thin Electron wrapper around C# components that were built for Visual Studio. They really are just piggy-backing on Electron for the cross-platform support; something that Microsoft has never done well.

I'm not an Electron hater. I've used it and like it. But VS Code and Spotify are not typical Electron apps. Slack and Discord are probably still the biggest and best examples of "pure" Electron apps, and they both work just fine. But neither of them work better than just opening Slack or Discord in a Chrome tab, and Spotify does.

22

u/swyx May 06 '19

i didnt know Spotify used Electron for a while. my point is totally invalid. thanks for dropping the knowledge nicely :)

6

u/argiebrah May 07 '19

custom C++ framework.

Spider. Some dude did a reverse engineering and posted the all framework on github

2

u/thepeanutguy May 07 '19

Spotify used to use Electron

Source? I don't think this is true.

1

u/altano May 07 '19

C# components? I don’t think that’s correct. Can you say more?

6

u/[deleted] May 06 '19

Except electron uses HTML and this doesn’t.

7

u/swyx May 06 '19

implementation detail

0

u/[deleted] May 07 '19

[deleted]

2

u/[deleted] May 07 '19

Actually no, the performance problem is not HTML.

The web engine is the problem & the nature of JavaScript. Not HTML

0

u/[deleted] May 07 '19

[deleted]

1

u/[deleted] May 07 '19

you said that it is.

Yes, but its not using the web engine for that.

0

u/[deleted] May 07 '19

[deleted]

1

u/[deleted] May 07 '19

You said its a leaky inplementation detail about it not using html as a performance reason. Did you read the thread you are answering to?

I said the web engine & the nature of JavaScript. Although it using the same engine (duh, who would have thought?) it is not behaving the same & not executed in the same context.

It using HTML, XML w/e has literally nothing to do with its performance problem.

Besides for most applications if written correctly the performance difference is not noticeable. What is, is non native look & feel which is often the case in replica components

0

u/[deleted] May 07 '19

[deleted]

→ More replies (0)

2

u/[deleted] May 07 '19 edited May 07 '19

I hope this will signal the end for tools like Electron. As good as it is, it's still a dirty stopgap solution. The moment React learns to reliantly render native on desktop as it does on mobile Electron could go. You can still use node btw, but your apps don't have to drag a browser along, depend on a dom-driven web view and eat a ton of disk space and ram. I have so many electron/chrome apps open right now (spottify, slack, discord, vsc, whatsapp, hyper, notion, kap, spectrum, etc), it makes my mba's fans spin practically all day, this has to stop at some point. I remember that laptops could last 10-13 hours years ago. Nowadays i can be glad if i make it through 2-3.

1

u/ScottRatigan May 07 '19

The serialization feels more hacky than native, IMO. It's still amazing but native is not the word I'd use.

1

u/AlphaKevin667 May 07 '19

Problem is that Electron has horrible performance

1

u/Hadnet May 07 '19

You’re just a bad programmer.

1

u/AlphaKevin667 May 07 '19

2 Go consumed on the RAM for the example app provided by Electron but of course, this is my code''s fault XD

19

u/jarail May 06 '19

I swear they talked about this like four years ago.

8

u/Eternality May 07 '19

yeah right around the time my windows phone was supposed to take off

3

u/ScottRatigan May 07 '19

I remember reading about it on my SurfaceRT while listening to my Zune.

1

u/[deleted] May 07 '19

they launched a new terminal like it's 3019 now.

20

u/nissart89 May 06 '19

Microsoft aka Oprah of the open source community.

22

u/Earhacker May 06 '19

"You get a framework! And you get a framework! And everybody gets a framework!"

1

u/KinkyCode May 07 '19

Came to comment this.

5

u/Unforgiven-wanda May 06 '19

Wish someone would offer a breakdown of how this compares to Electron on the Windows platform specifically.
I'm mostly interested in the performance side of things, because let's face it, Electron is a mammoth.

4

u/Ashwyy May 07 '19

Does it mean react-native has a bright future?

4

u/consoleDir May 07 '19

“Any application that can be written in JavaScript, will eventually be written in JavaScript.”
 — Jeff Atwood, Author, Entrepreneur, Cofounder of StackOverflow

2

u/Mumus27 May 06 '19

windows 10 only ?

6

u/jdewittweb May 06 '19

We can only hope so.

3

u/plwai May 07 '19

Tried to use it in production previously. It can be built into WPF app as well which supports Windows 7 and above. However, UWP app version is recommended by Microsoft and most of the documentations are written for UWP app version.

2

u/Kontributer May 06 '19

Perfect! Now when are they going to announce the Zune?

1

u/hacksparrow May 07 '19

I may never use it, but you gotta love the new Microsoft. These days they seem to be more about "contribute and improve". Back in the day, they were "my shitty way or the highway". Nadella is undoing the damage done by Steve "Developers! Developers! Developers! Developers! Developers! Developers!" Ballmer.

Making websites work on IE 6, IE 7, IE 8, IE 9, IE 10, IE 11, Chrome, Firefox, and Safari was traumatizing. I don't do front-end anymore, but the landscape seems to be a lot better these days.

-1

u/Earhacker May 06 '19

What do we think this means for Xamarin, if Microsoft are jumping into bed with React Native? Xamarin and React Native are direct competitors (along with Google's Ionic) in the cross-platform mobile development sector.

12

u/swyx May 06 '19

a trillion dollar company can support multiple similar products :) but specifically RN for windows does not compete with Xamarin

8

u/_kyushiro May 06 '19

Different tech stacks though. I'm pretty sure no c# dev is going to rush and shift to js now following this news. This just allows MS to have a share of that js/react userbase as well

1

u/Earhacker May 06 '19

Yeah, I kinda agree.

But Xamarin and .NET don't have much in common, despite both being C# frameworks. Xamarin isn't doing too well, but .NET is everywhere, at least in my neck of the woods. And don't forget TypeScript is a Microsoft product, so they've already hooked into a huge chunk of the JS/React dev base with that.

2

u/_kyushiro May 06 '19

Oh yes, Also true for typescript. Which now that you mention it, is a huge part of angular/ionic too, so all in all yep, mixed signals from microsoft. Oh well, as long as we're getting better tooling in the process :)

10

u/[deleted] May 06 '19

Is it mixed signals or Microsoft supporting developers where they are rather than trying to move them someplace they are not?

4

u/Warbird01 May 06 '19

Just throwing it out there but Ionic doesn't produce pure native apps like RN and Xamarin (its more like Electron for mobile aka web wrapper)

3

u/desmone1 May 07 '19

Xamarin: iOS, Android, Windows using .NET ReactXP: iOS, Android, Windows, MacOS, Web using React-Native

1

u/Jinno May 07 '19

Probably not good things overall. Microsoft has been phasing out support for some Xamarin focused tools like Calabash, and Xamarin Test Cloud is now part of Visual Studio App Center, where React Native is really being pushed as a first class citizen with Code Push support.

I don't see Xamarin being a long term vision of Microsoft.

0

u/motioncuty May 07 '19

Lucky us.

-8

u/Nategeier May 06 '19

Had a chuckle at that word scramble of a title, but I guess it makes sense haha.