rocicorp / repc

The canonical Replicache client, implemented in Rust.
Other
31 stars 7 forks source link

Compute changed keys in pull and mutate #341

Closed arv closed 3 years ago

arv commented 3 years ago

Return the changed keys in mutation commits and maybe end pull.

Towards https://github.com/rocicorp/replicache/issues/63

aboodman commented 3 years ago

🎉

One question right off:

We now return the touched keys in subscribe queries.

It seems like the JS would already have the information it needs here? It know what keys are being requested and the scan parameters.

arv commented 3 years ago

It seems like the JS would already have the information it needs here? It know what keys are being requested and the scan parameters.

That is true. My reason for moving this to Rust was code reuse in future non JS SDK but maybe that was a bad call? At one point I even wanted to keep track of the subscriptions in Rust but due to multiple tabs I moved the storage up to js.

aboodman commented 3 years ago

On Thu, Apr 22, 2021 at 11:12 AM Erik Arvidsson @.***> wrote:

It seems like the JS would already have the information it needs here? It know what keys are being requested and the scan parameters.

That is true. My reason for moving this to Rust was code reuse in future non JS SDK but maybe that was a bad call? At one point I even wanted to keep track of the subscriptions in Rust but due to multiple tabs I moved the storage up to js.

It's up to you. If you find it easy enough to work in Rust, I don't care. I just don't want hypothetical desire to work on other platforms in the future to slow us down at all now. If you find yourself fighting with rust, and it's easy to move it out to JS, do it.

— You are receiving this because your review was requested. Reply to this email directly, view it on GitHub https://github.com/rocicorp/repc/pull/341#issuecomment-825188926, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAATUBFXCOVDYQPTKO4G4FTTKCGMLANCNFSM43NDQ25A .

arv commented 3 years ago

It's up to you. If you find it easy enough to work in Rust, I don't care. I just don't want hypothetical desire to work on other platforms in the future to slow us down at all now. If you find yourself fighting with rust, and it's easy to move it out to JS, do it.

Doing it in JS to see how much complexity it removes.