As far as I understand JS code is being run natively in the browser. Node has been hooked to the native engine, so V8 is not involved. At LeaningTech we have since several months been able to run nodejs, but also python and ruby using our Wasm based x86 VM (CheerpX), the demo is available here: https://repl.leaningtech.com/?nodejs With our solution the full Linux x86 binary of nodejs is running including the whole of…
WebContainers: Run Node.js natively in the browser
101–110 of 238 posts
Re: WebContainers: Run Node.js natively in the browser
#102Hi all- CEO of StackBlitz/author of this blog post here. Happy to answer any questions! (Also, thanks for posting this bpierre!)
With all the security and design problems of Node.js, when there are actually secure and reliable ways (harder ways, yes. Security and reliability are hard) to do all of this. Why?
Re: WebContainers: Run Node.js natively in the browser
#103totally lost newbie here: but what is the difference between running javascript on the browser and running node.js on the browser?
This is going full inception mode. Nodejs is compiled to wasm (like assembly for your browser), and then loaded inside the browser, which can then run javascript. So a full JS engine is loaded, completely separate from the built-in one.
Re: WebContainers: Run Node.js natively in the browser
#104Building on the really good work of the WASM folks, running Node.js, with all its design problems, over the top of it.
I am forever astounded anew by the hubris and naivety of the Node.js crew. It is a example of "It is easier to write than read, easier to talk than listen, easier to build than design"
Re: WebContainers: Run Node.js natively in the browser
#105"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 feature…
Re: WebContainers: Run Node.js natively in the browser
#106Wow, the PWA is really impressive. Honestly it's starting to get hard to tell the difference between this and Electron-based editors like VS Code. I'm really excited for integration with the File System Access API; that's the final puzzle piece I'd need to use something like this for serious work.
I'm working on a note taking project right now that I think would be great as a web app, but I'd like to store the result in a flat text file and the file system access API looks like it will let me do exactly that.
Re: WebContainers: Run Node.js natively in the browser
#107This is a really bad idea. Building on the really good work of the WASM folks, running Node.js, with all its design problems, over the top of it. I am forever astounded anew by the hubris and naivety of the Node.js crew. It is a example of "It is easier to write than read, easier to talk than listen, easier to build than design"
Re: WebContainers: Run Node.js natively in the browser
#108What about this is "native"? The page says it is "running natively" but also says "All code execution happens inside the browser's security sandbox". Is wasm in a browser somehow considered native now?
Re: WebContainers: Run Node.js natively in the browser
#109Everyone 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…
Meanwhile, WebAssembly suffers from there not being a good programming language that compiles to it natively. I think the Go support is great, but there's no library support for building the webapps that people get paid to build (React, Apollo, etc. all exist for a reason, however much you hate that reason). AssemblyScript was supposed to be this language, but it's just a Typescript-inspired programming language, it's not Typescript and the npm ecosystem.
I don't know what the details of this implementation are, but the direction I'd like to see web development move is having a statically typed language that compiles to VM bytecode. This sounds like the first step for removing Javascript as a Typescript intermediary. Once that happens, then modern programming language features can be bolted on, people can add good compiler optimizations that result in minimal bytes output for users to download, the module system can be made stricter (like "go mod"), etc. Javascript is just a little bit more dynamic than anyone really wants, and it makes the build/deployment tooling complicated and, frankly, kind of bad.
Re: WebContainers: Run Node.js natively in the browser
#110I 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…
sudo apt install apache2 php libapache2-mod-php; vim /var/www/html/index.php