opral / lix-sdk

1 stars 0 forks source link

`plugin.diff.file|type` -> `plugin.detectChanges` #40

Open samuelstroschein opened 3 weeks ago

samuelstroschein commented 3 weeks ago

Proposal

Replace the nested diffing functions with top level functions.

-plugin.diff.file()
+plugin.detectChanges({ old, neu })

Context

The diff API with nested namespaces was introduced to let a plugin diff own snapshot types.

samuelstroschein commented 2 weeks ago

Given the simple(r) mental model of

  1. A plugin detect changes
  2. A plugin "reports" conflicts [in the detected changes]
  3. A plugin applies [non-conflicting] changes

I probably prefer reportConflicts as plugin API than detectConflicts. Curious what others think