Live data from Hacker News

WebContainers: Run Node.js natively in the browser

blog.stackblitz.com

81–90 of 238 posts

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

#82
Everyone thought WASM would enable developers to write code in any language they wanted (with type checking and higher performance) and deploy it on the web.

JS Developers come in: so we can compile node.js to WASM and run that in the browser?! Yay!! Now we can have backend JS running in the browser alongside browser JS!

Jokes aside: this is actually quite interesting, the demo is very impressive (except for the "only works in Chromium-based browser" message on the next.js demo, where the preview should be - despite Mozzila being one of the main WASM backers and Firefox having arguably the best WASM engine).

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

#83
post #82

Everyone thought WASM would enable developers to write code in any language they wanted (with type checking and higher performance) and deploy it on the web. JS Developers come in: so we can compile node.js to WASM and run that in the browser?! Yay!! Now we can have backend JS running in the browser alongside browser JS! Jokes aside: this is actually quite interesting, the demo is very impressive (except for the "onl…

Typically when you see stuff like this be Chromium-only, it's because Chromium has a bunch of non-standard/one-vendor-only stuff enabled in production builds and neither Firefox or Safari have it enabled (or implemented at all). A few examples include Bluetooth, MIDI and USB.

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

#85
post #56

I think very few people will realize the systemic effects that a demo like this entails. Very, very good work StackBlitz team!

Funny you say that. I'm usually really skeptical of the next big thing but I felt differently about this, just can't put my finger on it.

This really means a lot. I'm glad our work & writing came across genuine.

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

#86
"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."

Pretty useless, then. What features are missing? As far as I know Firefox was one of the major contributors to pushing WebASM to the web and has a superior WASM engine in many aspects.

I'd be more interested in a post about what WebASM features are missing than an announcement that someone hacked Javascript into a browser.

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

#87
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?...?

node.js, as any other native Linux/Windows/Mac application, talks to the OS via a system API. You can emulate that API using WASM, mapping I/O to browser APIs, which is why they mention network is implemented via service workers, for example. File I/O can be mapped to IndexDB... Threads can also be mapped to service workers, I guess... and so on.

emscripten[1] did this a long time ago for C, which is how a bunch of native applications have already been ported to run on the browser.

webcontainers[2] seem to do a similar thing but focused on exposing the browser API to the native apps in a way that integrates well with the JS environment.

[1] https://emscripten.org/

[2] https://github.com/stackblitz/webcontainer-core

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

#88
post #29

Earlier quoted context omitted.

why do you want to spin up a shell with file access in a webpage?

So you can open up your local project directory in your browser-based IDE and have it work like you expect.

My wish was actually to be able to spin up a shell locally on a github repo that pulls stuff over lazily.

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

#89

Yawn. It isn't open source. It has a name, WebContainers, that implies it's based on the web, but it's designed around Node.js which isn't built on browser technologies as much as something like Skypack or Deno. It also seems like it's going to be a memory, disk, and CPU hog, and that it's going to be pretty complex. I like where Skypack is headed and this seems like the opposite direction. It's pretty cool but it se…

> I like where Skypack is headed and this seems like the opposite direction. I did a quick google search because I had never heard of Skypack. Skypack seems to be a far cry away from what WebContainers is claiming to do. Like, they're completely different products. I guess I don't understand why you're even comparing the two.

I think he means deno+skypack
Post reply on HN