Currently, it doesn't look like there's a way to see what attributes are updated on elements without doing an additional query before an element is saved. Ideally, there would be a layer of abstraction on elements to help keep track of dirty fields and basic attributes, such as slugs and content fields. This functionality could mirror Yii's ActiveRecord:
public array getDirtyAttributes ( $names = null )
public聽mixed聽getOldAttribute聽(聽$name聽)
Due to the complexity of elements and their usage of sister tables, I imagine this may need to be an "opt-in" based functionality in certain cases; particularly because certain elements query their sister tables directly, bypassing ActiveRecord.
The benefits of this would be pretty substantial:
Added for Craft 3.4 :)
@brandonkelly Not exactly related to this issue, but I noticed the delta updates don't currently work on the draft editor for live preview. Is that something that's more trouble than it's worth or is it still on your radar? I imagine it could mean a pretty big bump in live-preview speed, especially for larger entries.
Definitely part of the plan :) It will be a prerequisite for #4642 which is next up.
@Mosnar Drafts support delta updates now (2e1c70a6d16b38c7f1ae0b84548a7c866646e4c3).
Most helpful comment
Added for Craft 3.4 :)