Skip to main content

协议处理程序漏洞修复

· 3 min read

已经发现了一个影响使用自定义协议处理程序的 Electron 应用的远程代码执行漏洞。该漏洞已被分配 CVE 标识符 CVE-2018-1000006

🌐 A remote code execution vulnerability has been discovered affecting Electron apps that use custom protocol handlers. This vulnerability has been assigned the CVE identifier CVE-2018-1000006.


受影响的平台

🌐 Affected Platforms

在 Windows 上运行的 Electron 应用,如果将自己注册为某个协议(如 myapp://)的默认处理程序,就存在漏洞。

🌐 Electron apps designed to run on Windows that register themselves as the default handler for a protocol, like myapp://, are vulnerable.

无论协议如何注册,例如使用本地代码、Windows 注册表或 Electron 的 app.setAsDefaultProtocolClient API,这类应用都可能受到影响。

🌐 Such apps can be affected regardless of how the protocol is registered, e.g. using native code, the Windows registry, or Electron's app.setAsDefaultProtocolClient API.

macOS 和 Linux 不受此问题影响

🌐 macOS and Linux are not vulnerable to this issue.

缓解措施

🌐 Mitigation

我们已经发布了包含此漏洞修复的新版本 Electron: 1.8.2-beta.51.7.12、 和 1.6.17。 我们强烈建议所有 Electron 开发者立即将他们的应用更新到最新的稳定版本。

🌐 We've published new versions of Electron which include fixes for this vulnerability: 1.8.2-beta.5, 1.7.12, and 1.6.17. We urge all Electron developers to update their apps to the latest stable version immediately.

如果由于某种原因你无法升级 Electron 版本, 你可以在调用 app.setAsDefaultProtocolClient 时将 -- 作为最后一个参数附加,这可以防止 Chromium 解析更多选项。 双破折号 -- 表示命令选项的结束,之后只接受位置参数。

🌐 If for some reason you are unable to upgrade your Electron version, you can append -- as the last argument when calling app.setAsDefaultProtocolClient, which prevents Chromium from parsing further options. The double dash -- signifies the end of command options, after which only positional parameters are accepted.

app.setAsDefaultProtocolClient(protocol, process.execPath, [
'--your-switches-here',
'--',
]);

有关更多详情,请参阅 app.setAsDefaultProtocolClient API。

🌐 See the app.setAsDefaultProtocolClient API for more details.

要了解有关保持你的 Electron 应用安全的最佳做法,请参阅我们的 [安全教程]。

🌐 To learn more about best practices for keeping your Electron apps secure, see our security tutorial.

如果你希望报告 Electron 中的漏洞,请提交 [GitHub 安全咨询]。

🌐 Please file a GitHub Security Advisory if you wish to report a vulnerability in Electron.

Electron 的全新国际化网站

· 12 min read

Electron 有了一个新网站,网址是 electronjs.org!我们已将原来的静态 Jekyll 网站替换为 Node.js 网络服务器,这让我们能够更灵活地进行网站的国际化,并为更多令人兴奋的新功能铺平了道路。

🌐 Electron has a new website at electronjs.org! We've replaced our static Jekyll site with a Node.js webserver, giving us flexibility to internationalize the site and paving the way for more exciting new features.


🌍 翻译

🌐 🌍 Translations

我们已开始着手对网站进行国际化,目标是让全球开发者都能轻松进行 Electron 应用开发。我们正在使用一个名为 Crowdin 的本地化平台,该平台可以与 GitHub 集成,并在内容被翻译成不同语言时自动创建和更新拉取请求。

🌐 We've begun the process of internationalizing the website with the goal of making Electron app development accessible to a global audience of developers. We're using a localization platform called Crowdin that integrates with GitHub, opening and updating pull requests automatically as content is translated into different languages.

Electron 导航(简体中文)

尽管到目前为止我们一直在默默地推进这项工作,但已经有超过75名Electron社区成员自发发现了这个项目,并加入了将网站国际化及将Electron文档翻译成20多种语言的工作。我们看到来自世界各地的每日贡献,其中法语、越南语、印尼语和中文的翻译工作走在前列。

🌐 Though we've been working quietly on this effort so far, over 75 Electron community members have already discovered the project organically and joined in the effort to internationalize the website and translate Electron's docs into over 20 languages. We are seeing daily contributions from people all over the world, with translations for languages like French, Vietnamese, Indonesian, and Chinese leading the way.

要选择你的语言并查看翻译进度,请访问 electronjs.org/languages

🌐 To choose your language and view translation progress, visit electronjs.org/languages

Crowdin 上的翻译进行中

如果你会多种语言并且有兴趣帮助翻译 Electron 的文档和网站,可以访问 electron/electron-i18n 仓库,或者直接在 Crowdin 上进行翻译,你可以使用 GitHub 账号登录。

🌐 If you're multilingual and interested in helping translate Electron's docs and website, visit the electron/electron-i18n repo, or jump right into translating on Crowdin, where you can sign in using your GitHub account.

目前,Electron 项目在 Crowdin 上已启用 21 种语言。添加对更多语言的支持很简单,因此如果你有兴趣帮助翻译,但没有看到你的语言列在其中,请告诉我们,我们会启用它。

🌐 There are currently 21 languages enabled for the Electron project on Crowdin. Adding support for more languages is easy, so if you're interested in helping translate but you don't see your language listed, let us know and we'll enable it.

原始翻译文档

🌐 Raw Translated Docs

如果你更喜欢阅读原始 Markdown 文件的文档,现在你可以用任何语言这样做:

🌐 If you prefer to read documentation in raw markdown files, you can now do that in any language:

git clone https://github.com/electron/electron-i18n
ls electron-i18n/content

应用页面

🌐 App Pages

截至今天,任何 Electron 应用都可以轻松在 Electron 网站上拥有自己的页面。举几个例子,看看 Etcher1ClipboardGraphQL Playground,如图所示,在网站的日文版上:

🌐 As of today, any Electron app can easily have its own page on the Electron site. For a few examples, check out Etcher, 1Clipboard, or GraphQL Playground, pictured here on the Japanese version of the site:

GraphQL Playground

有一些非常棒的 Electron 应用,但它们并不总是容易找到,而且并不是每个开发者都有时间或资源去建立一个完善的网站来推广和分发他们的应用。

🌐 There are some incredible Electron apps out there, but they're not always easy to find, and not every developer has the time or resources to build a proper website to market and distribute their app.

仅使用一个PNG 图标文件和少量应用元数据,我们就能够收集有关特定应用的大量信息。通过收集 GitHub 的数据,应用页面现在可以显示截图、下载链接、版本、更新说明以及每个拥有公共仓库的应用的 README。通过从每个应用的图标中提取调色板,我们可以制作大胆且易于识别的颜色,为每个应用页面提供一定的视觉差异。

🌐 Using just a PNG icon file and a small amount of app metadata, we're able to collect a lot of information about a given app. Using data collected from GitHub, app pages can now display screenshots, download links, versions, release notes, and READMEs for every app that has a public repository. Using a color palette extracted from each app's icon, we can produce bold and accessible colors to give each app page some visual distinction.

应用索引页面 现在也有分类和关键字过滤功能,方便查找有趣的应用,如 GraphQL 图形界面点对点工具

🌐 The apps index page now also has categories and a keyword filter to find interesting apps like GraphQL GUIs and p2p tools.

如果你有一个想在网站上展示的 Electron 应用,可以在 electron/electron-apps 仓库中提交一个 pull request。

🌐 If you've got an Electron app that you'd like featured on the site, open a pull request on the electron/electron-apps repository.

使用 Homebrew 的一行安装

🌐 One-line Installation with Homebrew

macOS 的 Homebrew 包管理器有一个名为 cask 的子命令,它可以让你通过在终端中输入一个命令轻松安装桌面应用,例如 brew cask install atom

🌐 The Homebrew package manager for macOS has a subcommand called cask that makes it easy to install desktop apps using a single command in your terminal, like brew cask install atom.

我们已经开始收集流行 Electron 应用的 Homebrew cask 名称,并且现在在每个有 cask 的应用页面上显示安装命令(针对 macOS 访问者):

🌐 We've begun collecting Homebrew cask names for popular Electron apps and are now displaying the installation command (for macOS visitors) on every app page that has a cask:

针对你的平台定制的安装选项:macOS、Windows、Linux

要查看所有具有 Homebrew Cask 名称的应用,请访问 electronjs.org/apps?q=homebrew。如果你知道其他我们尚未收录的 Cask 应用,请添加它们!

🌐 To view all the apps that have homebrew cask names, visit electronjs.org/apps?q=homebrew. If you know of other apps with casks that we haven't indexed yet, please add them!

🌐 一个新字段

🌐 🌐 A New Domain

我们已将网站从 electron.atom.io 迁移到新的域名:electronjs.org

🌐 We've moved the site from electron.atom.io to a new domain: electronjs.org.

Electron 项目诞生于 Atom 内部,Atom 是 GitHub 基于 web 技术构建的开源文本编辑器。Electron 最初被称为 atom-shell。Atom 是第一个使用它的应用,但人们很快就意识到,这个神奇的 Chromium + Node 运行时可以用于各种不同的应用。当像微软和 Slack 这样的公司开始使用 atom-shell 时,很明显这个项目需要一个新的名字。

🌐 The Electron project was born inside Atom, GitHub's open-source text editor built on web technologies. Electron was originally called atom-shell. Atom was the first app to use it, but it didn't take long for folks to realize that this magical Chromium + Node runtime could be used for all kinds of different applications. When companies like Microsoft and Slack started to make use of atom-shell, it became clear that the project needed a new name.

于是,“Electron”诞生了。在2016年初,GitHub组建了一个新的团队,专门专注于Electron的开发和维护,独立于Atom。在此之后,Electron被成千上万的应用开发者采用,如今许多大型公司也依赖它,其中许多公司还有自己的Electron团队。

🌐 And so "Electron" was born. In early 2016, GitHub assembled a new team to focus specifically on Electron development and maintenance, apart from Atom. In the time since, Electron has been adopted by thousands of app developers, and is now depended on by many large companies, many of which have Electron teams of their own.

支持 GitHub 的 Electron 项目,比如 Atom 和 GitHub Desktop,仍然是我们团队的优先事项,但通过迁移到一个新的域名,我们希望能够帮助澄清 Atom 和 Electron 之间的技术区别。

🌐 Supporting GitHub's Electron projects like Atom and GitHub Desktop is still a priority for our team, but by moving to a new domain we hope to help clarify the technical distinction between Atom and Electron.

🐢🚀 Node.js 无处不在

🌐 🐢🚀 Node.js Everywhere

之前的 Electron 网站是使用流行的基于 Ruby 的静态网站生成器 Jekyll 构建的。Jekyll 是构建静态网站的绝佳工具,但网站已经开始超出它的能力范围。我们希望拥有更多动态功能,例如正确的重定向和动态内容渲染,因此 Node.js 服务器成为显而易见的选择。

🌐 The previous Electron website was built with Jekyll, the popular Ruby-based static site generator. Jekyll is a great tool for building static websites, but the website had started to outgrow it. We wanted more dynamic capabilities like proper redirects and dynamic content rendering, so a Node.js server was the obvious choice.

Electron生态系统包含使用多种不同编程语言编写组件的项目,从Python到C++再到Bash。但JavaScript是Electron的基础语言,也是我们社区中使用最广泛的语言。

🌐 The Electron ecosystem includes projects with components written in many different programming languages, from Python to C++ to Bash. But JavaScript is foundational to Electron, and it's the language used most in our community.

通过将网站从 Ruby 迁移到 Node.js,我们旨在降低希望为网站做出贡献的人的入门门槛。

🌐 By migrating the website from Ruby to Node.js, we aim to lower the barrier to entry for people wishing to contribute to the website.

⚡️ 更轻松的开源参与

🌐 ⚡️ Easier Open-Source Participation

如果你的系统上已经安装了 Node.js(8 或更高版本)和 git,你可以轻松地在本地运行该网站:

🌐 If you've got Node.js (8 or higher) and git installed on your system, you can easily get the site running locally:

git clone https://github.com/electron/electronjs.org
cd electronjs.org
npm install
npm run dev

新网站托管在 Heroku 上。我们使用部署流水线和Review Apps功能,该功能会为每个拉取请求自动创建一个正在运行的应用副本。这使得审查者可以轻松查看拉取请求对网站实时副本的实际影响。

🌐 The new website is hosted on Heroku. We use deployment pipelines and the Review Apps feature, which automatically creates a running copy of the app for every pull request. This makes it easy for reviewers to view the actual effects of a pull request on a live copy of the site.

🙏 感谢所有贡献者

🌐 🙏 Thanks to Contributors

我们想向世界各地所有贡献了时间和精力帮助改进 Electron 的朋友们表示特别感谢。开源社区的热情在 Electron 的成功中起到了不可估量的作用。谢谢大家!

🌐 We'd like to give special thanks to all the folks around the world who have contributed their own time and energy to help improve Electron. The passion of the open-source community has helped immeasurably in making Electron a success. Thank you!

Thumbs up!

Chromium RCE 漏洞修复

· 2 min read

在 Google Chromium 中发现了一个远程代码执行漏洞,影响所有最近版本的 Electron。任何访问远程内容的 Electron 应用都容易受到此漏洞的攻击,无论是否启用了 [沙箱选项]。

🌐 A remote code execution vulnerability has been discovered in Google Chromium that affects all recent versions of Electron. Any Electron app that accesses remote content is vulnerable to this exploit, regardless of whether the sandbox option is enabled.

我们发布了两个新的 Electron 版本 1.7.81.6.14,其中都包含了对该漏洞的修复。我们强烈建议所有 Electron 开发者立即将他们的应用更新到最新的稳定版本:

🌐 We've published two new versions of electron 1.7.8 and 1.6.14, both of which include a fix for this vulnerability. We urge all Electron developers to update their apps to the latest stable version immediately:

npm i electron@latest --save-dev

要了解有关保持你的 Electron 应用安全的最佳做法,请参阅我们的 [安全教程]。

🌐 To learn more about best practices for keeping your Electron apps secure, see our security tutorial.

如果你希望报告 Electron 中的漏洞,请提交 [GitHub 安全咨询]。

🌐 Please file a GitHub Security Advisory if you wish to report a vulnerability in Electron.

宣布 Electron 支持 TypeScript

· 9 min read

electron npm 包现在包含一个 TypeScript 定义文件,提供了对整个 Electron API 的详细注释。这些注释可以提升你的 Electron 开发体验,即使你使用的是普通的 JavaScript。只需 npm install electron 就可以在你的项目中获取最新的 Electron 类型定义。

🌐 The electron npm package now includes a TypeScript definition file that provides detailed annotations of the entire Electron API. These annotations can improve your Electron development experience even if you're writing vanilla JavaScript. Just npm install electron to get up-to-date Electron typings in your project.


TypeScript 是由微软创建的一种开源编程语言。它是 JavaScript 的超集,通过添加对静态类型的支持来扩展语言。近年来,TypeScript 社区发展迅速,在最近的 Stack Overflow 开发者调查中,TypeScript 被评为最受喜爱的编程语言之一。TypeScript 被形容为“可扩展的 JavaScript”,GitHub、Slack 和 Microsoft 的团队都在使用它来编写可扩展的 Electron 应用,这些应用被数百万人使用。

🌐 TypeScript is an open-source programming language created by Microsoft. It's a superset of JavaScript that extends the language by adding support for static types. The TypeScript community has grown quickly in recent years, and TypeScript was ranked among the most loved programming languages in a recent Stack Overflow developer survey. TypeScript is described as "JavaScript that scales", and teams at GitHub, Slack, and Microsoft are all using it to write scalable Electron apps that are used by millions of people.

TypeScript 支持 JavaScript 中的许多新语言特性,比如类、对象解构和 async/await,但它真正的区别特性是类型注解。 声明程序预期的输入和输出数据类型可以减少错误,通过帮助你在编译时发现错误,同时这些注解也可以作为对程序工作方式的正式声明。

🌐 TypeScript supports many of the newer language features in JavaScript like classes, object destructuring, and async/await, but its real differentiating feature is type annotations. Declaring the input and output datatypes expected by your program can reduce bugs by helping you find errors at compile time, and the annotations can also serve as a formal declaration of how your program works.

当库使用原生 JavaScript 编写时,类型通常在编写文档时作为附带考虑而被模糊定义。函数通常可以接受的类型比文档中记录的更多,或者函数可能具有未记录的隐形约束,这可能导致运行时错误。

🌐 When libraries are written in vanilla Javascript, the types are often vaguely defined as an afterthought when writing documentation. Functions can often accept more types than what was documented, or a function can have invisible constraints that are not documented, which can lead to runtime errors.

TypeScript 通过 定义文件 解决了这个问题。TypeScript 定义文件描述了一个库的所有函数以及其预期的输入和输出类型。当库的作者在发布的库中打包 TypeScript 定义文件时,该库的使用者可以直接在编辑器中探索它的 API 并立即开始使用,通常无需查阅库的文档。

🌐 TypeScript solves this problem with definition files. A TypeScript definition file describes all the functions of a library and its expected input and output types. When library authors bundle a TypeScript definition file with their published library, consumers of that library can explore its API right inside their editor and start using it right away, often without needing to consult the library's documentation.

许多流行的项目,例如 AngularVue.jsnode-github(以及现在的 Electron!)都会编译自己的定义文件,并将其与发布的 npm 包一起打包。对于那些没有打包自己定义文件的项目,有 DefinitelyTyped,这是一个由社区维护的第三方定义文件生态系统。

🌐 Many popular projects like Angular, Vue.js, node-github (and now Electron!) compile their own definition file and bundle it with their published npm package. For projects that don't bundle their own definition file, there is DefinitelyTyped, a third-party ecosystem of community-maintained definition files.

安装

🌐 Installation

从版本 1.6.10 开始,每个 Electron 版本都包含自己的 TypeScript 定义文件。当你从 npm 安装 electron 包时,electron.d.ts 文件会随安装的包自动打包。

🌐 Starting at version 1.6.10, every release of Electron includes its own TypeScript definition file. When you install the electron package from npm, the electron.d.ts file is bundled automatically with the installed package.

安装 Electron 最安全的方法是使用确切的版本号:

🌐 The safest way to install Electron is using an exact version number:

npm install electron --save-dev --save-exact

或者如果你使用的是 yarn:

🌐 Or if you're using yarn:

yarn add electron --dev --exact

如果你已经在使用第三方定义,例如 @types/electron@types/node,你应该将它们从你的 Electron 项目中移除,以防止任何冲突。

🌐 If you were already using third-party definitions like @types/electron and @types/node, you should remove them from your Electron project to prevent any collisions.

定义文件来源于我们的结构化 API 文档,因此它始终与Electron 的 API 文档保持一致。只需安装 electron,你就可以始终获得与所使用的 Electron 版本同步的 TypeScript 定义。

🌐 The definition file is derived from our structured API documentation, so it will always be consistent with Electron's API documentation. Just install electron and you'll always get TypeScript definitions that are up to date with the version of Electron you're using.

用法

🌐 Usage

想要了解如何安装和使用 Electron 的新 TypeScript 注解,请观看这个简短的演示录屏:

🌐 For a summary of how to install and use Electron's new TypeScript annotations, watch this short demo screencast:

如果你正在使用 Visual Studio Code,你已经拥有内置的 TypeScript 支持。还有社区维护的插件可用于 AtomSublimevim 以及 其他编辑器

🌐 If you're using Visual Studio Code, you've already got TypeScript support built in. There are also community-maintained plugins for Atom, Sublime, vim, and other editors.

一旦你的编辑器配置好了 TypeScript,你就会开始看到更多上下文感知的功能,比如自动补全建议、内联方法引用、参数检查等。

🌐 Once your editor is configured for TypeScript, you'll start to see more context-aware behavior like autocomplete suggestions, inline method reference, argument checking, and more.

Method autocompletion

Method reference

Argument checking

TypeScript 入门

🌐 Getting started with TypeScript

如果你是 TypeScript 新手并想了解更多,这个来自微软的入门视频提供了对该语言创建原因、工作原理、使用方法以及未来发展方向的不错概述。

🌐 If you're new to TypeScript and want to learn more, this introductory video from Microsoft provides a nice overview of why the language was created, how it works, how to use it, and where it's headed.

官方 TypeScript 网站上还有一本手册和一个练习场

🌐 There's also a handbook and a playground on the official TypeScript website.

由于 TypeScript 是 JavaScript 的超集,你现有的 JavaScript 代码已经是有效的 TypeScript。这意味着你可以逐步将现有的 JavaScript 项目迁移到 TypeScript,根据需要逐步加入新的语言特性。

🌐 Because TypeScript is a superset of JavaScript, your existing JavaScript code is already valid TypeScript. This means you can gradually transition an existing JavaScript project to TypeScript, sprinkling in new language features as needed.

致谢

🌐 Thanks

这个项目如果没有 Electron 开源维护者社区的帮助是不可能实现的。感谢 Samuel AttardFelix RiesebergBirunthan MohanathasMilan BurdaBrendan Forster 以及其他许多人在修复漏洞、改进文档和技术指导方面的贡献。

🌐 This project would not have been possible without the help of Electron's community of open-source maintainers. Thanks to Samuel Attard, Felix Rieseberg, Birunthan Mohanathas, Milan Burda, Brendan Forster, and many others for their bug fixes, documentation improvements, and technical guidance.

支持

🌐 Support

如果你在使用 Electron 的新 TypeScript 定义文件时遇到任何问题,请在 electron-typescript-definitions 仓库中提交问题。

🌐 If you encounter any issues using Electron's new TypeScript definition files, please file an issue on the electron-typescript-definitions repository.

祝你 TypeScript 愉快!

🌐 Happy TypeScripting!

本周项目:Jasper

· 9 min read

本周我们采访了Jasper的创作者,这是一款基于Electron的GitHub通知管理工具。

🌐 This week we interviewed the creator of Jasper, an Electron-based tool for managing GitHub notifications.


你好!你是谁?

🌐 Hello! Who are you?

我是Ryo Maruyama,在日本的一个软件开发者。我正在开发JasperESDoc

🌐 I'm Ryo Maruyama, a software developer in Japan. I am developing Jasper and ESDoc.

什么是 Jasper?

🌐 What is Jasper?

Jasper 是一个灵活且功能强大的 GitHub 问题阅读器。它支持 github.com 和 GitHub Enterprise 上的问题和拉取请求。

Jasper 应用截图

为什么要这样做?

🌐 Why did you make it?

当人们在工作或开源项目活动中使用 GitHub 时,他们往往每天会收到大量通知。作为订阅通知的一种方式,GitHub 提供了电子邮件和网页通知。我使用这些功能有几年时间,但遇到了以下问题:

🌐 When people use GitHub in their job or OSS activities, they tend to receive many notifications on a daily basis. As a way to subscribe to the notifications, GitHub provides email and web notifications. I used these for a couple of years, but I faced the following problems:

  • 我很容易忽略别人提到我、我评论过或我正在关注的问题。
  • 我把一些问题记在脑子里,以便以后检查,但有时我会忘记它们。
  • 为了避免忘记问题,我会在浏览器中保持多个标签页打开。
  • 很难检查所有与我相关的问题。
  • 很难掌握团队的所有活动。

我花费了大量时间和精力来避免这些问题,因此我决定为 GitHub 创建一个问题阅读器来有效地解决这些问题,并开始开发 Jasper。

🌐 I was spending a lot of time and energy trying to prevent those problems, so I decided to make an issue reader for GitHub to solve these problems efficiently, and started developing Jasper.

谁在使用 Jasper?

🌐 Who's using Jasper?

Jasper 被多家公司中使用 GitHub 的开发者、设计师和经理使用。当然,一些开源软件开发者也在使用它。它也被 GitHub 的一些人使用!

🌐 Jasper is used by developers, designers, and managers in several companies that are using GitHub. Of course, some OSS developers also are using it. And it is also used by some people at GitHub!

Jasper 如何工作?

🌐 How does Jasper work?

一旦 Jasper 配置完成,屏幕会显示如下。从左到右,你可以看到“流列表”、“问题列表”和“问题内容”。

🌐 Once Jasper is configured, the following screen appears. From left to right, you can see "streams list", "issues list" and "issue body".

Jasper 启动界面

这个“流”是 Jasper 的核心功能。例如,如果你想查看“分配给 electron/electron 仓库中 @zeke 的问题”,你可以创建如下流:

🌐 This "stream" is the core feature of Jasper. For example, if you want to see "issues that are assigned to @zeke in the electron/electron repository", you create the following stream:

repo:electron/electron assignee:zeke is:issue

Jasper 启动屏幕 2

创建流并等待几秒钟后,你可以看到符合条件的问题。

🌐 After creating the stream and waiting for a few seconds, you can see the issues that meet the conditions.

Jasper 启动屏幕 3

我们能用流做什么?

🌐 What can we do with streams?

我将介绍哪些类型的条件可用于流。

🌐 I will introduce what kind of conditions can be used for stream.

用户和团队

🌐 Users and Teams

问题
mentions:cat mentions:dog提到用户 catdog 的问题
author:cat author:dog由用户 catdog 创建的问题
assignee:cat assignee:dog分配给 catdog 的问题
commenter:cat commenter:dogcatdog 评论过的问题
involves:cat involves:dog“涉及” catbob 的问题
team:animal/white-cat team:animal/black-dog提到 animal/white-catanimal/black-dog 的问题

involves 意思是 mentionauthorassigneecommenter

代码库和组织

🌐 Repositories and Organizations

进程问题
repo:cat/jump repo:dog/runcat/jumpdog/run 中的问题
org:electron user:cat user:dogelectroncatdog 中的问题

orguser 相同

属性

🌐 Attributes

问题
repo:cat/jump milestone:v1.0.0 milestone:v1.0.1cat/jump 中附加到 v1.0.0v1.0.1 的问题
repo:cat/jump label:bug label:blockercat/jump 中附加 bug blocker 的问题
electron OR atomshell包含 electronatomshell 的问题

审核状态

🌐 Review Status

问题
is:pr review:required需要在 cat/jump 中审核的问题
is:pr review-requested:catcat 请求审核的问题。
但这些还未被审核。
is:pr reviewed-by:cat已由 cat 审核的问题

正如你可能已经注意到的,通过查看这些内容,流可以使用 GitHub 的搜索查询。有关如何使用流和搜索查询的详细信息,请参阅以下网址。

🌐 As you may have noticed by looking at these, streams can use GitHub's search queries. For details on how to use streams and search queries, see the following URLs.

Jasper 还具有未读问题管理、未读评论管理、标记星标、通知更新、问题过滤、键盘快捷键等功能。

🌐 Jasper also has features for unread issue management, unread comment management, marking stars, notification updating, filtering issues, keyboard shortcuts, etc.

Jasper 是付费产品吗?它多少钱?

🌐 Is Jasper a paid product? How much does it cost?

Jasper 价格为 12 美元。不过你可以使用 免费试用版 试用 30 天。

🌐 Jasper is $12. However you can use the free trial edition for 30 days.

为什么选择在 Electron 上构建 Jasper?

🌐 Why did you choose to build Jasper on Electron?

我喜欢 Electron 的以下几个方面:

🌐 I like the following aspects of Electron:

  • 应用可以使用 JavaScript/CSS/HTML 开发。
  • 应用可以构建于 Windows、Mac 和 Linux 平台。
  • Electron 正在积极开发中,并拥有庞大的社区。

这些功能使桌面应用的开发快速且简单。太棒了!如果你有任何产品创意,你绝对应该考虑使用 Electron。

🌐 These features enable rapid and simple desktop application development. It is awesome! If you have any product idea, you should consider using Electron by all means.

在开发 Jasper 的进程中,你遇到了哪些挑战?

🌐 What are some challenges you've faced while developing Jasper?

我在理解“流”(stream)概念时遇到了很大困难。起初,我考虑使用 GitHub 的 [通知 API]。然而,我注意到它不支持某些使用场景。之后,我又考虑了结合通知 API 的 [问题 API] 和 [拉取请求 API]。但这始终不是我想要的。然后在思考各种方法时,我意识到轮询 GitHub 的 [搜索 API] 会提供最大的灵活性。经过大约一个月的实验才达到这一点,随后我在两天内实现了带有流概念的 Jasper 原型。

🌐 I had a hard time figuring out the "stream" concept. At first I considered using GitHub's Notifications API. However I noticed that it does not support certain use cases. After that I considered using the Issues API and Pull Requests API, in addition to the Notification API. But it never became what I wanted. Then while thinking about various methods, I realized that polling GitHub's Search API would offer the most flexibility. It took about a month of experimentation to get to this point, then I implemented a prototype of Jasper with the stream concept in two days.

注意:轮询最多每 10 秒进行一次。这对于 GitHub API 的限制来说已经足够了。

🌐 Note: The polling is limited to once every 10 seconds at most. This is acceptable enough for the restriction of GitHub API.

下一步计划是什么?

🌐 What's coming next?

我计划开发以下功能:

🌐 I have a plan to develop the following features:

  • 过滤流:一个流有一些过滤流,用于过滤流中的问题。它就像SQL中的视图。
  • 多个账户:你将能够同时使用 github.com 和 GHE
  • 提升性能:目前 WebView 的加载速度比普通浏览器慢。

在 Twitter 上关注 @jasperappio 获取更新。

🌐 Follow @jasperappio on Twitter for updates.

本周项目:WebTorrent

· 18 min read

本周,我们与@feross@dcposch聊了聊WebTorrent,这是一款由网络驱动的种子客户端,可以将用户连接在一起,形成一个分布式、去中心化的浏览器对浏览器网络。

🌐 This week we caught up with @feross and @dcposch to talk about WebTorrent, the web-powered torrent client that connects users together to form a distributed, decentralized browser-to-browser network.


什么是 WebTorrent?

🌐 What is WebTorrent?

WebTorrent 是第一个可以在浏览器中运行的种子客户端。它完全用 JavaScript 编写,并且可以使用 WebRTC 进行点对点传输。不需要浏览器插件、扩展或安装。

WebTorrent 使用开放的 Web 标准,将网站用户连接在一起,形成一个分布式、去中心化的浏览器到浏览器网络,以实现高效的文件传输。

🌐 Using open web standards, WebTorrent connects website users together to form a distributed, decentralized browser-to-browser network for efficient file transfer.

你可以在这里看到 WebTorrent 的演示:webtorrent.io

🌐 You can see a demo of WebTorrent in action here: webtorrent.io.

webtorrent homepage

为什么这很酷?

🌐 Why is this cool?

想象一个类似 YouTube 的视频网站,但访客会帮助托管网站的内容。使用 WebTorrent 技术的网站用户越多,它就越快,也越可靠。

🌐 Imagine a video site like YouTube, but where visitors help to host the site's content. The more people that use a WebTorrent-powered website, the faster and more resilient it becomes.

浏览器之间的通信省去了中间环节,让人们可以按照自己的方式进行交流。不再需要客户端/服务器——只是一个平等的点对点网络。WebTorrent 是重新去中心化网络旅程的第一步。

🌐 Browser-to-browser communication cuts out the middle-man and lets people communicate on their own terms. No more client/server – just a network of peers, all equal. WebTorrent is the first step in the journey to re-decentralize the Web.

Electron 在其中扮演什么角色?

🌐 Where does Electron come into the picture?

大约一年前,我们决定开发 WebTorrent Desktop,这是一个作为桌面应用运行的 WebTorrent 版本。

🌐 About one year ago, we decided to build WebTorrent Desktop, a version of WebTorrent that runs as a desktop app.

WebTorrent 桌面播放器窗口

我们创建 WebTorrent Desktop 有三个原因:

🌐 We created WebTorrent Desktop for three reasons:

  1. 我们想要一款简洁、轻量、无广告的开源种子应用。
  2. 我们想要一个能够良好支持流媒体的种子应用。
  3. 我们需要一个可以连接 BitTorrent 和 WebTorrent 网络的“混合客户端”

如果我们已经可以在 Web 浏览器中下载种子,为什么还要开发桌面应用?

🌐 If we can already download torrents in my web browser, why a desktop app?

首先,简单介绍一下 WebTorrent 的设计背景。

🌐 First, a bit of background on the design of WebTorrent.

webtorrent desktop logo

在早期,BitTorrent 使用 TCP 作为其传输协议。后来,uTP 出现了,承诺比 TCP 提供更好的性能和额外优势。每个主流的种子客户端最终都采用了 uTP,而如今你可以通过任一协议使用 BitTorrent。WebRTC 协议是下一个合乎逻辑的步骤。它带来了与网页浏览器互操作的可能性——一个由所有桌面 BitTorrent 客户端和数百万网页浏览器组成的庞大 P2P 网络。

🌐 In the early days, BitTorrent used TCP as its transport protocol. Later, uTP came along promising better performance and additional advantages over TCP. Every mainstream torrent client eventually adopted uTP, and today you can use BitTorrent over either protocol. The WebRTC protocol is the next logical step. It brings the promise of interoperability with web browsers – one giant P2P network made up of all desktop BitTorrent clients and millions of web browsers.

“网页节点”(在网页浏览器中运行的种子节点)通过增加数百万新的节点并将 BitTorrent 扩展到数十种新的使用场景,从而使 BitTorrent 网络更加强大。WebTorrent 尽可能严格地遵循 BitTorrent 规范,以便现有的 BitTorrent 客户端可以轻松添加对 WebTorrent 的支持。

一些像 Vuze 这样的种子应用已经支持网页端节点,但我们不想等其他应用去添加支持。所以基本上,WebTorrent Desktop 是我们加速 WebTorrent 协议普及的一种方式。 通过制作一个人们真正想使用的超棒种子应用,我们增加了网络中可以与网页端节点共享种子的节点数量(即网站上的用户)。

🌐 Some torrent apps like Vuze already support web peers, but we didn't want to wait around for the rest to add support. So basically, WebTorrent Desktop was our way to speed up the adoption of the WebTorrent protocol. By making an awesome torrent app that people really want to use, we increase the number of peers in the network that can share torrents with web peers (i.e. users on websites).

除了人们已知的功能之外,torrent 还有哪些有趣的用例?

🌐 What are some interesting use cases for torrents beyond what people already know they can do?

WebTorrent 最令人兴奋的用途之一是对等辅助传输。像 维基百科互联网档案馆 这样的非营利项目可以通过让访问者参与来减少带宽和托管成本。热门内容可以通过浏览器间直接传输,快速且廉价。很少访问的内容则可以通过 HTTP 从源服务器可靠地提供。

🌐 One of the most exciting uses for WebTorrent is peer-assisted delivery. Non-profit projects like Wikipedia and the Internet Archive could reduce bandwidth and hosting costs by letting visitors chip in. Popular content can be served browser-to-browser, quickly and cheaply. Rarely-accessed content can be served reliably over HTTP from the origin server.

互联网档案馆实际上已经更新了他们的种子文件,使其可以很好地与 WebTorrent 配合使用。因此,如果你想在你的网站上嵌入互联网档案馆的内容,你可以以一种减少档案馆托管成本的方式来做,从而让他们能够将更多资金用于真正的网络档案保存!

🌐 The Internet Archive actually already updated their torrent files so they work great with WebTorrent. So if you want to embed Internet Archive content on your site, you can do it in a way that reduces hosting costs for the Archive, allowing them to devote more money to actually archiving the web!

还有一些令人兴奋的商业用例,从 CDN 到通过 P2P 交付应用。

🌐 There are also exciting business use cases, from CDNs to app delivery over P2P.

你最喜欢的使用 WebTorrent 的项目有哪些?

🌐 What are some of your favorite projects that use WebTorrent?

gaia app screenshot

用 WebTorrent 构建的最酷的东西,毫无疑问,可能是 Gaia 3D 星图。它是一个流畅的 3D 交互式银河系模拟。数据通过 torrent 在你的浏览器中加载。飞越我们的恒星系统时,你会被震撼,同时意识到与宇宙的浩瀚相比,我们人类是多么渺小。

🌐 The coolest thing built with WebTorrent, hands down, is probably Gaia 3D Star Map. It's a slick 3D interactive simulation of the Milky Way. The data loads from a torrent, right in your browser. It's awe-inspiring to fly through our star system and realize just how little we humans are compared to the vastness of our universe.

你可以在《Torrenting The Galaxy》(https://medium.com/@flimshaw/torrenting-the-galaxy-extracting-2-million-3d-stars-from-180gb-of-csvs-457ff70c0f93) 中阅读这篇作品的制作进程,这是一篇博客文章,作者 Charlie Hoey 讲解了他是如何用 WebGL 和 WebTorrent 构建这张星图的。

🌐 You can read about how this was made in Torrenting The Galaxy, a blog post where the author, Charlie Hoey, explains how he built the star map with WebGL and WebTorrent.

brave logo

我们也是 Brave 的超级粉丝。Brave 是一款可以自动阻止广告和追踪器的浏览器,从而让网页加载更快、更安全。Brave 最近增加了对种子文件的支持,因此你可以 在不使用单独应用的情况下查看传统种子。该功能由 WebTorrent 提供支持。

🌐 We're also huge fans of Brave. Brave is a browser that automatically blocks ads and trackers to make the web faster and safer. Brave recently added torrent support, so you can view traditional torrents without using a separate app. That feature is powered by WebTorrent.

所以,就像大多数浏览器可以渲染 PDF 文件一样,Brave 也可以渲染磁力链接和种子文件。它们只是浏览器本地支持的另一种内容类型。

🌐 So, just like how most browsers can render PDF files, Brave can render magnet links and torrent files. They're just another type of content that the browser natively supports.

Brave 的联合创始人之一实际上是 Brendan Eich,他是 JavaScript 的创造者,而 JavaScript 正是我们编写 WebTorrent 所用的语言,因此我们认为 Brave 选择集成 WebTorrent 非常酷。

🌐 One of the co-founders of Brave is actually Brendan Eich, the creator of JavaScript, the language we wrote WebTorrent in, so we think it's pretty cool that Brave chose to integrate WebTorrent.

为什么选择在 Electron 上构建 WebTorrent 桌面?

🌐 Why did you choose to build WebTorrent Desktop on Electron?

WebTorrent Desktop main window

有一种说法认为 Electron 应用很“臃肿”,因为它们在每个应用中都包含了完整的 Chrome 内容模块。在某些情况下,这在一定程度上是正确的(Electron 应用的安装包通常约为 40MB,而特定操作系统的应用安装包通常约为 20MB)。

🌐 There is a meme that Electron apps are "bloated" because they include the entire Chrome content module in every app. In some cases, this is partially true (an Electron app installer is usually ~40MB, where an OS-specific app installer is usually ~20MB).

然而,在 WebTorrent Desktop 的情况下,我们几乎使用了每一个 Electron 功能,并且在正常操作进程中使用了许多 Chrome 功能。如果我们想为每个平台从零实现这些功能,开发我们的应用将需要多几个月甚至数年的时间,或者我们只能发布单个平台版本。

🌐 However, in the case of WebTorrent Desktop, we use nearly every Electron feature, and many dozens of Chrome features in the course of normal operation. If we wanted to implement these features from scratch for each platform, it would have taken months or years longer to build our app, or we would have only been able to release for a single platform.

只是为了让大家了解,我们使用了 Electron 的 dock 集成(显示下载进度)、菜单栏集成(在后台运行)、协议处理器注册(打开磁力链接)、防止休眠(在视频播放时防止休眠)以及 自动更新。至于 Chrome 的功能,我们也用了很多:<video> 标签(播放多种视频格式)、<track> 标签(支持字幕)、拖放支持,以及 WebRTC(在原生应用中使用起来并不简单)。

🌐 Just to get an idea, we use Electron's dock integration (to show download progress), menu bar integration (to run in the background), protocol handler registration (to open magnet links), power save blocker (to prevent sleep during video playback), and automatic updater. As for Chrome features, we use plenty: the <video> tag (to play many different video formats), the <track> tag (for closed captions support), drag-and-drop support, and WebRTC (which is non-trivial to use in a native app).

更不用说:我们的种子引擎是用 JavaScript 编写的,并假设存在大量 Node API,尤其是用于 TCP 和 UDP 套接字支持的 require('net')require('dgram')

🌐 Not to mention: our torrent engine is written in JavaScript and assumes the existence of lots of Node APIs, but especially require('net') and require('dgram') for TCP and UDP socket support.

基本上,Electron 正是我们所需要的,它拥有我们在创纪录的时间内交付一个稳定、精致的应用所需的全部功能。

🌐 Basically, Electron is just what we needed and had the exact set of features we needed to ship a solid, polished app in record time.

你最喜欢 Electron 的哪些方面?

🌐 What are your favorite things about Electron?

WebTorrent 库作为一个开源副项目已经开发了两年。我们在四周内完成了 WebTorrent Desktop。 Electron 是我们能够如此快速构建和发布应用的主要原因。

🌐 The WebTorrent library has been in development as an open source side project for two years. We made WebTorrent Desktop in four weeks. Electron is the primary reason that we were able to build and ship our app so quickly.

正如 Node.js 让使用 jQuery 的前端程序员能够轻松进行服务器编程一样,Electron 让熟悉 Web 或 Node.js 开发的任何人都可以进行原生应用开发。Electron 极具赋能性。

🌐 Just as Node.js made server programming accessible to a generation of jQuery-using front-end programmers, Electron makes native app development accessible to anyone familiar with Web or Node.js development. Electron is extremely empowering.

网站和桌面客户端共享代码吗?

🌐 Do the website and the Desktop client share code?

是的,webtorrent npm 包 可以在 Node.js、浏览器和 Electron 中运行。完全相同的代码可以在所有环境中执行——这就是 JavaScript 的魅力所在。它是当今的通用运行时。Java 小程序曾承诺“编写一次,处处运行”,但由于各种原因,这一愿景从未真正实现。相比其他平台,Electron 实际上最接近这一理想。

🌐 Yes, the webtorrent npm package works in Node.js, in the browser, and in Electron. The exact same code can run in all environments – this is the beauty of JavaScript. It's today's universal runtime. Java Applets promised "Write Once, Run Anywhere" apps, but that vision never really materialized for a number of reasons. Electron, more than any other platform, actually gets pretty darn close to that ideal.

在构建 WebTorrent 时,你遇到了哪些挑战?

🌐 What are some challenges you've faced while building WebTorrent?

在应用的早期版本中,我们在提升用户界面性能方面遇到了困难。我们将种子引擎放在与主应用窗口绘制相同的渲染进程中,结果不出意外,每当种子引擎进行大量 CPU 活动(例如验证从节点接收到的种子块)时,应用就会变得很慢。

🌐 In early versions of the app, we struggled to make the UI performant. We put the torrent engine in the same renderer process that draws the main app window which, predictably, led to slowness anytime there was intense CPU activity from the torrent engine (like verifying the torrent pieces received from peers).

我们通过将种子引擎移到第二个不可见的渲染进程来解决这个问题,我们通过IPC与该进程进行通信。这样,如果该进程短时间内使用大量 CPU,UI 线程也不会受到影响。流畅的滚动和动画非常令人满意。

🌐 We fixed this by moving the torrent engine to a second, invisible renderer process that we communicate with over IPC. This way, if that process briefly uses a lot of CPU, the UI thread will be unaffected. Buttery-smooth scrolling and animations are so satisfying.

注意:我们不得不将种子引擎放在渲染进程中,而不是“主”进程中,因为我们需要访问 WebRTC(它只在渲染进程中可用)。

🌐 Note: we had to put the torrent engine in a renderer process, instead of a "main" process, because we need access to WebRTC (which is only available in the renderer.)

Electron 应该在哪些方面改进?

🌐 In what areas should Electron be improved?

我们非常希望看到更好的关于如何构建和发布生产就绪应用的文档,尤其是像代码签名和自动更新这样棘手的话题。我们不得不通过研究源代码和在推特上询问来了解最佳实践!

🌐 One thing we'd love to see is better documentation about how to build and ship production-ready apps, especially around tricky subjects like code signing and auto-updating. We had to learn about best practices by digging into source code and asking around on Twitter!

WebTorrent 桌面版完成了吗?如果还没完成,接下来会有什么更新?

🌐 Is WebTorrent Desktop done? If not, what's coming next?

我们认为当前版本的 WebTorrent Desktop 非常出色,但总有改进的空间。我们目前正在努力改进界面细节、性能、字幕支持以及视频编码支持。

🌐 We think the current version of WebTorrent Desktop is excellent, but there's always room for improvement. We're currently working on improving polish, performance, subtitle support, and video codec support.

如果你有兴趣参与这个项目,可以查看我们的 GitHub 页面

🌐 If you're interested in getting involved in the project, check out our GitHub page!

有哪些 Electron 开发技巧可能对其他开发者有用?

🌐 Any Electron development tips that might be useful to other developers?

Feross,WebTorrent Desktop的贡献者之一,最近在NodeConf阿根廷大会上做了题为《现实世界的Electron:使用JavaScript构建跨平台桌面应用》的演讲,其中包含发布高质量Electron应用的实用技巧。如果你正处在已经有了一个基本可运行应用,并且希望将其提升到更高的精致度和专业水平的阶段,这次演讲特别有用。

在这里观看:

幻灯片在这里

DC,另一位 WebTorrent 贡献者,写了一份可以让你的应用看起来更专业、更原生的清单。它包含代码示例,并涵盖了 macOS 停靠栏整合、拖放、桌面通知,以及确保应用快速加载等内容。

触控栏支持

· 4 min read

Electron 1.6.3 测试版包含对 macOS [触控栏] 的初步支持。

🌐 The Electron 1.6.3 beta release contains initial support for the macOS Touch Bar.


新的 Touch Bar API 允许你添加按钮、标签、弹出窗口、颜色选择器、滑块和间隔符。这些元素可以动态更新,并且在与之交互时也会触发事件。

🌐 The new Touch Bar API allows you to add buttons, labels, popovers, color pickers, sliders, and spacers. These elements can be dynamically updated and also emit events when they are interacted with.

这是该 API 的第一个版本,因此它将在接下来的几个 Electron 版本中不断发展。请查看发行说明以获取更多更新,并针对任何问题或缺失的功能提交问题

🌐 This is the first release of this API so it will be evolving over the next few Electron releases. Please check out the release notes for further updates and open issues for any problems or missing functionality.

你可以通过 npm install electron@beta 安装此版本,并在 TouchBarBrowserWindow Electron 文档中了解更多信息。

🌐 You can install this version via npm install electron@beta and learn more about it in the TouchBar and BrowserWindow Electron docs.

非常感谢 @MarshallOfSound 为 Electron 做出贡献。🎉

🌐 Big thanks to @MarshallOfSound for contributing this to Electron. 🎉

Touch Bar 示例

🌐 Touch Bar Example

Touch Bar Gif

下面是一个在触控栏上创建简单老虎机游戏的示例。它演示了如何创建触控栏、设置项目样式、将其与窗口关联、处理按钮点击事件以及动态更新标签。

🌐 Below is an example of creating a simple slot machine game in the touch bar. It demonstrates how to create a touch bar, style the items, associate it with a window, handle button click events, and update the labels dynamically.

const { app, BrowserWindow, TouchBar } = require('electron');

const { TouchBarButton, TouchBarLabel, TouchBarSpacer } = TouchBar;

let spinning = false;

// Reel labels
const reel1 = new TouchBarLabel();
const reel2 = new TouchBarLabel();
const reel3 = new TouchBarLabel();

// Spin result label
const result = new TouchBarLabel();

// Spin button
const spin = new TouchBarButton({
label: '🎰 Spin',
backgroundColor: '#7851A9',
click: () => {
// Ignore clicks if already spinning
if (spinning) {
return;
}

spinning = true;
result.label = '';

let timeout = 10;
const spinLength = 4 * 1000; // 4 seconds
const startTime = Date.now();

const spinReels = () => {
updateReels();

if (Date.now() - startTime >= spinLength) {
finishSpin();
} else {
// Slow down a bit on each spin
timeout *= 1.1;
setTimeout(spinReels, timeout);
}
};

spinReels();
},
});

const getRandomValue = () => {
const values = ['🍒', '💎', '7️⃣', '🍊', '🔔', '⭐', '🍇', '🍀'];
return values[Math.floor(Math.random() * values.length)];
};

const updateReels = () => {
reel1.label = getRandomValue();
reel2.label = getRandomValue();
reel3.label = getRandomValue();
};

const finishSpin = () => {
const uniqueValues = new Set([reel1.label, reel2.label, reel3.label]).size;
if (uniqueValues === 1) {
// All 3 values are the same
result.label = '💰 Jackpot!';
result.textColor = '#FDFF00';
} else if (uniqueValues === 2) {
// 2 values are the same
result.label = '😍 Winner!';
result.textColor = '#FDFF00';
} else {
// No values are the same
result.label = '🙁 Spin Again';
result.textColor = null;
}
spinning = false;
};

const touchBar = new TouchBar([
spin,
new TouchBarSpacer({ size: 'large' }),
reel1,
new TouchBarSpacer({ size: 'small' }),
reel2,
new TouchBarSpacer({ size: 'small' }),
reel3,
new TouchBarSpacer({ size: 'large' }),
result,
]);

let window;

app.once('ready', () => {
window = new BrowserWindow({
frame: false,
titleBarStyle: 'hidden-inset',
width: 200,
height: 200,
backgroundColor: '#000',
});
window.loadURL('about:blank');
window.setTouchBar(touchBar);
});

本周项目:Voltra

· 11 min read

本周我们与Aprile ElcichPaolo Fragomeni会面,讨论了Voltra,这是一款基于Electron的音乐播放器。

🌐 This week we met with Aprile Elcich and Paolo Fragomeni to talk about Voltra, an Electron-powered music player.


什么是 Voltra?

🌐 What is Voltra?

Voltra 是一款面向希望拥有自己音乐的人的音乐播放器。它还是一个商店,你可以根据已有的音乐发现并购买新音乐。它无广告,支持桌面和移动跨平台使用,并且不会监视你的行为。

voltra-artistview

Voltra 适合谁?

🌐 Who is Voltra for?

任何听音乐的人。

🌐 Anyone who listens to music.

是什么促使你创建 Voltra?

🌐 What motivated you to create Voltra?

单选框一直拥有大量听众。它正在从传统广播转向互联网。现在你可以按需租赁音乐——这是单选框的复兴!由于这一变化,许多新产品和服务应运而生,但流媒体广播仍然让别人控制你的音乐以及你体验音乐的方式。

🌐 Radio has has always had a big share of listeners. It’s moving off the airwaves and onto the Internet. Now you can rent music on demand — it’s a radio revival! A lot of new products and services have emerged because of this, but streaming radio still leaves someone else in control of your music and how you experience it.

我们希望有一款完全专注于你拥有的音乐的产品。一款可以轻松发现音乐并直接从艺术家或唱片公司购买新音乐的产品。

🌐 We wanted a product that was entirely focused on music you own. Something that made it easy to discover and buy new music directly from artists or labels.

有免费版本吗?

🌐 Is there a free version?

桌面播放器完全免费。出售你的音乐也免费! 我们不依赖广告收入。

🌐 The desktop player is completely free. Selling your music is also free! We are not ad-supported.

由于该应用是免费的,我们以后可能会开源它。目前我们没有精力来管理这件事。我们对功能和发展方向有非常具体的想法。我们有一个活跃的测试社区,并且非常重视他们的反馈。

🌐 Since the app is free, we may open source it later on. Right now we don’t have the bandwidth to manage that. We also have very specific ideas for features and the direction we want to take things. We have an active beta community and we take our feedback to heart.

你们如何盈利?

🌐 How do you make money?

我们有高级功能!

🌐 We have premium features!

我们的 Voltra 音频档案 是专为音乐设计的云备份服务。我们不会压缩或共享数据块。你的音乐收藏会得到物理备份。

🌐 Our Voltra Audio Archive is a cloud-backup service designed specifically for music. We don’t compress or share data blocks. Your music collection is physically backed up for you.

对于艺术家和唱片公司,我们的 Pro 会员 提供工具,帮助他们触及更多相关的观众,例如分析工具和专业艺术家网页。

🌐 For artists and labels, our Pro Membership offers tools to help them reach more relevant audiences, such as analytics and professional artist webpages.

Voltra 有何不同?

🌐 What makes Voltra different?

设计和可用性对我们来说非常重要。我们希望为听众提供无干扰的聆听体验!市面上有一些有趣的音乐播放器和商店,但它们中的许多比其创造者意识到的要复杂和难用。我们希望让尽可能多的人都能使用 Voltra。

🌐 Design and usability are incredibly important to us. We want to give listeners a distraction-free listening experience! There are a some interesting music players and stores out there. But many of them are more advanced and harder to use than their creators realize. We want to make Voltra accessible to as many people as possible.

我们也不会从艺术家或唱片公司那里抽成。这是我们的一个重要区别点。这一点非常重要,因为它降低了艺术家将音乐推向市场的门槛。

🌐 We also don't take a cut from the artist or the label. That’s a key differentiator for us. It’s really important because it lowers the barrier for artists to get their music to market.

你做出了哪些设计和技术决策?

🌐 What are some design & technical decisions you made?

在设计 Voltra 时,我们参考了原生应用和网页的界面惯例,同时也仔细考虑了可以去掉的部分。我们有一个活跃的私有测试组,过去几个月里他们给了我们重要的反馈。

🌐 While designing Voltra, we considered UI conventions from native apps and the web, we also thought a lot about what we could remove. We have an active private beta group who have given us critical feedback over the last few months.

我们发现专辑封面和摄影对人们来说非常重要。许多播放器只是文件列表。拥有实体专辑的一个很酷的地方是专辑封面,我们希望在 Voltra 桌面应用中强调这一点。

🌐 We found that album art and photography are really important to people. Many players are just lists of files. One of the cool things about owning physical albums is the album art, and we wanted to put emphasis on this in the Voltra desktop app.

voltra-albumview

我们还确保不干扰用户的文件。我们使用文件监控,所以你可以将文件放在任何你想放的位置,我们不会为你重命名或移动文件。我们有一个嵌入式数据库来跟踪被监控目录的状态,因此即使程序没有运行,我们也能跟踪新文件。

🌐 We also made sure not to mess with people's files. We use file watching so you can put your files wherever you want, and we don't rename them or move them for you. We have an embedded database to track the state of the watched directories so that we can track what's new, even when the process isn't running.

在构建 Voltra 时,你遇到了哪些挑战?

🌐 What are some challenges you've faced while building Voltra?

我们花了很多时间关注性能。我们起初使用框架,但后来转向了原生 JavaScript。根据我们的经验,它们提供的通用抽象优势大于它们带来的性能损耗和繁琐的使用进程。

🌐 We spend a lot of time focused on performance. We started with frameworks but moved to vanilla Javascript. In our experience, the generalized abstractions they provide outweigh the performance penalties and ceremony that they introduce.

我们现在可以很好地处理非常大的收藏。大收藏可能意味着成千上万张图片!由于在渲染进程中可以直接使用 Node.js 的文件系统模块,这使得根据 DOM 事件快速延迟加载和卸载大量图片变得非常容易。

🌐 We handle very large collections pretty well at this point. Large collections means possibly tens of thousands of images! Having Node.js’ file system module directly available from the render process made it really easy to lazy load and unload lots of images super quickly based on DOM events.

一般来说,setImmediaterequestIdleCallback 一直是执行大量处理同时保持 UI 响应的重要工具。更具体地说,将 CPU 密集型任务分配到独立的进程中确实有助于保持用户界面的响应性。例如,我们将实际的音频上下文移到一个独立的进程中,通过 IPC 与其通信,以避免因繁忙的 UI 而可能出现的中断。

🌐 In general setImmediate and requestIdleCallback have been super important tools for performing lots of processing while keeping the UI responsive. More specifically, distributing CPU-bound tasks into separate processes really helps to keep the user interface responsive. For example, we moved the actual audio context into a separate process, communicating with it over IPC to avoid potential interruptions from a busy UI.

为什么选择在 Electron 上构建 Voltra?

🌐 Why did you choose to build Voltra on Electron?

浏览器的沙箱对我们的应用来说限制太多。但我们也在开发一个网页播放器。因此,几乎可以在两种实现之间共享 100% 的代码,这是一个巨大的胜利。

🌐 The browser’s sandbox is too restricted for our app. But we are also developing a web player. So it’s a huge win that we can share almost 100% of the code between the two implementations.

我们最初是用 Swift 开发原生应用。我们发现的主要问题是,我们重复造了很多轮子。网络拥有世界上最大的开源生态系统。因此,我们很快就转向了使用 Electron。

🌐 We actually started by building a native app with Swift. The main problem we found was that we were reinventing a lot of things. The web has the world’s largest open source eco-system. So we pretty quickly switched to Electron.

此外,最重要的是,使用 Electron 你只需开发一次,它就应该能在所有主要平台上正常运行™。虽然不能保证绝对无误,但为每个平台进行原生编码的成本肯定超过 Electron 所引入的其他任何成本。

🌐 Also, and most importantly, with Electron you develop once and it should Just Work™ on all the major platforms. It’s not guaranteed, but the cost of coding natively for each platform definitely outweighs any other costs that electron introduces.

你最喜欢 Electron 的哪些方面?

🌐 What are your favorite things about Electron?

太棒了!:将 Node.js 的网络栈和 Chromium 的呈现层打包在一起,是高效完成任务的秘诀。

能力:这只是网络技术栈,所以我们整个团队实际上都参与了产品的开发。

社区:有一个高度有组织的社区,他们非常善于沟通!有了这样的支持,我们在开发进程中感觉非常棒。

Electron 可以在哪些方面改进?

🌐 In what areas could Electron be improved?

我们希望看到 Electron 支持一个统一的打包工具。这个打包工具对于 Electron 的重要性,相当于包管理器对 Node 的重要性。用户社区中有多个打包工具,每个工具都有其有趣的特性,但也各有缺陷。社区达成共识将有助于引导贡献者的精力投入方向。

🌐 We would like to see Electron endorse a single packager. The packager is as important to Electron what the package manager is to Node. There are multiple packagers in user-land, each with interesting features but each with bugs. Consensus by the community would help to direct the energy being spent by contributors.

下一步计划是什么?

🌐 What's coming next?

我们目前正在开发一款移动应用,并与艺术家和唱片公司合作,将他们的音乐加入 Voltra 商店。嘿!如果你是艺术家或唱片公司,立即注册吧!我们计划在达成一千万首曲目的目标后开放商店。

🌐 We‘re currently developing a mobile app, and working with artists and labels to add their music to the Voltra shop. Hey! If you’re an artist or label, sign up now! We plan on opening up the shop when we reach our goal of 10 million tracks.

Electron 内部原理:将 Chromium 构建为库

· 14 min read

Electron基于谷歌的开源项目Chromium,而Chromium本身并不一定是为了被其他项目使用而设计的。本文介绍了Chromium如何被构建为供Electron使用的库,以及其构建系统多年来的发展演变。

🌐 Electron is based on Google's open-source Chromium, a project that is not necessarily designed to be used by other projects. This post introduces how Chromium is built as a library for Electron's use, and how the build system has evolved over the years.


使用 CEF

🌐 Using CEF

Chromium 嵌入式框架(CEF)是一个将 Chromium 转换为库的项目,并提供基于 Chromium 代码库的稳定 API。Atom 编辑器和 NW.js 的非常早期版本曾使用过 CEF。

🌐 The Chromium Embedded Framework (CEF) is a project that turns Chromium into a library, and provides stable APIs based on Chromium's codebase. Very early versions of Atom editor and NW.js used CEF.

为了保持稳定的 API,CEF 隐藏了 Chromium 的所有细节,并用自己的接口封装了 Chromium 的 API。因此,当我们需要访问底层的 Chromium API,比如将 Node.js 集成到网页中时,CEF 的优势反而成了障碍。

🌐 To maintain a stable API, CEF hides all the details of Chromium and wraps Chromium's APIs with its own interface. So when we needed to access underlying Chromium APIs, like integrating Node.js into web pages, the advantages of CEF became blockers.

所以到最后,Electron 和 NW.js 都直接改用 Chromium 的 API。

🌐 So in the end both Electron and NW.js switched to using Chromium's APIs directly.

作为 Chromium 的一部分构建

🌐 Building as part of Chromium

尽管 Chromium 官方不支持外部项目,但其代码库是模块化的,并且很容易基于 Chromium 构建一个最小化浏览器。提供浏览器接口的核心模块称为内容模块(Content Module)。

🌐 Even though Chromium does not officially support outside projects, the codebase is modular and it is easy to build a minimal browser based on Chromium. The core module providing the browser interface is called Content Module.

要使用内容模块开发项目,最简单的方法是将项目作为 Chromium 的一部分进行构建。这可以通过首先检出 Chromium 的源代码,然后将项目添加到 Chromium 的 DEPS 文件中来完成。

🌐 To develop a project with Content Module, the easiest way is to build the project as part of Chromium. This can be done by first checking out Chromium's source code, and then adding the project to Chromium's DEPS file.

NW.js 和 Electron 的早期版本都使用这种方式进行构建。

🌐 NW.js and very early versions of Electron are using this way for building.

缺点是,Chromium 的代码库非常庞大,需要非常强大的机器才能编译。对于普通注意本电脑,这可能需要超过 5 小时。因此,这大大影响了能够为该项目做出贡献的开发者数量,也使开发速度变慢。

🌐 The downside is, Chromium is a very large codebase and requires very powerful machines to build. For normal laptops, that can take more than 5 hours. So this greatly impacts the number of developers that can contribute to the project, and it also makes development slower.

将 Chromium 构建为单个共享库

🌐 Building Chromium as a single shared library

作为 Content 模块的用户,在大多数情况下 Electron 不需要修改 Chromium 的代码,所以一个明显的方法来改进 Electron 的构建是将 Chromium 构建为共享库,然后在 Electron 中链接它。这样开发者在为 Electron 做贡献时就不再需要重新构建整个 Chromium。

🌐 As a user of Content Module, Electron does not need to modify Chromium's code under most cases, so an obvious way to improve the building of Electron is to build Chromium as a shared library, and then link with it in Electron. In this way developers no longer need to build all off Chromium when contributing to Electron.

libchromiumcontent 项目是由 @aroben 为此目的创建的。它将 Chromium 的内容模块构建为共享库,并提供 Chromium 的头文件和预构建的二进制文件供下载。libchromiumcontent 初始版本的代码可以在 在这个链接中 找到。

🌐 The libchromiumcontent project was created by @aroben for this purpose. It builds the Content Module of Chromium as a shared library, and then provides Chromium's headers and prebuilt binaries for download. The code of the initial version of libchromiumcontent can be found in this link.

brightray 项目也是作为 libchromiumcontent 的一部分诞生的,该项目在内容模块周围提供了一层薄薄的封装层。

🌐 The brightray project was also born as part of libchromiumcontent, which provides a thin layer around Content Module.

通过同时使用 libchromiumcontent 和 brightray,开发者可以快速构建浏览器,而无需深入了解 Chromium 的构建细节。同时,它也消除了构建该项目对高速网络和高性能计算机的需求。

🌐 By using libchromiumcontent and brightray together, developers can quickly build a browser without getting into the details of building Chromium. And it removes the requirement of a fast network and powerful machine for building the project.

除了 Electron,还有其他基于 Chromium 的项目以这种方式构建,比如 Breach 浏览器

🌐 Apart from Electron, there were also other Chromium-based projects built in this way, like the Breach browser.

过滤导出的符号

🌐 Filtering exported symbols

在 Windows 上,一个共享库可以导出的符号数量是有限制的。随着 Chromium 代码库的增长,libchromiumcontent 导出的符号数量很快就超过了这个限制。

🌐 On Windows there is a limitation of how many symbols one shared library can export. As the codebase of Chromium grew, the number of symbols exported in libchromiumcontent soon exceeded the limitation.

解决方法是在生成 DLL 文件时过滤掉不需要的符号。它通过 向链接器提供一个 .def 文件 工作,然后使用脚本来 判断命名空间下的符号是否应被导出

🌐 The solution was to filter out unneeded symbols when generating the DLL file. It worked by providing a .def file to the linker, and then using a script to judge whether symbols under a namespace should be exported.

通过采取这种方法,尽管 Chromium 不断添加新的导出符号,libchromiumcontent 仍然可以通过剥离更多符号来生成共享库文件。

🌐 By taking this approach, though Chromium kept adding new exported symbols, libchromiumcontent could still generate shared library files by stripping more symbols.

组件构建

🌐 Component build

在讨论 libchromiumcontent 的下一步操作之前,首先有必要介绍一下 Chromium 中的组件构建概念。

🌐 Before talking about the next steps taken in libchromiumcontent, it is important to introduce the concept of component build in Chromium first.

作为一个庞大的项目,在 Chromium 中构建时链接步骤需要很长时间。通常,当开发者做一个小改动时,看到最终输出可能需要 10 分钟。为了解决这个问题,Chromium 引入了组件构建,它将 Chromium 中的每个模块构建为独立的共享库,因此在最终链接步骤中所花费的时间变得可以忽略不计。

🌐 As a huge project, the linking step takes very long in Chromium when building. Normally when a developer makes a small change, it can take 10 minutes to see the final output. To solve this, Chromium introduced component build, which builds each module in Chromium as separated shared libraries, so the time spent in the final linking step becomes unnoticeable.

发送原始二进制文件

🌐 Shipping raw binaries

随着 Chromium 的持续发展,Chromium 中导出的符号数量非常多,以至于即使是 Content 模块和 Webkit 的符号也超过了限制。仅仅通过剥离符号是不可能生成可用的共享库的。

🌐 With Chromium continuing to grow, there were so many exported symbols in Chromium that even the symbols of Content Module and Webkit were more than the limitation. It was impossible to generate a usable shared library by simply stripping symbols.

最终,我们不得不 发送 Chromium 的原始二进制文件,而不是生成一个单独的共享库。

🌐 In the end, we had to ship the raw binaries of Chromium instead of generating a single shared library.

如前所述,Chromium 有两种构建模式。因此,由于需要发布原始二进制文件,我们必须在 libchromiumcontent 中发布两种不同的二进制分发版本。一种称为 static_library 构建,它包含 Chromium 正常构建生成的每个模块的所有静态库。另一种是 shared_library,它包含组件构建生成的每个模块的所有共享库。

🌐 As introduced earlier there are two build modes in Chromium. As a result of shipping raw binaries, we have to ship two different distributions of binaries in libchromiumcontent. One is called static_library build, which includes all static libraries of each module generated by the normal build of Chromium. The other is shared_library, which includes all shared libraries of each module generated by the component build.

在 Electron 中,调试版本链接的是 shared_library 版本的 libchromiumcontent,因为它下载体积小,且在链接最终可执行文件时耗时短。而 Electron 的发布版本则链接的是 static_library 版本的 libchromiumcontent,因此编译器可以生成完整的符号,这对于调试非常重要,同时链接器能够进行更好的优化,因为它知道哪些目标文件是需要的,哪些是不需要的。

🌐 In Electron, the Debug version is linked with the shared_library version of libchromiumcontent, because it is small to download and takes little time when linking the final executable. And the Release version of Electron is linked with the static_library version of libchromiumcontent, so the compiler can generate full symbols which are important for debugging, and the linker can do much better optimization since it knows which object files are needed and which are not.

所以对于正常开发,开发者只需要构建调试版本,这不需要良好的网络或高性能的机器。虽然发布版本需要更好的硬件来构建,但它可以生成更优化的二进制文件。

🌐 So for normal development, developers only need to build the Debug version, which does not require a good network or powerful machine. Though the Release version then requires much better hardware to build, it can generate better optimized binaries.

gn 更新

🌐 The gn update

作为世界上最大的项目之一,大多数普通系统不适合构建 Chromium,因此 Chromium 团队开发了自己的构建工具。

🌐 Being one of the largest projects in the world, most normal systems are not suitable for building Chromium, and the Chromium team develops their own build tools.

早期版本的 Chromium 使用 gyp 作为构建系统,但它存在速度慢的问题,对于复杂项目,其配置文件也变得难以理解。经过多年的开发,Chromium 切换到了 gn 作为构建系统,它速度更快且具有清晰的架构。

🌐 Earlier versions of Chromium were using gyp as a build system, but it suffers from being slow, and its configuration file becomes hard to understand for complex projects. After years of development, Chromium switched to gn as a build system, which is much faster and has a clear architecture.

gn 的一个改进是引入 source_set,它表示一组目标文件。在 gyp 中,每个模块要么由 static_library 表示,要么由 shared_library 表示,对于 Chromium 的常规构建,每个模块会生成一个静态库,并在最终可执行文件中链接在一起。通过使用 gn,每个模块现在只生成一堆目标文件,最终可执行文件只是将所有目标文件链接在一起,因此不再生成中间的静态库文件。

🌐 One of the improvements of gn is to introduce source_set, which represents a group of object files. In gyp, each module was represented by either static_library or shared_library, and for the normal build of Chromium, each module generated a static library and they were linked together in the final executable. By using gn, each module now only generates a bunch of object files, and the final executable just links all the object files together, so the intermediate static library files are no longer generated.

然而,这种改进给 libchromiumcontent 带来了很大麻烦,因为 libchromiumcontent 实际上需要这些中间的静态库文件。

🌐 This improvement however made great trouble to libchromiumcontent, because the intermediate static library files were actually needed by libchromiumcontent.

解决这个问题的第一次尝试是使用 修补 gn 以生成静态库文件,虽然它解决了问题,但离一个体面的解决方案还差得远。

🌐 The first try to solve this was to patch gn to generate static library files, which solved the problem, but was far from a decent solution.

@alespergl进行了第二次尝试,针对从对象文件列表生成自定义静态库。 它使用了一种技巧,先运行一个虚拟构建以收集生成的对象文件列表,然后通过将列表提供给gn来实际构建静态库。它对Chromium的源代码只做了最小的修改,并保持了Electron的构建架构不变。

🌐 The second try was made by @alespergl to produce custom static libraries from the list of object files. It used a trick to first run a dummy build to collect a list of generated object files, and then actually build the static libraries by feeding gn with the list. It only made minimal changes to Chromium's source code, and kept Electron's building architecture still.

概括

🌐 Summary

正如你所见,与作为 Chromium 一部分来构建 Electron 相比,将 Chromium 构建为一个库需要更多的努力并持续进行维护。然而,后者取消了构建 Electron 对高性能硬件的需求,从而使更广泛的开发者能够构建和贡献 Electron。这一努力完全值得。

🌐 As you can see, compared to building Electron as part of Chromium, building Chromium as a library takes greater efforts and requires continuous maintenance. However the latter removes the requirement of powerful hardware to build Electron, thus enabling a much larger range of developers to build and contribute to Electron. The effort is totally worth it.

本周项目:WordPress 桌面端

· 9 min read

本周,我们与 Automattic 的团队会面,讨论了 WordPress Desktop,这是一款用于管理 WordPress 内容的开源桌面客户端。

🌐 This week we caught up with folks at Automattic to talk about WordPress Desktop, an open-source desktop client for managing WordPress content.


WordPress 应用

大家都知道 WordPress,但 WordPress 桌面版是什么呢?

🌐 Everyone knows about WordPress, but what is WordPress Desktop?

WordPress.com 桌面应用 提供无缝的跨平台体验,让你可以专注于内容和设计,而无需被浏览器标签分心——或者让你的站点保持可用但不占用屏幕空间。结合我们的浏览器支持和移动应用,你可以随时随地以任何有助于完成工作的方式构建网站。

🌐 The WordPress.com Desktop app provides a seamless cross-platform experience that allows you to focus on your content and design with no browser tabs to distract you — or to keep your sites sidelined but accessible. In combination with our browser support and mobile app you can build your site anywhere, in whatever way helps you get your work done.

为什么要开发一个用于管理 WordPress 网站的桌面应用?难道不能全部基于网页吗?

🌐 Why build a Desktop app for managing WordPress sites? Couldn't it all be web-based?

实际上,它使用的技术与你在浏览器中访问 WordPress.com 时完全相同。不过,它是本地托管的,因此加载时间极短。借助本地功能的优势,例如可以固定在任务栏、接收通知等,你真的可以专注于你的 WordPress 网站和博客。

🌐 It's actually using exactly the same technology you get when visiting WordPress.com in your browser. However, it's all locally hosted, so it has minimal load times. With the benefit of native features such as being in your dock, notifications, etc., you really can focus on your WordPress sites and blogging.

为什么选择在 Electron 上构建 WordPress 桌面?

🌐 Why did you choose to build WordPress Desktop on Electron?

在2015年底,我们以Calypso的形式重建了WordPress.com的大部分内容,Calypso是一个使用React的开源现代JavaScript应用。我们开始研究Electron,并通过对Calypso进行一些修改,使其能够在本地运行。这是一次令人信服的体验,我们认为进一步开发它具有很大的价值。

🌐 At the end of 2015 we rebuilt much of WordPress.com in the form of Calypso, an open-source modern JavaScript app using React. We started looking at Electron and with some changes to Calypso were able to get it running locally. It was a compelling experience and we thought there was a lot of value in developing it further.

我们有几个团队在开发 Calypso。用传统的桌面技术来制作一个完整的、多平台的 GUI 客户端会需要更多的工作。通过使用 Electron,我们一个由 2-4 人组成的小团队能够利用其他团队的成果,并在几个月内构建出桌面应用。

🌐 We had several teams working on Calypso. To make a full multi-platform GUI client that matched this using traditional desktop technologies would have taken more work. By using Electron, a small team of 2-4 of us were able to leverage the other team’s efforts and build the Desktop app in a couple of months.

在构建 WordPress Desktop 时,你遇到了哪些挑战?

🌐 What are some challenges you've faced while building WordPress Desktop?

我们很快就让应用运行了初始版本,但将其调整为在桌面应用中最佳运行花费了更多时间。应用面临的一个大挑战是,你实际上是在自己的机器上运行一个 Calypso 的副本——它完全是基于 API 的用户界面。这其中涉及了大量的桥接工作,并且所做的更改也反馈回了 Calypso 本身。

🌐 We got an initial version of the app running very quickly, but tuning it to behave optimally as a desktop app took a lot more time. One big challenge with the app is that you're actually running a copy of Calypso on your own machine - it’s purely an API driven UI. There was a lot of bridging work involved in this, and changes were fed back to Calypso itself.

此外,为不同平台打包应用也花费了大量精力——我们提供 Windows、macOS 和 Linux 版本——而且这些平台之间有足够多的差异,使得这项工作很棘手。

🌐 Additionally a lot of effort was spent packaging the app for different platforms - we provide Windows, macOS, and Linux versions - and there are sufficient differences to make this tricky.

当时 Electron 相对较新,我们不断遇到一些问题,这些问题很快就得到了解决(有时甚至当天就能解决!)。

🌐 At the time Electron was relatively new and we kept running into issues that were shortly fixed (sometimes the same day!)

Electron 应该在哪些方面改进?

🌐 In what areas should Electron be improved?

Electron 已经提供了我们桌面应用所需的大部分功能,而且自我们开始使用以来,它发展得非常迅速。话虽如此,一些在桌面应用中理所当然的功能,如拼写检查和查找/替换,在 Electron 中直接实现起来则更困难。

🌐 Electron already provides most of what we need for the Desktop app, and it's progressed rapidly since we started using it. That said, there are some areas that are taken for granted in a desktop app, such as spell checking and find/replace, that are harder to replicate with Electron as-is.

我们也希望看到一些更新的 Chrome 技术被引入到 Electron 中。我们特别热衷于尝试 WebVR。

🌐 We’d also love to see some of the newer Chrome technologies filtering down into Electron too. We’re particularly keen on experimenting with WebVR.

你最喜欢 Electron 的哪些方面?

🌐 What are your favorite things about Electron?

我们选择 Electron 的主要原因,也是它最大的优势,是其非常活跃且开放的社区。Automattic 一直相信开源。这是我们的核心信念之一,而 Electron 项目和社区也遵循许多开放和积极的核心理念。

🌐 The main reason we chose Electron, and it's biggest strength, is the very active and open community. Automattic has always believed in open source. It is one of our core tenets, and the Electron project and community follows a lot of the core beliefs of being very open and positive.

WordPress Desktop 的下一步计划是什么?

🌐 What's coming next in WordPress Desktop?

我们模型的最大优点是桌面应用可以享受到任何新的 Calypso 功能——它不断在改进。我们希望能为应用增加更多功能,比如离线支持,这将真正让应用进入原生应用的字段,并提供更好的系统通知。

🌐 The great thing about our model is that the Desktop app benefits from any new Calypso feature - there are constant improvements. We’re hoping we can add additional features to the app such as offline support, which would really take the app into native territory, and better system notifications.

Automattic 是否有团队正在开发其他 Electron 应用?

🌐 Are there any teams at Automattic working on other Electron apps?

是的,在我们对桌面应用的努力之后,Simplenote 团队决定使用 Electron 来构建适用于 Windows 和 Linux 的桌面应用(已经存在原生 Mac 客户端)。Simplenote Electron 应用 也是开源的,并可以在 Github 上获取。

🌐 Yes, after our efforts on the Desktop app, the Simplenote team decided to use Electron to build desktop apps for Windows and Linux (a native Mac client already exists). The Simplenote Electron app is also open source and available on Github.

我们还即将推出使用 Electron 的 Raspberry Pi 集成。

🌐 We've also got an upcoming Raspberry Pi integration that uses Electron.

如果你对其中任何一项感兴趣,我们非常希望能收到你的消息!

🌐 If any of that sounds interesting then we'd love to hear from you!

有哪些 Electron 开发技巧可能对其他开发者有用?

🌐 Any Electron tips that might be useful to other developers?

将已签名的桌面软件分发给用户对我们来说相对较新,尤其是针对 Windows。我们撰写了一篇关于为 Windows 应用进行代码签名的文章,其中包括整个进程以及我们为正确完成它所遇到的一些难题。

🌐 The process of shipping signed desktop software is relatively new to us, especially for Windows. we wrote up an article for Code Signing a Windows App which includes the process and a few of the hurdles we went through to do it right.