AdamBrodzinski / meteor-flux-leaderboard

Flux Example with React & Meteor
131 stars 19 forks source link

SSR without fast-render #5

Open ShockiTV opened 9 years ago

ShockiTV commented 9 years ago

I was not able to make fast-render work correctly in your flow. When I add subscription to that react mixin in getMeteorData(), it gets send to client. But than I was not able to instruct app to render with player list. Mby I am just not understanding the Alt flow in that situation there correctly. It is based on master branch. Good luck.

AdamBrodzinski commented 9 years ago

Cool i'll check this out this weekend! I haven't had a lot of time to play around with SSR yet :smile:

When I add subscription to that react mixin in getMeteorData(), it gets send to client. Hmm so you're saying if you use the mixing the fast-render data gets sent to the client and if not nothing gets sent?

With flux, specifically Alt, I think we'd have to render on the server then snapshot the state, then flush that data to the client somehow (like fast-render does) then when the store initializes it would hook into the bootstrap lifecycle and use that global data that was flushed to prime the store.

I'm not sure how FlowRouter 3 is working, I was hoping it would just see the subscription and then send down the data (perhaps moving it into a component would help?).

ShockiTV commented 9 years ago

Seems you need to place it inside that React Mixin getMeteorData() to be picked by fast-render. When I did it than it was sent to client. But than I got stuck in that event flow somehow.

AdamBrodzinski commented 9 years ago

@ShockiTV just wanted to say I didn't forget about this and will get around to is soon... being barraged by client work at the moment :smile: