Re:SimpleSSR: Server-Side Rendering at Scale
by sam0x17 on Saturday October 27, 2018 @07:08PM
(#18318208)
This is the key. There are super developed SSR frameworks and super developed SPA frameworks, but getting the two to work together is like pulling teeth. No one tries to write an SSRSPA framework because that would be considered too "opinionated", but maybe that's exactly what we need.
[ Parent
| on HN ]
Re:SimpleSSR: Server-Side Rendering at Scale
by kraftman on Saturday October 27, 2018 @09:47PM
(#18318714)
Doesn't nextjs do this already? You write an SPA that nextjs implicitly also knows how to render server side
Re:SimpleSSR: Server-Side Rendering at Scale
by leetbulb on Saturday October 27, 2018 @10:13PM
(#18318781)
Yeah, that's essentially the purpose of Next.js and it does it very well.
Re:SimpleSSR: Server-Side Rendering at Scale
by btmorex on Saturday October 27, 2018 @10:35PM
(#18318839)
If you're using node.js and redux, then https://github.com/faceyspacey/redux-first-router pretty easily gets you there. Other than turning route changes into redux actions, I don't find it particularly opinionated.
Re:SimpleSSR: Server-Side Rendering at Scale
by jotto on Saturday October 27, 2018 @11:45PM
(#18319080)
I made https://www.roast.io/ because of this.
Most of the current SPA frameworks can re-hydrate SSR'd JS without issue, so instead of configuring SSR, just use a headless browser, which is what Roast does.
Re:SimpleSSR: Server-Side Rendering at Scale
by friedman23 on Saturday October 27, 2018 @07:56PM
(#18318359)
Ok, I was confused by your comment and the other person's comment. SSR and SPA are not mutually exclusive things.
Re:SimpleSSR: Server-Side Rendering at Scale
by sam0x17 on Saturday October 27, 2018 @08:15PM
(#18318424)
They aren't mutually exclusive, but they are either a) at odds with each other because the frontend is in javascript and the backend is in Rails or Python or something else, or b) completely in sync because the backend and front end is in javascript, but terrible because the backend and the front end is in javascript. With web assembly on the horizon we will soon have Rust/Crystal/Go-driven unified backend+frontends, and then we can finally exit this dark age of JS being the only front end language.
Re:SimpleSSR: Server-Side Rendering at Scale
by goliatone on Saturday October 27, 2018 @10:37PM
(#18318845)
I have not had the chance yet to play with it but it’s very high in my list, drab an extension library for the Phoenix framework “providing an access to the browser's User Interface (DOM objects) from the server side”.
A friend did an experimental library way back using server sent events for the Yii framework. I don’t think I fully appreciated the idea back then. Admittedly Elixir seems a better fit for this pattern than PHP tho
Re:SimpleSSR: Server-Side Rendering at Scale
by friedman23 on Saturday October 27, 2018 @08:37PM
(#18318502)
As someone that prefers python it is unfortunate that the only way to get SSR is to commit to JS but with web assembly I think we will eventually have tools such as React and Redux be translated to other languages.
As far as performance goes js isn't too bad. It's async by default and a lot of effort has gone into making it run fast.