Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can SSR be enabled with V8 engine? #288

Closed
maietta opened this issue Jul 24, 2023 · 2 comments
Closed

Can SSR be enabled with V8 engine? #288

maietta opened this issue Jul 24, 2023 · 2 comments

Comments

@maietta
Copy link

maietta commented Jul 24, 2023

Another project somewhat similar, called "Bud" (see https://github.com/livebud/bud), can let you serve a Svelte frontend with a Go backend.

It's my understanding that SSR is handled by Go via the V8 engine.

Could this project be adapted to do something similar? I don't know if that would make sense for this project but I'm throwing that out there.

I'm looking for ways to run my Svelte node apps purely from a compiled Go binary. I guess these tools replace the need for SvelteKit, which is the part I think I'm missing in my mental gymnastics n the subject.

@jimafisk
Copy link
Member

If you want on-demand rendering (building the page when a request comes to your app), something like Bud is the way to go. Currently Plenti only handles build-time rending (building all the pages before the app is deployed) for "Jamstack" style websites. In other words, it usually runs in CI to produce static HTML and then gets entirely out of the way (the HTML gets deployed to your host, but the Plenti binary never does). So Plenti actually does SSR currently (we do it in V8 as well), it just does it during the build process.

Matt (the creator of Bud) and I talk about this problem space fairly often, we'd also like solve the problem you're posing here. Doing things in V8 works, but is challenging for several reason (e.g. requires CGO which makes cross compiling hard, doesn't support concurrency, has performance and debugging issues). Ultimately a UI compiler written in Go would allow you to write reactive frontends in a single binary without dependencies and performance issues - it's just a large undertaking to create something like this.

Is there a particular reason something like Bud isn't working for your project?

@maietta
Copy link
Author

maietta commented Nov 13, 2023

Thank you.

@maietta maietta closed this as completed Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants