-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Deployment #352
Comments
No you do not need Go installed to use Plenti locally or to serve compiled assets for a live site. Go would only be needed if you wanted to contribute to building out the framework itself, sorry for the confusion! You're right that it's a static site generator (SSG). |
@jimafisk Do you now how to do Svelte SSR with Goja (Go JS engine)? |
I've certainly thought about using Goja (#169), but currently it comes with some pretty significant performance costs over using V8: #3 (comment) (although it's getting better #3 (comment)) The V8 set up has issues as well: slow builds for the Go binary, missing cross compilation targets, memory issues for compiled assets at scale, Svelte upgrade limitations, etc. I'm actually working on some ideas for building a templating engine that would allow SSR and some DOM interactivity using attributes (AlpineJS or something similar). I've been using Goja to evaluate JS and it's working pretty well so far. It's really just ideas at this point https://github.com/jimafisk/custom_go_template |
@jimafisk Oh wow. You've done serious investigations into the topic. If you and Matt couldn't solve it, I probably won't be able to do any better given you guys know this space better than me. In terms of your cgo cross-compilation issue:
|
I'm working on a Go/Svelte entire framework to "replace" SvelteKit (but still use SvelteKit lol). If you manage to even get a barebone solution with Goja, let me know. That would be awesome. Thanks |
https://github.com/K-Sato1995/go-ssr-poc This project uses React + v8 |
I'm not sure either of us have had time to fully explore it. I don't think it's an easy problem to solve, but new eyes taking a look certainly can't hurt!
That sounds cool! Do you have a link for interested folks who come across this issue in the future?
Yeah SSR can be tricky. How are you doing the DOM compilation currently? We do both the DOM and SSR targets in V8.
We use |
I will release what I've done soon and let you know. I'm not compiling the DOM at the moment. That's what I'm exploring. I'm literally just serving the I'm happy with that. The SSR is a bonus - even if it's just for crawlers. Google states that they don't index client-side websites anywhere near as frequently as a punishment. |
This might be useful: https://jtarchie.com/posts/2024-08-30-exploring-goja-a-golang-javascript-runtime |
I'm trying something that you might find interesting: sveltejs/svelte#14909 and sveltejs/kit#11836 https://github.com/jsdom/jsdom |
Ah yes, I ran into Svelte replace vs append issues as well: |
Here is the solution we are looking for: nichady/golte#16 |
@jimafisk I don't understand nichady's solution as yet but he has gotten it to work with Svelte and Goja/Goja-Node. But here is another solution (for React) that is possibly similar to what you are already doing but it appears more cleaner and easier to follow. See:
The Svelte Team just responded with a solution: sveltejs/svelte#14928 |
Is a Go server needed for running this on the server?
It says "Go backend" but also says Static Site generator so I got confused.
The text was updated successfully, but these errors were encountered: