woutdp / live_svelte

Svelte inside Phoenix LiveView with seamless end-to-end reactivity
https://hexdocs.pm/live_svelte
MIT License
1.01k stars 38 forks source link

Feature: Run SSR with deno_ex #45

Closed dev-guy closed 1 year ago

dev-guy commented 1 year ago

There are many benefits of Deno over NodeJS (e.g., it seems like it might be lighter weight since some of the legacy libraries have been removed), but there may be compatibility issues.

deno_ex might be the best vehicle to get there.

woutdp commented 1 year ago

Very interested in this, for me the main advantage is that it seems to be installed automatically. Instead of having to make sure you have Node installed.

Also interested in Bun though, although I'm not sure if that's feature complete yet.

terrisgit commented 1 year ago

Bun looks cool but it is not ready yet.

aiwaiwa commented 1 year ago

Deno is cool and fast, there's still some stability questions still https://deno.com/manual@v1.34.0/runtime/stability

woutdp commented 1 year ago

Then I'd think it make sense to both support Node and Deno, so the user can choose in case they hit against an issue with Deno. Then we can also support Bun in the future while maintaining more stable options

dev-guy commented 1 year ago

I spent a few hours today with deno_ex. The master branch is required to use an Intel MacBook -- hopefully version 0.3 will be released soon. deno_ex runs a script or typescript in a string and returns whatever was sent to stdout.

Deno doesn't seem to work out of the box with npm modules, so everything in package.json would need to be Deno-ified. See https://github.com/afaur/deno-pogo-svelte-starter for a basic example where they deno-ify a particular version of Svelte from 2020.

You might as well close this as impossible.

woutdp commented 1 year ago

Thank you for investigating @dev-guy , sounds like we'll have to wait a bit.

Feel free to reopen/comment if the status changes on the Deno project (or Bun).

terrisgit commented 1 year ago

Bun might turn out to be more realistic, but I wonder what the advantage would be over node besides having more bugs. I wish I could get SSR working and figure out why so many svelte components won’t work with it. Maybe sveltekit isn’t very SSR friendly so nobody notices

woutdp commented 1 year ago

SSR should work though in theory, it's probably an issue on our side.

As for Bun, theoretically it should speed up SSR. It's also made in zig, which makes me wonder if it would be possible do someting with Zigler, although that might be completely unrelated