FLUID-6396: Move ChangeApplier over to "immutable application" model

Metadata

Source
FLUID-6396
Type
Improvement
Priority
Major
Status
Open
Resolution
N/A
Assignee
Antranig Basman
Reporter
Antranig Basman
Created
2019-08-23T08:36:38.945-0400
Updated
2024-07-19T08:03:39.248-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Framework

Description

The current ChangeApplier's idiom for applying updates and relays is highly inefficient in many cases, especially where the meaning of relay rules is to simply share parts of model contents without modification.
We should move over to a system where model contents are considered immutable as JS objects and any mutation is performed by a shallow "clone to root", and all implicit model relays are operated by reference sharing. This will offer performance characteristics similar to contemporary systems such as redux etc. but it should be noted that this will not necessarily be the best choice for all users - where large models are frequently receiving updates to isolated values we can generate less garbage by updating them in place (although realising these savings would also require reducing the other bookkeeping structures managed by the ChangeApplier.
This model is described at https://wiki.fluidproject.org/display/fluid/New+New+Notes+on+the+ChangeApplier .