4 ms·
JS/TS interop, sure--but what are the use cases for running a JS runtime inside WASM?
by tennex 8mo ago
JS/TS interop, sure--but what are the use cases for running a JS runtime inside WASM?
- potsandpans 8mo agoIirc, Shopify uses this to execute storefront code on the edge in a sandboxed environment. People who want to write JavaScript for backend store functionality can, and then Shopify deploys that code into containers with small IO semantics
- drysart 8mo agoI believe Shopify looked into using a JS engine in WASM for front end sandboxing but ended up using a wrapper around the Shadow Realms API instead.
- potsandpans 8mo agoIt's not front end sandboxing. It's edge function sandboxing. And they do indeed have this in prod: https://shopify.dev/docs/apps/build/functions/programming-languages/javascript-for-functions https://shopify.dev/docs/apps/build/functions/programming-la... > Shopify CLI compiles your JavaScript code using Javy, our JavaScript-to-WebAssembly toolchain. I've actually used Javy. Kind of interesting: https://github.com/bytecodealliance/javy https://github.com/bytecodealliance/javy.