Fork me on GitHub
#re-frame
<
2022-10-18
>
TJ Campanella19:10:13

I am wondering if reframe support server side rendering at all? Are there any resources I can look at about this?

p-himik19:10:18

There's little re-frame-specific in SSR, assuming you stick to good re-frame practices, like not calling dispatch during a render. So, it all comes down to SSR in Reagent, and there's plenty of materials that could be found in this Slack or elsewhere online - it' been discussed a lot.

TJ Campanella19:10:42

Ok do you know of any specific examples/articles I can look at?

p-himik19:10:51

I'd have to use the same search myself. :) I just know that there's a lot of material out there. I'd recommend searching on Slack first, specifically in #reagent - Slack search input field allows you to limit search to a specific channel.

TJ Campanella19:10:14

Ok thank you I will do some digging

👍 1
valerauko12:10:50

depending on what you're trying to achieve. i just made an example repo the other day https://github.com/valerauko/hoge/

valerauko12:10:12

re-frame itself works just fine with server-side rendering (react's rendertostring). what gets tricky is browser-specific stuff such as the window.location object or the lack of the document object on the server side. these can break most libraries (routing etc) that assume a browser

valerauko12:10:28

what you do have to be careful about is the re-frame state (app-db) living in a server process, meaning all your requests will end up sharing the same db (even if you manually reset the db at each request, if requests arrive at the same time, i have no idea how it'll behave)