Stream: jco

Topic: Web frameworks in components


view this post on Zulip Lachlan Heywood (Apr 23 2024 at 19:36):

Anyone got any interest in messing around with running web frameworks (Next, Remix, Nuxt, SvelteKit, et. al) inside a component? I've been doing some rabbithole-spelunking today and it seems there are few hurdles. Wondering if there's other prior art that has been explored

view this post on Zulip Guy Bedford (Apr 24 2024 at 03:03):

@Lachlan Heywood the major thing here is bundling up the Node.js builtin shims, and that should get pretty far in the build system. It's still early days, but ideally we could even include Node.js compatibility layers by default, this and other compat will continue to improve over time in StarlingMonkey (https://github.com/bytecodealliance/StarlingMonkey), but it should be possible to get quite far with some build configs and some monkey patching.

Fission may have made some progress here I believe in this, but I haven't looked too closely at it - https://github.com/fission-codes/stack/blob/main/packages/homestar/src/wasmify/index.js

The StarlingMonkey JS runtime. Contribute to bytecodealliance/StarlingMonkey development by creating an account on GitHub.
⌘ Fission Stack. Contribute to fission-codes/stack development by creating an account on GitHub.

view this post on Zulip Lachlan Heywood (Apr 24 2024 at 18:10):

Thanks, @Guy Bedford! This is helpful. I think part of my problem is going to be that NextJS expects to be run by their CLI, and there's no clear entry point to create a component from. They have support for custom servers like express, but that configuration doesn't have support for server side functions, which is the majority of the reason for experimenting here. Vercel has their documented Build Output API (https://vercel.com/docs/build-output-api/v3) which is how cloudflare adapts next to run on Workers and I'm thinking this might be the next best router to investigate.


Last updated: Oct 23 2024 at 20:03 UTC