It all starts with an email

This morning, I got an email from StackBlitz saying he was working on a new technology with the team at next.js and Google

  • A few years ago,StackBlitzRecognize that the web is heading toward a critical inflection point. The advent of WebAssembly and new feature apis makes it seem possible to write a WebAssembly-based operating system powerful enough to run Node.js entirely in a browser. We envision an advanced development environment that is faster, more secure and consistent than the local environment to enable seamless code collaboration without setting up the local environment

Technical name:WebContainers

  • WebContainers allows you to create complete Node.js environments that can be started in milliseconds and instantly online and linked to share with a click. The environment features VS Code’s powerful editing experience, complete terminal, NPM and more. It can also run entirely in your browser, which brings some key benefits:
  • Faster than the local environment. Compared with YARN/NPM, the build speed can be up to 20% faster, while the volume installation speed can be more than five times faster.
  • Debug Node.js in the browser. Seamless integration with Chrome DevTools enables native back-end debugging with no installation or extension required.
  • The default value is security. All code execution takes place in the browser’s secure sandbox, not on a remote VM or local binary.
  • Again, these environments do not run on remote servers. Instead, each environment is fully contained within your Web browser. That’s right: the Node.js runtime itself runs natively in a browser for the first time.

WebContainers is now in public beta as of right now. Current support includes next.js, GraphQL, and Vanilla Node.js, and we are working with other open source projects to extend support

Why is thereWebContainers

security
  • StackBlitz addresses these issues by taking advantage of decades of speed and security innovations in browsers. All calculations in StackBlitz occur immediately in the browser security sandbox and cannot be exploded on your local computer. The model also frees up some key development and debugging advantages (and more in a matter of seconds).

Release browser functionality
  • Use Chrome DevTools for seamless Node.js debugging
    • Browsers, it turns out, are really good at debugging Javascript. I know, it’s shocking;) Integration with Chrome DevTools is out-of-the-box by executing Node.js in the browser. No installation, no extensions, just native backend debugging in the browser

Run the server in your browser
  • In fact. WebContainers contains a virtual TCP network stack that is mapped to the browser’s ServiceWorker API, allowing you to create live Node.js servers on the fly and continue working even if you are offline. Because it runs entirely in a browser security sandbox, the server responds with more latency than localhost (!). Less, and can protect your Web server from localhost fetching attacks
  • Startup time in milliseconds
  • Each page loads with a completely new environment
    • Bye rm -rf node_modules! WebContainer’s built-in NPM client is so fast that it runs a brand new installation every time a page loads, ensuring you get a clean environment every time. If your environment does have problems, you can restore it to a clean state just as you would with any other Web application: click the Refresh button
  • With StackBlitz, you can keep working without an Internet connection, whether you’re on a train, on a plane, or in the back seat in the rain

With StackBlitz’s novel computing model, 100% of code execution takes place in the browser security sandbox. This results in a faster, less restrictive development environment than native, while providing higher security, a very rare combination.

  • In fact, the default security situation is so solid that our embedded package manager is the first publicly available tool to address Sam Saccone’s long-unresolved NPM vulnerability that has been unresolved for more than five years
  • Again, these environments do not run on remote servers. Instead, each environment is fully contained within your Web browser. That’s right: the Node.js runtime itself runs natively in a browser for the first time

Write in the last

  • WebAssemblyPowerful enough to write an operating system, but this timeWebContainersPut the direction of use of this technology inNode.jsI think it is epoch-making
  • In my view, the main application of this technology in the future is to enable software worldwide to run in places that have not been able to run before, and maybe in the future you will only need to install a Google Browser on your computer