Original link: https://jw1.dev/2022/10/12/a01.html
I have a dream I dream of sitting in a Starbucks window on a Sunday afternoon in winter, drinking coffee, basking in the sun, holding an iPad
– write code (too pretentious)
A dream is a good dream, but there has never been an easy-to-use code editor on the iPad, nor a complete code running environment ( Your next computer has to be a computer ) until Visual Studio Code came along. At that time, after knowing that this thing was written by Electron, I actually had such a thought in my mind: Is it possible to run it in the browser? But it’s just a thought, how dare you think about it?
However, with the development of VsCode, a small number of code editors based on VsCode that can run in the browser, Remote IDE (Remote Integrated Development Environment), have indeed appeared in recent years.
Why remote?
This code can run on my machine!
This build is too slow, I want to get off work!
Forgot the push code after get off work!
As a developer, you should have seen these words to some extent, or have it happened to you with a high probability? How to solve such problems, or weaken the sense of existence of these problems, the charm of remote development is immediately reflected at this time:
- Unified Development Environment
- Time-consuming tasks can be handed over to remote servers
- Provides a continuous development experience
There will no longer be someone whose machine can’t run a certain piece of code, who will be blocked from get off work by the build speed, and will no longer forget to push the code and find that he can’t continue to work after returning home. And for me, the greatest joy of having a Remote IDE is that as long as I have any device with a browser installed at hand, I can start writing code anytime, anywhere (I am the king of scrolls)! In other words, the dream of drinking coffee, basking in the sun, and writing code with an iPad can finally come true! So today, let’s talk about some of the Remote IDEs that I think are doing well:
StackBlitz
To tell you the truth, if I hadn’t seen his advertisement on Vite’s official website, I really didn’t know there was such a thing. After experiencing it, I found that the function is still relatively powerful, from the most basic VanillaJS to React, Vue, all have one-click Generated templates, and the deployment speed is very fast. In terms of business, tossing self-study, multi-person collaboration, and teaching demonstrations are all things that matter.
Although powerful, it is not completely without disadvantages:
- ask for money
- non-open server
In fact, I think it is quite reasonable to have so many functions for 9 knives a month, but I always feel that it is a bit of a loss, because it is not free. You can’t use most of VsCode’s features, such as extensions, theme skins; you can’t freely install some software tools in the terminal, such as vim, curl. On this platform, the only thing you can do is to develop web-related things, nothing else can be touched!
Then again, if you really just want to focus on web development, this platform is still delicious, because it’s really super fast, I did a little test and ran it after removing node_modules
and package-lock.json
yarn, it only took 1.365 seconds to complete the installation of dependencies. Looking at the output, it only took 0.1 seconds to download the dependency packages, indicating that the platform has built-in npm cache. Installing dependencies is not an important role in overall development, but such a speed can greatly improve the happiness of developers and make developers more willing to write code, at least for me.
Github Codespaces
I have to say, it’s still Microsoft. Github Codespaces is directly connected to the local VsCode. He really completely implements a Vscode in the browser. The extensions you install locally and the local settings can all be synchronized to Codespaces through your Microsoft account or Github account! This also means that you can use the full functionality of VsCode! And Codespaces is different from StackBlitz, he gives you complete server permissions, you can install various software, you can enjoy the complete linux ecosystem.
There are also disadvantages:
- I want money, I want a lot of money
- slow
Product | SKUs | Unit of measure | Price |
---|---|---|---|
Codespaces Compute | 2 core | 1 hour | $0.18 |
4 core | 1 hour | $0.36 | |
8 core | 1 hour | $0.72 | |
16 core | 1 hour | $1.44 | |
32 core | 1 hour | $2.88 | |
Codespaces Storage | Storage | 1 GB-month | $0.07 |
This is the price list given in the official Github document. Let’s do a superficial calculation. We choose the minimum configuration of 2 cores, which costs 0.18 dollars per hour. Assuming that the average code is written for 6 hours a day, and the average monthly work is 21 days, then it will cost about 22.68 per month. It is not expensive to use a knife to maintain the normal operation of Codespaces, but it seems that it is still a bit of a loss to spend more than 150 yuan a month on this thing.
Since Codespaces integrates all the functions of VsCode, the experience is definitely not as lightweight and fast as StackBlitz, and everyone knows the domestic network environment, sometimes Github can’t be connected, let alone Codespaces, although it is huge Added degrees of freedom, but the overall experience may not be as good as StackBlitz.
code-server
code-server is built by the Coder team. There are currently two versions, one is open source and free, and the other is a closed source product for enterprise use.
And that’s the remote code editor I mostly use right now.
- open source, free
- Self-built service, cost controllable
- freer
Both StackBlitz and Codespaces are operating models of time-based billing, which also means that once you close the editor, their server computing resources will be recycled after a period of time, and no services can be run in the background, while code-server is an automatic Create a service, write the code in the code-server, you can immediately run in the background and create a public service (proud face). In addition, the self-built service has another advantage, that is, you can choose a server that suits you, and you don’t have to worry about what kind of “surprises” will be in your monthly bill.
At present, my code-server is built on Tencent Cloud’s 54 yuan lightweight server in Hong Kong and Macau. For pricing, you can look at the price list given on the official website. For those who don’t want to record, you can try Hong Kong or Seoul. The machine is cost-effective and the connection speed is relatively fast. The cheapest machine is only 32 yuan/month.
code-server has no obvious shortcomings. If you have to say it, there is only one:
- Cannot directly install and use the official extension package of VsCode
Because of copyright issues, code-server chose open-vsx as the extension market. Although he owns most of the extensions of VsCode, some extensions developed by Microsoft are still not available for the time being, but the solution is also very simple, but it will be a little troublesome.
code-server supports installing extensions from .vsix
. You only need to download the required extension files from the official website of VsCode and upload them to code-server for installation.
Well, that’s all for today, bye!
This article is reprinted from: https://jw1.dev/2022/10/12/a01.html
This site is for inclusion only, and the copyright belongs to the original author.