You could probably go the Stackblitz

You could probably go the Stackblitz route? Only thing there is you can’t run dev there
3 Replies
juanferreras
juanferreras5d ago
hey HardlyWorkin! Thanks for the response. Initially I was going to use sandpack (codesandbox) – but typescript support and actually deploying to preview changes seemed to work pretty well (esp. to make sure what they build fit into how I intend to RPC to them via my dispatch worker) would you mind ellaborating on what'd be the stackblitz route? e.g. iframing/embeding their editor SDK and being able to get a built output programmatically? Gotta admit that if somehow I can run wrangler deploy --dry-run --outdir dist – it'll be a much safer path to pursue
juanferreras
juanferreras5d ago
that's pretty interesting
No description
juanferreras
juanferreras4d ago
using https://developer.stackblitz.com/platform/api/javascript-sdk-vm#getfssnapshot you can embed an SDK with files you declare, run the build on changes like "start": "chokidar 'src/**/*.{js,ts,jsx,tsx}' -c 'pnpm run build' --debounce 1000 --initial", and then use await vm.getFsSnapshot() to get the contents of dist/**and upload that to the worker for platforms API (you can do much fancier things with the Web Container API but looks like you require licensing for commercial usage)

Did you find this page helpful?