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…
WebContainers: Run Node.js natively in the browser
221–230 of 238 posts
Re: WebContainers: Run Node.js natively in the browser
#222Hi all- CEO of StackBlitz/author of this blog post here. Happy to answer any questions! (Also, thanks for posting this bpierre!)
You’re welcome :) Any plan to work towards supporting Firefox & other browsers?
Re: WebContainers: Run Node.js natively in the browser
#223Earlier quoted context omitted.
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
#224Earlier quoted context omitted.
> These are mostly a to-do list...which makes sense at this stage Which stage is it? Chrome is already shipping this, enabled by default. And the "todo list" covers important issues around permissions, restricting file system access we etc. > Do you think that Apple or Mozilla can stop webapps from taking their rightful place? I think that Chrome plays fast and loose with web standards, and has essentially replaced w…
> Which stage is it? The stage where a majority of professional web devs (y'know, the people who aren't here!) still haven't even heard, or fully assimilated, the term "PWA" yet. > the "todo list" covers important issues around permissions, restricting file system access we etc. They've proven very capable of managing this in AOSP. > I think that Chrome plays fast and loose with web standards, and has essentially rep…
Anecdotally, I feel that the quickly growing number of websites that complain that Firefox is an "ad blocker" with an unconfigured, out of the box default install seems to imply Mozilla is doing a great job with respect to security+privacy.
> Mozilla isn't leading the way on web standards anymore.
All the way back to the IE3-6 era, Mozilla has never been about "leading" web standards. IE3-6 lead web standards. Mozilla's role in web standard has almost always largely been about curtailing the excesses of whoever is currently leading, and keeping standards fair, safe, "quality" over quantity.
It's not Mozilla's job to keep up with ~IE6~ Chromium, it's their job to keep Google from spinning web standards out of control. To keep Chromium from being IE6 2.0. To keep Google from just defining all the standards in ways that make Google happy but maybe aren't great long term for the health/safety of the web. It's Mozilla's job to slow Chromium down, and the fact that people are complaining "Firefox isn't keeping up" with Chrome's non-standards and in general that they are losing that battle in mainstream browser usage isn't at all great for the web. (The last time something like this happened was IE6. Whether or not Chromium is the "New IE6" will take a while to play out, but we're deep into the IE6 playbook at this point and anyone not seeing parallels either doesn't remember the early years of IE6 well or has too high of an opinion of Google.)
Re: WebContainers: Run Node.js natively in the browser
#225Reloading now spends 10+s "installing dependencies" - pretty quick, and the UI is still interactive.
Also, Chrome has two "Google Chrome helper" processes each sitting at 550MB+ RSS. I'm not sure if "no node_modules black hole on disk" is quite as compelling if the black hole has merely been relocated to RAM.
Re: WebContainers: Run Node.js natively in the browser
#226I 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…
How did you end up doing this? Do you mind sharing?
Re: WebContainers: Run Node.js natively in the browser
#227This makes me want to quit webdev and never look back. Why the fuck are we recreating operating systems in the browser? We already have operating systems. We already have containers. We already have native code execution.
Re: WebContainers: Run Node.js natively in the browser
#228If it really runs inside the Browser: How did they implement adapters for networking and crypto/tls? I mean, a console is nice and all. But I'm highly sceptic as to how the filesystem and networking works, because fetch cannot be used to have dgram or tls/net sockets. And that is literally the primary reason nodejs exists.
Part of the answer to your question: > WebContainers include a virtualized TCP network stack that's mapped to your browser's ServiceWorker API, enabling you to instantly create live Node.js servers on-demand that continue to work even when you go offline.
This sounds very likely like http module injection, so that the nodejs module isn't really doing what it thinks it does, but is using an injected API behind the scenes.
Raw TCP is only available for Chrome Extensions, on Chrome OS, iirc.
(Setting aside the lack of TLS or a real crypto module that isn't using the Browser's Web Crypto API approach)
Re: WebContainers: Run Node.js natively in the browser
#229Hi 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…
Re: WebContainers: Run Node.js natively in the browser
#230Earlier quoted context omitted.
You’re welcome :) Any plan to work towards supporting Firefox & other browsers?
Yes definitely! Firefox compatibility is close to done and will ship soon. Waiting on Safari to ship some additional features. They don’t share timelines so it’s unclear at this point.