人们对 Electron 的误解
I dedicated years bringing web technologies and desktop apps closer together. The most recent and most successful project in that vein is Electron, which I've spent the last ten years working on.
我花了多年时间将网络技术与桌面应用更紧密地结合在一起。最近最成功的项目是 Electron,我在这个项目上工作了十年。
As an open source project, our website never had to "convince people" to use Electron, so I never took the time to actually explain why I'm betting on web technologies to build user interfaces or why I prefer bundling a rendering engine.
作为一个开源项目,我们的网站从来不需要“说服人们”使用Electron,所以我从未花时间真正解释为什么我在用户界面构建中押注于网页技术,或为什么我更喜欢捆绑一个渲染引擎。
Electron's choices, especially the very idea of building interfaces with web tech and shipping large parts of Chromium to render them, are not uncontroversial. Reasonable people wonder why we made those choices. Operating systems already have user interface libraries. In those libraries is usually also some kind of WebView, often actually based on Blink (Windows) or WebKit (macOS, many Linux distributions). Why go through all that trouble of bundling parts of Chromium? And, even if we go through that trouble, why do so many apps (Visual Studio Code, Slack, Discord, Figma, ChatGPT, Claude, Notion, 1Password, Docker Desktop, and many more) go along with it?
Electron的选择,尤其是用网页技术构建界面并将大部分Chromium打包以渲染它们的想法,并不是没有争议的。合理的人会想知道我们为什么做出这些选择。操作系统已经有用户界面库。在这些库中通常也有某种WebView,通常实际上是基于Blink(Windows)或WebKit(macOS,许多Linux发行版)。为什么要经历打包Chromium部分的麻烦?而且,即使我们经历了这些麻烦,为什么这么多应用(Visual Studio Code、Slack、Discord、Figma、ChatGPT、Claude、Notion、1Password、Docker Desktop等)会随之而来?
I finally took the time to write down the arguments for the choices that we made. You can find that document on the Electron homepage. It tries to pre-empt a lot of common misconceptions. This post is a pairing suggestion —and discusses some of the things I believe people get most wrong about Electron on the Internet today.
我终于花时间写下了我们做出选择的理由。你可以找到 在Electron主页上的那份文档。它试图预先消除许多常见的误解。这篇文章是一个配对建议——并讨论了一些我认为人们今天在互联网上对Electron理解错误的事情。
Electron pits JavaScript versus native code
Electron 将 JavaScript 与原生代码进行对比
...