Fork me on GitHub

it means using the same code on the server and client. like react does so having a single component that is rendered on the server and on the client. on the first page load, it is rendered on the server and then SPA takes over

Braden Shepherdson04:02:23

well, you can render a Hiccup template easily enough, and I think the subscription system works. so if the server supplies an app-db, it should be practical to do an initial render. the hard part would be adjusting the app as shipped to have it attach to the already-created DOM instead of rerendering it. I have no idea how hard that would be.


that can be done through react-dom/hydrate. I’ve already done that part. but I was thinking more about subs and dispatch.. I guess I just have to play around with it


well, subs and dispatch don’t make a whole lot of sense on the server-side. if you’re just filling in the initial state, it’ll probably work


the biggest issue is preventing two requests clobbering if you have per-request state in the app-db


if only re-frame’s re-frame.db/app-db was marked ^:dynamic, you could use binding inside of your route handler on the server to provide a new app-db per request