|
|
|
|
|
by matthewmueller
1498 days ago
|
|
Hey, excellent question. You're correct that Bud server-side renders the Svelte files, then hydrates them on the client. This is similar to what most other JS frameworks do, it works like this: 1. Create two builds: one for server, one for browser. This is done using ESBuild. This is actually done lazily upon request, similar to how a CDN like esm.sh would build JS to be imported. This will hopefully allow the build system to scale for larger apps. Vite was my inspiration here, but it's all done in Go. 2. V8 and the Svelte compiler are baked into the bud binary. When a request comes in, V8 evaluates the compiler running the server-built page and returns HTML. That's a mouthful, hopefully that makes sense. Happy to go into more depth here or via email hi@livebud.com. |
|