
When coupled with autocomplete in VS Code, writing JavaScript feels a lot like writing, say, C#. Never again will you ponder over the output of a flatMap (do I get the array or just one item?), the argument order for a reduced, or the name of that one operator that’s like throttle but starts with a D… (it’s debounce).

Now, in the case of a major refactor, the type checking has helped avoid many bugs which would have not otherwise be detected: Redux-electron uses Electrons IPC (inter-process communication) to share actions between processes, using the main process as the single source of truth and treating the others as proxies.Īnother choice made was TypeScript, which Hess states as something which brought major benefits through the project. Essentially, Slack is comprised of many processes, each one containing its own Redux store. One decision made by the team was to introduce redux-electron with Redux. However, by making good technology choices and design decisions, Hess explains that the rewrite was made as painless as possible, and he estimates that in the end, they were able to retain more than 70% of their original code. Since our app was written as a set of React components that wrapped the webView, and - being React - those components lived in the DOM, this looked to be a full rewrite. Similar to top-level windows, these views can only be created from the background Node process. What we mean by that is - unlike the webView - you can’t drop a BrowserView into the DOM and manipulate it with CSS. It’s migrating to this which was most of the work for Slack 3.0:

To get around this, the Electron team introduced browserView, a component which behaves more like a Chrome tab and is part of the operating system window hierarchy.

This means that bug fixes end up needing to be done by the Chrome team, effectively blocking progress. One of the main issues with webView was that the component itself is implemented in Chromium directly. Hess explains that this is mainly down to webView, an Electron feature used for rendering web pages. Whilst this technology choice has helped keep Slack cross-platform, it has not been as stable as the team would like. Slack is written in Electron, a framework which is used to develop desktop applications using web technologies such as a NodeJS and Chromium. Charlie Hess, engineer at Slack, has published a blog outlining this journey. At its core, most of the changes have revolved around migrating from the Electron component webView to browserView, a newer and more stable alternative. Slack has recently made version 3.0 available in their beta channel, with numerous performance improvements and bug fixes.
