-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Has anyone managed to get SSR to work consistently? #133
Comments
FWIW, we too experienced Node process leaks with SSR enabled. Tried a few different things, including configuring Node to GC more aggressively. Eventually decided it wasn't worth it and disabled SSR. |
The default implementation of It kills performance and possibly introduces memory leaks. I'm not exactly sure what's the best way to set NODE_ENV, since worker env is not customisable. Maybe setting env variable for elixir process would be enough, since ENV should be inherited? 🤔 I noticed all these problems when implementing PR with ESM modules support needed for my library LiveVue to function correctly. There's some actions from maintainers, hopefully it will get better soon 🤞 |
sorry for the dumb question but why can't phoenix/elixir take the place of SSR? |
quick reply: seems like changing
@dmbr0 Phoenix can SSR anything you want but there's a case when you have lots of JS-based components written in Svelte / Vue / React / whatever that are not ported to LiveView / PHX. One can go and "copy" needed components into heex templates but this might become a mess to support. Hence most people need to render JS components on the server for SSR -> Node or Bun dependency is inevitable. |
I am hoping this issue is fixed soon |
@timadevelop how would it be anymore of mess than the components being somewhere else? I just feel like the erlang VM would be better suited at taking over SSR than the node VM. these memory leaks are notorious and the erlang VM is much better at managing system resources. |
after my limited interaction with this I just think having the erlang/elixir VM take over SSR from node would be incredible with svelte. |
Maybe I misunderstood your statement, but there's no way to render or run JS without node/bun/other JS runtime. There might be someone who is fond of binding BEAM with V8 / Chakra / JSC but it's a huge amount of work and will likely come with its own problems.
If you mean ditching JS on server side and leaving it only on client-side, you're looking into something like alpine / jquery / lit / liveview. In all other cases, when traditional frameworks like React / Solid / Svelte are used, supporting 2 versions of the same component in 2 different ecosystems is unfeasible for most teams imo. We're stuck with these frameworks until someone creates react-aria / radix alternative that works on all platforms with all languages. i.e. "universal accessible component system" that runs everywhere you want: on BEAM without JS, on JS env, in browser, in ruby, etc. Years ago I thought about creating such a design system + a set of libraries for many platforms, came to a conclusion that I need tons of cash and time to achieve this. Web components ergonomics are not on par with modern frameworks (unfortunately). SSR with JS runtime on backend is defo not a "lean" solution, it's a mess we have to live with because of hiring and existing ecosystems. Devs need to ship -> no time invest into something better -> occasional memory leak is acceptable for most companies because these modern JS frameworks allow them to ship fast. |
It seems like NodeJS server process leaks leading to a crash and I wonder if it's something on my side.
I could go down the road of debugging these leaks, though I'm not sure it's worth the time considering other folks gave up and disabled SSR.
Are there people who actually use SSR with live_svelte & NodeJS in production?
The project is on
0.13.1
vsn.Thx for your work @woutdp
The text was updated successfully, but these errors were encountered: