farmOS / field-kit

A modular, offline-first companion app to farmOS.
https://farmOS.org
GNU General Public License v3.0
62 stars 39 forks source link

Entity API #498

Closed jgaehring closed 2 years ago

jgaehring commented 2 years ago

Some big changes to merge here, so thought it appropriate to capture it all in one PR.

The meat of this is the implementation of the checkout/revise/commit workflow, which I still need to document, but resolves #494, which itself encompass #485 and #274. That last issue is a big one: automatic syncing. There is definitely still room for improvement, but I think the basic principles are sound and well in place. As hoped, it does make things immensely simpler, both in core and from the Field Module API.

The last piece of that puzzle was the "revision backup," in 5da59ed, which provides an extra layer of caching for entities which have been revised, but not yet committed. That's definitely one place that could use fine-tuning. Closely related to that is to provide some better UI feedback when a revision is open but it's still awaiting a commit to trigger a sync event. It'd be nice to have another state for the connection icon (ie, the cloud icon in the app bar), and/or a button to "force" a sync if the user wishes. Could also provide some kind of timeout, after which a commit is automatically triggered. Lots of UX questions bundled up in those decisions, though, so I feel it's best to see how it works for users first.

Finally, the last 7 or so commits are all reorganizing the directory structure, now that we no longer have a need for a single "store".

And no more Vuex, either! Uninstalled in b5b4316, huzzah for one less dependency! :tada:

I'll probably follow this up shortly with a version bump to alpha.6, but want to do some issue triage first, and maybe see how it works on develop.farmos.app. I anticipate it will break the current "Tasks Test" module, because of some changes I made with regard to the mountFieldModule() global function (see #493). So I should probably package up a new version of that module for thorough testing.