kadirahq / fast-render

Render you app even before the DDP connection is live. - magic?
MIT License
560 stars 80 forks source link

PublishContext should inherit from Subscription #159

Closed mitar closed 8 years ago

mitar commented 8 years ago

Because now is trying to mock Subscription, but not everything is there. Like _session, _subscriptionId, _idFilter and so on. I have quite some packages which extend publish handlers and use those internal values which will now not work inside SSR. Now, one option is that I manually make all of them work, or we just fix PublishContext to be more compatible with normal subscription.

mitar commented 8 years ago

See the issue which lead me to this: https://github.com/peerlibrary/meteor-reactive-publish/issues/7

arunoda commented 8 years ago

Yeah. That's a good idea, Could you send me a PR. I'm happy to take this in.

You can get the Subscription class from here: https://github.com/meteorhacks/meteorx

mitar commented 8 years ago

Hm, the issue is that it is not enough just to extend it, but one should also configure all fields correctly. Not sure if this is doable. Like where to get session information.

arunoda commented 8 years ago

Okay. That's a big project. Anyway, is there anyway we can build packages like yours without using those internals. If we can have a set of stuff we use, I think I can do something.

mitar commented 8 years ago

I think I found a way.

arunoda commented 8 years ago

Awesome. Keep me posted.

mitar commented 8 years ago

See #160.

arunoda commented 8 years ago

Hope we can close this and I merged @mitar's PR.

SachaG commented 8 years ago

Does this mean the issue is also fixed for FlowRouter SSR? Or just Fast Render for now?

arunoda commented 8 years ago

Just the FastRender. I'll do a release today.

arunoda commented 8 years ago

@SachaG published a new version of FlowRouter SSR.