Live data from Hacker News

WebContainers: Run Node.js natively in the browser

blog.stackblitz.com

161–170 of 238 posts

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

#161

Earlier quoted context omitted.

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.

I don't understand why you are downvoted. Filesystem access is another big one! Chrome has the technological advantage and sports an enormous kitchen sink of features. One has to make the hard decision, work on a concept that will work only on one browser, try to cut corners with graceful (or crippling) degradation, or wait potentially a long time until a spec is standardized and implemented. The latter may result in…

The down side is that some of these technologies never get standardised and eventually get dropped. Like NaCl and PNaCl.

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

#163

I used to teach web development and was always frustrated with just how much effort went into setting up a machine. It would be really nice if a developer could just include a script tag in their project that setup a TypeScript compiler inside service worker. I managed to get the basics down, even fixing relative import statements. Requests like localhost:3000/main.tsx would compile and cache on the fly. There were a…

I wonder if that is the ideal path though, I was an instructor for a few subjects in my university and sometimes the biggest detractor for students was the lack of familiarity with the tool set used by the language,

for example, people sometimes did not know how to freeze their dependencies and use python virtual environments when working with python projects, that lead to problems in collaboration, handing students "magic" prefabricated environments could lead them to believe that that's all there is to it, and explaining that it is not to the student in an edge case might end up being less productive than understanding this process from the get go

you could say that the _effort_ to set up a development machine should be part of the learning experience, at least that's what I think.

I remember seeing my classmates having their first freelance jobs and editing minified css/javascript directly because they did not know anything about the transpiling that goes on or the toolset surrounding javascript and web development

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

#164
post #110

I used to teach web development and was always frustrated with just how much effort went into setting up a machine. It would be really nice if a developer could just include a script tag in their project that setup a TypeScript compiler inside service worker. I managed to get the basics down, even fixing relative import statements. Requests like localhost:3000/main.tsx would compile and cache on the fly. There were a…

Yes web developing is so hard... sudo apt install apache2 php libapache2-mod-php; vim /var/www/html/index.php

This comment is hilarious. It's like saying "being a doctor is so hard... pulls out an amputation saw"

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

#165

Earlier quoted context omitted.

> the direction I'd like to see web development move is having a statically typed language that compiles to VM bytecode. Java… you want Java. And so the cycle continues!

You could add some kind of security manager to sand box it and have little apps running in the browser. Maybe call them "applets".

That sounds amazing! What if they came with some kind of built-in canvas?

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

#166
post #149

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

> Faster than your local environment. Builds complete up to 20% faster and package installs complete >= 5x faster than yarn/npm. Above is a quote from the post. I feel like this is a stupid question, but how can running yarn/npm in a browser on my machine be faster than running yarn/npm on my machine? Particularly when each page load runs a fresh npm/yarn install? Nonetheless, this is a incredible piece of software t…

I was wondering the same thing

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

#167

Earlier quoted context omitted.

> the direction I'd like to see web development move is having a statically typed language that compiles to VM bytecode. Java… you want Java. And so the cycle continues!

That's a really good point. What we wanted all along was the JVM with a DOM API. We started with Java. It didn't gain any traction for browser scripting. They took "Java" out and called it JavaScript. Now we take the "script" out and call it WebAssembly. If someone in 1995 made Java a DOM-editing thing instead of an applet thing, we could have saved 25 years of running around in circles :) (Going back even further, w…

What I’ve always wanted is scheme in the browser.

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

#168
This is a very cool project!

I noticed that outgoing http requests don't seem to work (there's no `curl` and after installing a CLI tool I work on via npm (which worked like a charm!), the outgoing API calls it makes were blocked. I assume that's intentional at this stage. Is that changing in the future?

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

#169

Earlier quoted context omitted.

> the direction I'd like to see web development move is having a statically typed language that compiles to VM bytecode. Java… you want Java. And so the cycle continues!

That's a really good point. What we wanted all along was the JVM with a DOM API. We started with Java. It didn't gain any traction for browser scripting. They took "Java" out and called it JavaScript. Now we take the "script" out and call it WebAssembly. If someone in 1995 made Java a DOM-editing thing instead of an applet thing, we could have saved 25 years of running around in circles :) (Going back even further, w…

And we’ve increased latency an order of magnitude each time. We have computers that are orders of magnitude faster, yet using a spreadsheet in a browser today is less responsive than it was in DOS decades ago. But the developer experience is so much better now, so it’s worth it?

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

#170
post #119

Earlier quoted context omitted.

> WASM can't even talk to the DOM API directly For now. It's planned.

For existing code bases that don’t already do DOM manipulation (so, all of them) other parts of the Web API might be more useful, like the canvas, the video API, the RTC API etc.

The issue in general is how to bridge these JS OOP APIs to something that's basically assembler.

If WASM gains a foreign object model calling convention or whatever, we're in game.

Post reply on HN