lit / lit

Lit is a simple library for building fast, lightweight web components.
https://lit.dev
BSD 3-Clause "New" or "Revised" License
18.22k stars 903 forks source link

Consider releasing lit-labs/ssr with a WASM option #4611

Open bivens-dev opened 3 months ago

bivens-dev commented 3 months ago

Should this be an RFC?

Which package is this a feature request for?

SSR (@lit-labs/ssr)

Description

As things stand currently in order to use @lit-labs/ssr you need to have your web server be a Node application which for a lot of people otherwise wouldn’t make sense.

I was wondering if through standards aligned projects such as this https://github.com/bytecodealliance/javy or this https://github.com/bytecodealliance/ComponentizeJS that it might be possible to build a WASM file as well with SSR support that would allow its usage in non Node backends.

Alternatives and Workarounds

At the moment the only alternative I’m aware is to use an RPC style setup such as gRPC where I run a sidecar style second process but it requires substantial glue code.

justinfagnani commented 3 months ago

I don't think there's bandwidth on the team to try this right now, but it seems like a lot of it should be trying to run the existing SSR code within one of the JS-in-WASM toolchains. It would be great to see someone try that and report back on if we need to change anything.