本周项目:烧杯浏览器
本周,我们采访了 烧杯浏览器 的创建者 Paul Frazee。Beaker 是一款实验性的点对点网络浏览器,它使用 Dat 协议在用户的设备上托管网站。
¥This week we caught up with Paul Frazee, creator of Beaker Browser. Beaker is an experimental peer-to-peer web browser that uses the Dat protocol to host sites from users’ devices.
什么是 Beaker?为什么创建它?
¥What is Beaker and why did you create it?
Beaker 是一款参与式浏览器。这是一款面向独立开发者的浏览器。
¥Beaker is a participatory browser. It's a browser for indie hackers.
Web 是闭源的。如果你想影响社交媒体的运作方式,你就必须在 Facebook 或 Twitter 上工作。搜索请见 Google。控制权掌握在公司手中,而不是用户自己。
¥The Web is closed source. If you want to influence how social media works, you have to work at Facebook or Twitter. For search, Google. Control is in the hands of companies, rather than the users themselves.
有了 Beaker,我们有了一个新的 Web 协议:去中心化归档传输。"日期。" 可以按需免费创建网站,然后从设备共享。无需服务器。这就是我们的创新。
¥With Beaker, we have a new Web protocol: the Decentralized Archive Transport. "Dat." It creates sites on demand, for free, and then shares them from the device. No servers required. That's our innovation.
当你在 Beaker 中访问 Dat 站点时,你会下载这些文件。网站永远属于你。你可以免费保存、分叉、修改和分享你的新版本。完全开源。
¥When you visit a Dat site in Beaker, you download the files. The site is yours, forever. You can save it, fork it, modify it, and share your new version for free. It's all open-source.
这就是它的意义所在:我们正在为开源网站开发一款浏览器。我们希望它成为社交黑客的工具包。
¥So that's what it's about: We're making a browser for open-source Websites. We want it to be a toolkit for social hacking.
谁应该使用 Beaker?
¥Who should be using Beaker?
黑客。Modders。创意类型。喜欢捣鼓的人。
¥Hackers. Modders. Creative types. People who like to tinker.
如何创建一个使用 Dat 的新项目?
¥How do I create a new project that uses Dat?
我们已推出 一个名为 bkr 的命令行工具,它类似于 git + npm。网站创建成功:
¥We've got a command-line tool called bkr that's kind of like git + npm. Here's creating a site:
$ cd ~/my-site
$ bkr init
$ echo "Hello, world!" > index.html
$ bkr publish
这是一个 fork 站点的示例:
¥And here's forking a site:
$ bkr fork dat://0ff7d4c7644d0aa19914247dc5dbf502d6a02ea89a5145e7b178d57db00504cd/ ~/my-fork
$ cd ~/my-fork
$ echo "My fork has no regard for the previous index.html!" > index.html
$ bkr publish
这些网站将不再托管在你的浏览器中。它有点像 BitTorrent;你可以在 P2P 网格中共享网站。
¥Those sites then get hosted out of your browser. It's a little like BitTorrent; you share the sites in a P2P mesh.
如果你需要 GUI,我们在浏览器中内置了一些基本工具,但我们正在将这些工具推送到用户空间。所有这些都将是可修改的用户应用。
¥If you want a GUI, we have some basic tools built into the browser, but we're pushing those tools into userland. It's all going to be moddable user apps.
为什么选择在 Electron 上构建 Beaker?
¥Why did you choose to build Beaker on Electron?
对于这个项目来说,这一点显而易见。如果我自己 fork Chrome,我现在就会写 C++ 了!没人愿意这样做。我了解 Web 技术栈,并且可以快速上手。这很简单。
¥It was obvious for this project. If I forked Chrome myself, I'd be writing C++ right now! Nobody wants to do that. I know the Web stack, and I can work quickly with it. It's a no-brainer.
事实上,如果没有 Electron,我不确定我能做到这些。这是一款很棒的软件。
¥The truth is, I'm not sure I could do any of this without Electron. It's a great piece of software.
你在构建 Beaker 时遇到了哪些挑战?
¥What are some challenges you've faced while building Beaker?
一半的时间都在研究工具,并弄清楚我能做多少。
¥Half of it is poking at the tools and figuring out how much I can get away with.
浏览器本身的开发非常简单。Electron 实际上是一套用于开发浏览器的工具包。……除了浏览器标签页;我花了很长时间才搞定。我终于彻底搞定了,并学会了如何使用 SVG。它看起来好多了,但我花了三四次迭代才搞定。
¥Making the browser itself was pretty easy. Electron is practically a toolkit for making browsers. ...Except for the browser tabs; that took me forever to get right. I finally broke down and learned how to do SVGs. It's much better looking, but it took 3 or 4 iterations before I got that right.
Electron 应该在哪些方面改进?
¥In what areas should Electron be improved?
如果我能将开发者工具停靠在 Web 视图中就太好了。
¥It'd be really great if I could dock the devtools inside a webview.
Beaker 的下一步计划是什么?
¥What's coming next in Beaker?
Dat 网站的安全 DNS 名称。一种可社交配置的 URL 方案,称为 "应用方案。" More Dat API。
¥Secure DNS names for Dat sites. A socially configurable URL scheme, called the "app scheme." More Dat APIs.
对于可能有兴趣为项目做出贡献的人,Beaker 在哪些方面需要帮助?
¥For folks who may be interested in contributing to the project, in what areas does Beaker need help?
我们有很多未解决的问题。别害怕联系我。freenode 上的 #beakerbrowser。我们保留一个 贡献者页面 项目,并将你添加到其中。如果你访问奥斯汀,我会请你喝啤酒。
¥We have lots of open issues. Don't be afraid to ping me. #beakerbrowser on freenode. We keep a page for contributors and we'll add you to it. And if you visit Austin, I'll buy you a beer.
有哪些 Electron 开发技巧可能对其他开发者有用?
¥Any Electron tips that might be useful to other developers?
-
使用现有的构建工具。相信我,你肯定不想费力地自己琢磨解决方案。使用 electron-builder。使用样板代码库。
¥Use the build tooling that's out there. You don't want to wrestle with your own solutions, trust me. Use electron-builder. Use a boilerplate repo.
-
如果你需要在 Electron 代码库中提交问题,请多加留意,以便轻松复现。你将更快地收到回复,团队将对此表示感谢。更好的是,尝试自行修复。看到它的内部结构其实很有趣。
¥If you need to open an issue in the Electron repo, go the extra mile to make it easy to reproduce. You'll get a response much more quickly, and the team will appreciate it. Even better, try fixing it yourself. It's actually pretty interesting to see the innards.
-
请至少通读一遍所有指南和高级文档。
¥Read through all the guides and advanced docs at least once.
-
不要构建浏览器,这是一个饱和的市场。
¥Don't build a browser, it's a saturated market.