-
Notifications
You must be signed in to change notification settings - Fork 12
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
SSR experiment #2
Comments
I am currently working on the SSR feature here ssr branch, but I am struggling to do it without customizing esbuild. Do you have any ideas about that? I haven't gotten it to work yet, but hopefully soon. Do you think that since all the live_[insert framework] packages basically use the same starting point, it would be a good idea to have something like a core package they can all use? Maybe you could even have multiple frameworks at the same time if needed (hard to imagine why, but it would be possible). Also, I can't help but feel that in the case of React, it would benefit a lot from Vite's goodies. Do you think maybe a Vite integration with an igniter generator or mix task would be a good idea? I am new to Elixir and Phoenix, but I am loving the idea of generators to abstract away tedious tasks like installing a package. |
I am currently working on the SSR feature here ssr branch, but I am struggling to do it without customizing esbuild. Do you have any ideas about that? it would be a good idea to have something like a core package they can all use? Maybe you could even have multiple frameworks at the same time if needed (hard to imagine why, but it would be possible). Also, I can't help but feel that in the case of React, it would benefit a lot from Vite's goodies. Do you think maybe a Vite integration with an igniter generator or mix task would be a good idea? |
I manage to make it work but it's far from being production ready. For the hooks modification it's quite lite just adding hydrateRoot if it was ssr rendered I could not find the way to build the server in dev env automatically yet. I put the server.mjs in the For the component we need to call the nodejs render two time I don't think there is another way around except caching but I could be wrong. I'm not sure I understand completely the original code from live_vue it seems to not call the ssr two times https://github.com/Valian/live_vue/blob/main/lib/live_vue.ex |
#7 |
After reading this issue, I decided not to implement SSR (Server-Side Rendering) when I first wrote and published the library.
However, I believe it's now worth exploring this area. React seems to outperform Svelte and Vue in SSR, according to this benchmark.
A good starting point would be implementing something similar to what they are doing in
live_vue
orlive_svelte
with behavior, as seen here.Afterward, we could benchmark and experiment with different renderers such as Node.js, Deno, and Bun. It appears that Bun performs particularly well when rendering React, as discussed here.
The text was updated successfully, but these errors were encountered: