-
Notifications
You must be signed in to change notification settings - Fork 45
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
Server Support #80
Comments
I'm not quite sure it makes sense, because the name -> count mapping comes from the publication body. |
Hmm that's true… I guess I'll do this for now then:
|
Yup! On Fri, 19 Feb 2016 at 14:06 Sacha Greif [email protected] wrote:
|
I guess if we wanted to solve this in a cleaner way, we'd have to register the count outside of the publication, and then only reference it inside the publication? Or maybe not have it in the publication at all? |
Looks like Arunodas thing works different to how I thiught
|
You should definitely give it a try |
I don't know if this is related to the latest FlowRouterSSR or if this has been happening all along and I just now noticed it, but calling @arunoda any thoughts about this? |
@SachaG, could you resubmit the FlowRouterSSR problem as a separate issue? It'll certainly help users with the same problem that may not realize this discussion is buried under a closed topic. |
I am having the same issue as @SachaG. Basically, using FlowRouter SSR, on the server side, I get:
I thought about moving this file to server, but |
@sungwoncho sorry for the late response, I'm currently out of town. Unfortunately I'm not familiar with FlowRouter SSR, so I'm restricted to one technique for troubleshooting at this time. I need a code example using publish-counts and flowrouter-ssr that reproduces this issue, with instructions explaining how to use the app to produce the error and what the expected result is. A github repo of a meteor app is most preferred as the example, though it need not be the project you're working on. A new meteor app project that only produces the error is sufficient. If you can provide that then I can dig further. Otherwise, your best bet is likely to code isServer/Client checks that swap out publish-counts functions for a server-only variation. |
I was actually thinking about this again yesterday and I think creating a server-only The main issue is how to store the counts. We could put them in an object inside |
Also just to clarify, there's two separate issues here (my bad for mixing them up):
|
Actually i's not that easy, because as far as I can tell there is no way to get a session ID from within SSR code… See kadirahq/flow-router#640 |
@sungwoncho thanks! btw, what are you using? React Router? Or regular FlowRouter? |
@SachaG I am using the regular FlowRouter. |
Thanks for the repo example. If I have time this evening, I'll dig through it, otherwise I'll start tomorrow. |
FWIW I decided to implement a simpler version of this package myself. This is what I ended up with: https://github.com/meteor-utilities/react-list-container/blob/master/lib/cursorcounts.js I couldn't figure out a way to uniquely identify a user so I used another approach: I'm uniquely identifying the cursor instead, based on the publication name and subscription terms. |
Since
Counts
is only defined on the client, the package doesn't work with server-side rendering. Maybe I could submit a PR for that?The text was updated successfully, but these errors were encountered: