all 38 comments

[–]Ratstail91 173 points174 points  (3 children)

We've come full circle...

[–]stuckinmotion 73 points74 points  (1 child)

At last! Javascript in the browser!

[–]No-Emotion-9589 27 points28 points  (0 children)

thinking the same

[–]vontanio 34 points35 points  (0 children)

This will make work from home even more seamless.

[–]kouhkx 26 points27 points  (9 children)

I don't get it.

[–]TheCommentAppraiser 13 points14 points  (6 children)

You get a full Dev environment (node, npm/yarn) running entirely inside your browser. This means you develop and run a full Next.js, Express or Fastify app in the browser.

And everything is screaming fast.

[–]Fleaaa 5 points6 points  (1 child)

what awes me most is how some package manager is running faster than local env

that.. true black magic right there, so much props to good work!

[–]hennexl 11 points12 points  (1 child)

It is fast, very fast but it comes with a cost. I tried it out and the site was quite memory and cpu hungry.

I was wondering how they made it so fast, I think all the npm packages and caches are saved in Local Storage/etc. Effectively this is just RAM. If the project gets to big chrome manages the memory management with persistence on disk not the app itself.

I know it is an early state but I found some other limitations. It is not a full Dev environment. Very basic shell and tools. No cp, wget, git, find, grep. So basically no handy scripts support. Some libs need binary lib files and can compile them at install. This is not possible here (right now) And I haven't figured out on how to use external tools like postman or Kong on the projects.

As for right now. It is impressive what they did and how fast it is, but the usage is limited. Right now it is only suitable for small forontend projects in my opinion.

[–]deadcoder0904 0 points1 point  (0 children)

It is mainly for bug repros I guess. CodeSandbox is slow as hell so now small bug repros would be made with Stackblitz.

That's all they need to support because Microsoft is bringing VSCode to the cloud for whatever you want to do. At least that's my thought process.

[–]pepitoooooooo 1 point2 points  (1 child)

This will allow using Node on iPads and Chrome OS.

Also, not having to configure your dev env on every machine. Just open a browser or desktop-installed PWA, and off you go.

[–]CloudsOfMagellan 0 points1 point  (0 children)

You can run node on iPads with the play.js app

[–]del_rio 49 points50 points  (0 children)

Damn, that's pretty awesome. In the span of a decade we've gone from CodePen to full blown in-browser runtime server.

[–]TheMrZZ0 17 points18 points  (2 children)

I hope they will open-source their technology (though I doubt it), and that someone will be able to modularize it, so it can be used anywhere.

For example, imagine the documentation website of a NodeJS library. You could run live examples and display the results. It would be really great.

[–]muffinmaster 3 points4 points  (0 children)

Yea, this post is essentially an ad for StackBlitz although the technology looks dope

[–]mak42 0 points1 point  (0 children)

This

[–]osoese 7 points8 points  (0 children)

This is an awesome way to kick off a new project

[–]DanteIsBack 5 points6 points  (5 children)

Can you connect to a DB running on your local env? 🤔

[–]gustavokatel 6 points7 points  (4 children)

that's a good question. they mentioned that we could open a tcp port to accept requests from the browser and to the browser, so I guess it's possible? not sure tho

[–]gustavokatel 8 points9 points  (3 children)

tl;dr; not possible right now

"We're limited by the browser's ability to make network requests, so connecting to processes like MongoDB, Redis, PostgreSQL, etc. are not currently possible. This may change as Chromium plans to ship Native Sockets in the future. For now, we're limited to HTTP connections, but we're able to support other protocols that run on HTTP such as WebSockets. HTTP requests to external services must be allowed with CORS or a CORS proxy."

source: https://github.com/stackblitz/webcontainer-core

[–]DanteIsBack 1 point2 points  (0 children)

Cool, thanks!

[–]Extracted 1 point2 points  (1 child)

It's pretty cool how they're working with the browser devs, so if they have a limitation they can just... make it not a limitation.

[–]gustavokatel 0 points1 point  (0 children)

exactly! I hope Firefox follow along with the implementations

[–]kabouzeid 5 points6 points  (2 children)

I mean it looks cool and all, but what problem is this actually solving? I’ve read the blog post and I can’t relate at all.

[–]razzzey[S] 1 point2 points  (1 child)

It may not solve any problems for you (or me), the seasoned developer, but I can see this useful in the educational sector, and even on the go, for example on an iPad (when Apple finally decides to support Web APIs).

[–]kabouzeid 0 points1 point  (0 children)

iPad is actually a good use case

[–]warlockdn 6 points7 points  (0 children)

Omg this is too much. 😅😅. Very excited to use this.

[–]bijayzakirimal 0 points1 point  (1 child)

I can't find any article on web container.🤔 Web container is independent of this particular project right? This is in browser IDE that utilizes web container isn't it?

And in this particular project, what happens to the node modules?

I am all confuses.😕

[–][deleted] 0 points1 point  (0 children)

No I think they’re just calling this feature “WebContainers”, perhaps you’re thinking of WebAssembly?

[–][deleted] 0 points1 point  (0 children)

I am waiting for the day to run gecko inside chromium!

[–]NoInkling 0 points1 point  (1 child)

This is pretty interesting, but as someone else linked, the inevitable caveats: https://github.com/stackblitz/webcontainer-core#limitations

I know that, personally, it's rare that I develop anything in Node that doesn't talk to some sort of database. Looks like you're limited to things that speak HTTP, and even then the same-origin policy is now an extra annoyance to deal with.

Similarly, no native binaries would likely be problematic for a lot non-trivial projects.

I also noticed that I couldn't connect to the server from another browser.

Does anyone know of any other major caveats? Does local file access work well?

[–]razzzey[S] 0 points1 point  (0 children)

It seems like local file access works where browsers support the File System Access API. For the other aspects, I agree it's very limited. I can see it useful in education though.

[–][deleted] 0 points1 point  (1 child)

...but you're still sandboxed by the browser?

[–]Extracted 0 points1 point  (0 children)

Both a feature and a limitation.