Skip to content
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

Move the event-based trigger of dirty checking outside of JSON-Patch #99

Closed
warpech opened this issue Apr 21, 2016 · 5 comments
Closed
Assignees

Comments

@warpech
Copy link
Collaborator

warpech commented Apr 21, 2016

In spirit of #88 (comment), I think that the best way to trigger dirty checking would be to actually move it out of JSON-Patch.

In our use case, it should be moved to https://github.com/PuppetJs/PuppetJs/blob/gh-pages/src/puppet-dom.js.

The code in Puppet DOM will trigger jsonpatch.generate(puppet.observer) from the outside on certain DOM events (mouseup, keyup). There will be only single call (setTimeout 0), instead of current interval calls.

This could be celebrated by giving it a 1.0.0 number (#80)

@tomalec, @miyconst WDYT?

@warpech warpech changed the title Move the response of dirty checking outside of JSON-Patch Move the event-based trigger of dirty checking outside of JSON-Patch Apr 21, 2016
@warpech
Copy link
Collaborator Author

warpech commented Apr 21, 2016

In a nutshell it means move jsonpatch.observe and jsonpatch.unobserve to Puppet DOM.

The beauty of it is that it can be done in steps:

  1. Make the new implementation in Puppet DOM and switch to use it instead of jsonpatch.observe and jsonpatch.unobserve
  2. Remove jsonpatch.observe and jsonpatch.unobserve from JSON-Patch

@tomalec
Copy link
Collaborator

tomalec commented Apr 21, 2016

LGTM :)

Maybe, we could also provide tiny library/snippet (as a migration helper) for those who currently use jsonpatch.observe and jsonpatch.unobserve without Puppet.

@warpech
Copy link
Collaborator Author

warpech commented May 3, 2016

Plan for development:

  1. prepare PuppetJs changes in PuppetJs branch dirty-checking-refactor-json-patch-issue-99:
    • stop using jsonpatch.observe and jsonpatch.unobserve
    • add jsonpatch.generate calls in new event handlers in puppet-dom.js
  2. include changes in Starcounter nightly
  3. prepare JSON-Patch changes in JSON-Patch branch dirty-checking-refactor-json-patch-issue-99
  4. release new version of JSON-Patch
  5. release new version of PuppetJs
  6. include changes in Starcounter nightly

@warpech
Copy link
Collaborator Author

warpech commented May 3, 2016

Assigning to @aloscha

@warpech
Copy link
Collaborator Author

warpech commented May 26, 2016

Just discussed with @tomalec and @aloscha that this doesn't make much sense, because #96 will change it again. Closing.

@warpech warpech closed this as completed May 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants