stackblitz / webcontainer-core

Dev environments. In your web app.
https://webcontainers.io
MIT License
3.95k stars 176 forks source link

Open-sourcing for the webplatform ? #458

Closed abflow closed 1 year ago

abflow commented 2 years ago

Is your feature request related to a problem? Please describe:

It would be great if any website could have its own "WebOS" and be able to launch their own "Web Containers" in order to have offline-first backend applications directly working into the browser.

Describe the solution you'd like:

Is there any plan on open-sourcing the technology or to begin a standardization process which would allow more actors in the industry to participate to a collective project ?

Describe alternatives you've considered:

Would deno be a better choice than node.js as a wasm component (as deno is built in Rust which is directly compilable to wasm and has a nodejs compatibility layer) ?

Additional context:

The idea of Trusted Desktop Activity has been suggested since november 2018 in the chromium repo.

Some similar ideas from the issue in chromium repo:

One could even compile nodejs to webassembly and run node into the browser with special authorizations for example running node in sandboxed VM mode or allowing access to hard drive only for some user-defined paths for example.

A permissions-based security model similar to the one in Deno could be configured by the user into the browser UI when installing the web application

milahu commented 1 year ago

alternatives

short answer: not really

longer answer ...

webcontainer is a compatibility layer for node apps, similar to wine (Wine Is Not an Emulator)

Wine provides its compatibility layer for Windows runtime system which translates Windows API calls into POSIX API calls -- https://en.wikipedia.org/wiki/Wine_(software)

so were looking for a compatibility layer between node.js apis and web apis

some node apis have polyfills, see https://github.com/niksy/node-stdlib-browser but some node apis are hard to polyfill

fs has some mocks, see https://github.com/niksy/node-stdlib-browser#mocking-fs

child_process

related

closed source

jrvidal commented 1 year ago

We don't have any immediate plans to open source WebContainers, beyond the API client library in @webcontainer/api.

This might or might not change in the future, but I'm closing this issue for now, as it's not really actionable/trackable. If/when that happened, I'm pretty sure that we would make a lot of noise in https://blog.stackblitz.com/ and other venues.

Thanks for the suggestion!

stretch07 commented 1 year ago

@jrvidal any plans yet? offline-first would be perfect for my needs

sanandnarayan commented 1 month ago

just for educational purposes https://github.com/RealSput/Wenode/blob/main/dist/wenode.js

stretch07 commented 1 month ago

just for educational purposes https://github.com/RealSput/Wenode/blob/main/dist/wenode.js

This is super cool, I'll take a look