Pages Menu
TwitterRssFacebook

Posted by on Aug 11, 2021 in Development, Microsoft Teams

Stop saying Microsoft Teams is being rewritten from Electron to React

Stop saying Microsoft Teams is being rewritten from Electron to React

This is a bit of a ranty blog post, but I need to get something off my chest.

I hear a lot of people saying that Microsoft Teams is being re-written “from Electron to React”. I hear both technical and non-technical people saying it. I hear tech journalists saying it. I hear Microsoft folks saying it. But, it’s not true. It doesn’t make sense. Please, don’t take this the wrong way – but hear me out and let me explain what (I think) is happening.

Why everyone got confused

There are two things happening at the same time.

1 – The Electron technology is being replaced by a different thing.

Electron is what lets the Teams engineering team take what you see at teams.microsoft.com* – a web application – and make it into a desktop application. Electron hosts the web application in a little box on the desktop and has done since Teams launched – here’s what I wrote about it in 2017. It’s a wrapper, and it’s being replaced. Instead, the team are going to make heavy use of WebView2. This is a control that people who make desktop applications can use to show the contents of a web page or even a full web application like Microsoft Teams. I go into this in loads more detail on another blog post, but that’s what’s happening. Electron is being replaced by a new desktop application that will still host the teams.microsoft.com experience in a desktop application.

That change could have been the only thing that happened: it’s completely separate from the other change, which is…

2 – Teams is being rewritten in React.

If you’re not a web developer, or even if you are a web developer that hasn’t really done much serious work in the past 5 years then you might not know about this, but not all web pages are written in pure HTML, and JavaScript. After a while, JavaScript gets pretty intense for large-scale applications and it doesn’t exactly promote great programming design principles. Instead, there are frameworks to help you build your applications. These typically let you break a large application up into different components and contain a collection of well-integrated libraries. Once you get familiar with one of these frameworks, writing any web application (but particularly large and complex ones) is MUCH easier. It’s still all JavaScript under the hood, but it gets compiled into JavaScript from a slightly higher-order language and syntax. There are many different frameworks but two popular ones are Angular and React.

When Microsoft Teams was first written, Angular was chosen as the framework to use. Over the years that decision has come to be seen as the wrong one and React has emerged as the favoured choice. The new Teams client featuring in Windows 11 is written in 100% React, with no Angular parts. Choosing to use React matches up with other teams in Microsoft which also favour React: see Fluent UI, OfficeUI, Azure Communication Services UI etc. It really feels like Microsoft have “chosen” React as their preferred web framework technology.

So, you see, it doesn’t make sense!

This is why saying Teams is going “from Electron to React” doesn’t make any sense. It can’t go from a desktop wrapper technology to a web framework. Things you can confidently say instead:

  • Teams is going from Electron to using WebView2 (to host the teams web app)
  • Teams is being rewritten from Angular to React
  • Teams is replacing their application hosting technology AND rewriting their web code base

Please, let’s all stop replacing a desktop container technology with a web framework! And, if you hear someone say that Microsoft are “replacing Electron with React in Teams”, send them here 🙂

* ok, I know it’s not exactly the same code base because the desktop experience is slightly different from the web one sometimes, but there’s a load of overlap and shared components that make it considerably easier to manage than if 100% of the code for the desktop client was separate from the code for the web client. Can we agree on that?

Written by Tom Morgan

Tom is a Microsoft Teams Platform developer and Microsoft MVP who has been blogging for over a decade. Find out more.
Buy the book: Building and Developing Apps & Bots for Microsoft Teams. Now available to purchase online with free updates.

3 Comments

  1. can they hurry up about it though

  2. Thank you for this page. I am also getting mad whenever I hear this. Will sent people here from now on!

Post a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.