docs(arch): add architectural decisions from backlog - #908
docs(arch): add architectural decisions from backlog#908oeninghe-dataport wants to merge 14 commits into
Conversation
Within our internal weekly, we had a growing backlog of not-yet-published architectural decisions. These are now introduced to the repository. Co-Authored-By: Claude Opus 5
7125ea5 to
e824c3c
Compare
|
|
|
||
| ## Context | ||
|
|
||
| ADR 0015 decided that plugins only use the public-facing store of the core. |
There was a problem hiding this comment.
Linking directly to ADS 0015 seems fitting.
|
|
||
| ## Context | ||
|
|
||
| ADR 0016 decided that POLAR uses KERN. |
There was a problem hiding this comment.
Linking directly to ADS 0016 seems fitting.
| ## Consequences | ||
|
|
||
| - (+) Stores are consistent across plugins. | ||
| - (+) Side effects are collected in an action instead of being spread over the store. |
There was a problem hiding this comment.
Is it really a side effect if something is done in a scope of an action in contrast to the watch-approach?
There was a problem hiding this comment.
From Wikipedia EN:
[A]n operation [...] is said to have a side effect if it has any observable effect other than [...] reading the value of its arguments and returning a value to the invoker of the operation.
This is - for JS/TS - a very broad definition, of course: The assignment itself (as in
function setX(newX: number) {
x.value = newX
}) is a side effect, too.
That said, IMO, at least the expressions that affect state that are not the assignment itself can be called "side effect".
| - A: State is only changed through actions, every state value is readonly from the outside. | ||
| - (+) All effects of a change are collected in the action. | ||
| - (-) Additional actions are required every time, which causes unnecessary complexity. | ||
| - (-) `readonly` has to be implemented every time, both technically and in the documentation. | ||
| - (-) Changing state through an action is less intuitive. | ||
| - B: The above only applies if changing the state has an effect that is encoded within the store. Otherwise the state value is mutable. | ||
| - (-) The mutability of a value has to be changed whenever new side effects arise. | ||
| - C: State is mutable in principle, as far as changing it is meaningful at all. Derived values are preferably determined via `computed`, alternatively via `watch`. | ||
| - (+) State is always mutable and therefore the easiest to use. | ||
| - (+) Watchers are already used for inter-plugin communication anyway. | ||
| - (-) Effects are harder to grasp, as they are not collected centrally in an action. | ||
| - D: We do not make any rules; everyone writes according to personal preference. | ||
| - (+) Personal freedom is preserved. | ||
| - (-) The design of the plugins becomes rather inconsistent. |
There was a problem hiding this comment.
This does not really represent the thing that was decided by this ADR: Use actions and restrain from using watchers if possible.
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Co-authored-by: Pascal Röhling <73653210+dopenguin@users.noreply.github.com>
Within our internal weekly, we had a growing backlog of not-yet-published architectural decisions. These are now introduced to the repository.