mizzao / meteor-sharejs

Meteor smart package for transparently adding ShareJS editors to an app
MIT License
225 stars 53 forks source link

Fix readme for blaze #10

Closed MichalW closed 10 years ago

MichalW commented 10 years ago

Small fixes in readme

mizzao commented 10 years ago

Thanks for really jumping the gun on this PR, I guess :)

Blaze isn't totally working yet and so I haven't modified the README. I'll merge your changes in with additional edits when I'm ready.

MichalW commented 10 years ago

I working with sharejs in blaze, maybe I will send you other pull requests :)

Best regards Michał Wanat

2014-04-02 14:53 GMT+02:00 Andrew Mao notifications@github.com:

Thanks for really jumping the gun on this PR, I guess :)

Blaze isn't totally working yet and so I haven't modified the README. I'll merge your changes in with additional edits when I'm ready.

— Reply to this email directly or view it on GitHubhttps://github.com/mizzao/meteor-sharejs/pull/10#issuecomment-39325997 .

mizzao commented 10 years ago

It looks like we will need to write a custom UI.Component to make this work, because Blaze won't actually re-render the template as before and we need to update the contents ourselves and make sure that ShareJS actually disconnects and connects to a new document. I am trying to understand the component API.

How are you approaching this right now?

MichalW commented 10 years ago

Yea, meteor don't re-render this if I have more than one pages with sharejs. I not yet solved this problem

2014-04-02 15:13 GMT+02:00 Andrew Mao notifications@github.com:

It looks like we will need to write a custom UI.Component to make this work, because Blaze won't actually re-render the template as before and we need to update the contents ourselves and make sure that ShareJS actually disconnects and connects to a new document. I am trying to understand the component API.

How are you approaching this right now?

— Reply to this email directly or view it on GitHubhttps://github.com/mizzao/meteor-sharejs/pull/10#issuecomment-39327966 .

mizzao commented 10 years ago

I am working on that right now by writing a custom UI.Component. I couldn't see any other way to do it.

swese44 commented 10 years ago

Now that the rendered() event is only fired one time, there are 2 methods people are suggesting on the forums:

  1. Add a Deps.autorun() in iron-router's onRun() hook (maybe this can work on created() or rendered() template method instead?). Run any code in this autorun block. Make sure to store a reference to the computation object it returns, and then call computation.stop() on iron-router's onStop() hook (or destroyed() template method?).
  2. Create a template helper that runs your code but returns an empty string. Call the helper just one time in the template.

Both of these solutions are hacks and neither are a good solution. Hopefully we will get a new methodadded to replace the lost rendered() method.

mizzao commented 10 years ago

@swese44 Those two approaches both have problems.

swese44 commented 10 years ago

I see you're already digging into this :) https://github.com/meteor/meteor/issues/2001

mizzao commented 10 years ago

I've got my entire set of shovels out, a few power excavators, plus a couple of TBMs.

mizzao commented 10 years ago

This is fixed now in a7dd4e98f031fb6671d4b22ac1b3940b4122300c and README is updated.