flexsurfer / re-frisk-remote

re-frisk remote library for debugging re-frame applications using leiningen re-frisk plugin
18 stars 5 forks source link

Make optimizations in transferred data #3

Closed flexsurfer closed 6 years ago

flexsurfer commented 6 years ago

In current implementation all data is sending each time app-db or subscriptions are changed, we need to optimize it and send only difference because data transformation is expensive

https://github.com/flexsurfer/re-frisk-remote/blob/master/src/re_frisk_remote/core.cljs#L27 https://github.com/flexsurfer/re-frisk-remote/blob/master/src/re_frisk_remote/core.cljs#L37

And also implement update debouncing for app-db, in current implementation it works only for subscriptions

This task should be done with https://github.com/flexsurfer/lein-re-frisk/issues/4

qnnguyen17 commented 6 years ago

Hi, I'd like to work on this if you are still looking for a contributor. Is there anything in particular I should know before getting started?

dottedmag commented 6 years ago

@flexsurfer Done, please have a look. I haven't bumped version numbers anywhere this time.

dottedmag commented 6 years ago

ping?

flexsurfer commented 6 years ago

yes @dottedmag thanks for reminding, sorry for the delay

dottedmag commented 6 years ago

@flexsurfer Added changes here and in lein-re-frisk to only compute diffs and send messages if there is a UI client connected to sidecar.

dottedmag commented 6 years ago

@flexsurfer Problem with :app-db transfers is fixed. Scenario for reproducing:

  1. open the re-frisk-remote
  2. open the UI
  3. close the UI
  4. wait for a few seconds (so that lein-re-frisk detects the disconnection)
  5. open the UI again
  6. See no :app-db anymore.
dottedmag commented 6 years ago

@flexsurfer :before/:after mixup is fixed.

Both fixes are added as separate commits to the pull request for easier review.

flexsurfer commented 6 years ago

Awesome job @dottedmag , thanks!