Live data from Hacker News

WebContainers: Run Node.js natively in the browser

blog.stackblitz.com

41–50 of 238 posts

Re: WebContainers: Run Node.js natively in the browser

#41
post #28

What about this is "native"? The page says it is "running natively" but also says "All code execution happens inside the browser's security sandbox". Is wasm in a browser somehow considered native now?

I interpreted it as “native to the browser”, which is a bit silly when you think about it, but makes sense when opposed to “running remotely”.

Isn't the opposite to "running remotely" "running locally"? Meanwhile if pressed for the opposite of "running native" I would answer "running virtualized".

Re: WebContainers: Run Node.js natively in the browser

#42

Hi all- CEO of StackBlitz/author of this blog post here. Happy to answer any questions! (Also, thanks for posting this bpierre!)

Is node/v8 compiled to Wasm entirely, or are you using the browser's JS engine with polyfills for node's APIs? Or something in between?

Re: WebContainers: Run Node.js natively in the browser

#43
post #12

Earlier quoted context omitted.

Yep- if you go to https://stackblitz.com you can start a Next.js, GraphQL, etc dev environment in one click.

... in chrome.

You are right. In Firefox I get "StackBlitz v2 Beta currently works in Chrome and Chromium-based browsers. We’re hoping to add support for more browsers as they implement the necessary Web Platform features."

Re: WebContainers: Run Node.js natively in the browser

#44
post #33

Wow. How? Node.JS needs a "full-blown" OS to compile and run... right? And that's not something you could emulate efficiently using wasm? Right?...?

People have made Linux run on the browser, so... Although I don't think this is what they did here.

Man, the yet another layer they've made between code and the CPU makes me uncomfortable. Imagine finding a bug and going through 20 layers to troubleshoot it.

Also: https://www.theregister.com/2017/03/23/cursor_devours_cpu_cy...

Re: WebContainers: Run Node.js natively in the browser

#45
post #3

Hi all- CEO of StackBlitz/author of this blog post here. Happy to answer any questions! (Also, thanks for posting this bpierre!)

Is this all open source? I'm fascinated in learning more about how you run a web server with this - the article says "WebContainers include a virtualized TCP network stack that's mapped to your browser's ServiceWorker API" but I'd love to understand a bit more about how that works. Since this is all done with WebAssembly are you planning on targeting other stacks such as Python? The amount of time I lose helping othe…

We'll be open sourcing core parts of WebContainer as we move towards GA. We have some additional technical info in our core WG repo: https://github.com/stackblitz/webcontainer-core

We also did an hour long podcast a few months back that goes into pretty deep detail: https://www.youtube.com/watch?v=5F9qH-ea5Qk

Re: WebContainers: Run Node.js natively in the browser

#46

Hi all- CEO of StackBlitz/author of this blog post here. Happy to answer any questions! (Also, thanks for posting this bpierre!)

Could you point us to an introduction to how operating system concepts get mapped to browser concepts? It sounds like each native binary gets compiled to a WebAssembly binary, but how do they communicate? How are the network and file system implemented? Are parts of the file system persistent? How does a system call work?

Great questions- we have some additional technical info in our core WG repo: https://github.com/stackblitz/webcontainer-core

We also did an hour long podcast a few months back that goes into pretty deep detail: https://www.youtube.com/watch?v=5F9qH-ea5Qk

Re: WebContainers: Run Node.js natively in the browser

#47
post #22

Someday, I'd like to see Wasi-based webassembly containers. It'd be awesome to spin up a sandboxed shell with file access in a webpage.

You can actually do this with WebContainers today :) Try it out here: https://stackblitz.com/fork/node

Full WASI support in WebContainer is landing in the next 1-2 months.

Re: WebContainers: Run Node.js natively in the browser

#48
post #33

Wow. How? Node.JS needs a "full-blown" OS to compile and run... right? And that's not something you could emulate efficiently using wasm? Right?...?

Great question :) We have some additional technical info in our core WG repo: https://github.com/stackblitz/webcontainer-core

We also did an hour long podcast a few months back that goes into pretty deep detail: https://www.youtube.com/watch?v=5F9qH-ea5Qk

Re: WebContainers: Run Node.js natively in the browser

#49

Hi all- CEO of StackBlitz/author of this blog post here. Happy to answer any questions! (Also, thanks for posting this bpierre!)

First, congratulations! This is an astonishing advancement.

I found this on the GH repo: "Is this open source? Today no, but the API will be open source to developers at GA."

I'm confused by what "the API" is, exactly. Is WebContainers a technology you plan to make available for others to use node, in the browser, in their own apps?

Post reply on HN