浏览器编程
Earlier this year, GitHub announced a few new features during its Satellite 2020 event to help developers across the globe. One of these new features is Codespaces, which GitHub calls “your instant dev environment.”
今年早些时候,GitHub在其Satellite 2020活动中宣布了一些新功能 ,以帮助全球的开发人员。 这些新功能之一是Codespaces ,GitHub将其称为“您的即时开发环境”。
The goal of Codespaces is to allow anyone to instantly start up a dev environment so they can contribute to any project right away, with all the necessary tools and dependencies set up and ready to use.
Codespaces的目标是允许任何人立即启动开发环境,以便他们可以设置所有必要的工具和依赖项并随时使用,从而立即为任何项目做出贡献。
“Codespaces is an online development environment, hosted by GitHub and powered by Visual Studio Code, that allows you to develop entirely in the cloud.” — GitHub
“ Codespaces是一个在线开发环境,由GitHub托管并由Visual Studio Code支持,使您可以完全在云中进行开发。” — GitHub
After recently receiving access to the limited beta, I’ve tested out this fun new way to code and I’m happy to say it works wonderfully.
在最近获得了受限Beta的访问权限后,我已经测试了这种有趣的新编码方式,并且很高兴地说它可以很好地工作。
这个怎么运作 (How It Works)
![Image for post](https://i-blog.csdnimg.cn/blog_migrate/112b565790cc8f7a47c290801e098169.png)
By going to any GitHub repository and clicking three buttons, you’ll be taken to a working VS Code window in your browser within about 30 seconds. In this one tab, it’s possible to code, build, test, and deploy faster than ever before.
通过转到任何GitHub存储库并单击三个按钮,您将在大约30秒钟内被带到浏览器中有效的VS Code窗口。 在此选项卡中,可以比以往更快地进行编码,构建,测试和部署。
The possibilities are extended even more with a ready-to-go terminal and the ability to install VS Code extensions within your codespace. You can even connect to a codespace in VS Code on your own machine using the Visual Studio Codespaces extension.
通过现成的终端以及在代码空间内安装VS Code扩展的能力,扩展了更多可能性。 您甚至可以使用Visual Studio Codespaces扩展连接到自己计算机上的VS Code中的代码空间。
Repositories can also have specific settings to further customize Codespaces, including automatically installing extensions, forwarding ports, and more. This is done in a new devcontainer.json
file and is documented nicely.
存储库还可以具有特定的设置来进一步自定义代码空间,包括自动安装扩展,转发端口等。 这是在一个新的devcontainer.json
文件中完成的,并有很好的记录 。
One benefit of using Codespaces is that new developers can be ready to help out in just a few seconds, with fewer errors along the way. New contributors can instantly have access to all the tools and info needed to make their first commit to a project.
使用Codespaces的好处之一是,新开发人员可以在短短几秒钟内准备好提供帮助,同时减少错误。 新的参与者可以立即访问首次提交项目所需的所有工具和信息。
Take a look at this clip from the Satellite 2020 keynote for a live demo of Codespaces:
请查看Satellite 2020主题演讲中的以下剪辑,以获取Codespaces的现场演示:
何时可以使用 (When You Can Use It)
Right now, Codespaces is in a limited beta, meaning only a small group of users have access. It took almost four months for me to make my way through the waitlist.
目前,Codespaces处于测试版阶段,这意味着只有一小部分用户可以访问。 我花了将近四个月的时间才进入候补名单。
Pricing has not been finalized but is planned to follow a simple pay-as-you-go model. Right now, beta users are limited to two codespaces at a time.
定价尚未最终确定,但计划遵循简单的即付即用模式。 目前,beta用户一次只能使用两个代码空间。
For now, this feature can only be used in repositories you own and public repositories. This means private repos owned by an organization are not yet able to use Codespaces.
目前,此功能仅可用于您拥有的存储库和公共存储库。 这意味着组织拥有的私有存储库尚不能使用代码空间。
结论 (Conclusion)
Codespaces is a wonderful idea and a great way for new contributors to help out with any project on GitHub. With just a few clicks and a few seconds, anyone can have a fully functioning development environment in their browser.
代码空间是一个很棒的主意,也是新贡献者为GitHub上的任何项目提供帮助的绝佳方式。 只需单击几秒钟,任何人都可以在其浏览器中使用功能全面的开发环境。
Whether you just need to make one tiny change or add in an entirely new feature, Codespaces may be the way to go.
无论您只需要进行微小的更改还是添加全新的功能,Codespaces都是您的最佳选择。
Thanks for taking the time to read, and have a fantastic day!
感谢您抽出宝贵的时间阅读,并度过了愉快的一天!
翻译自: https://medium.com/better-programming/programming-in-your-browser-is-almost-here-a6a68ce63b60
浏览器编程