[Embeddable][Dashboard] Use Serialized State Only #205531
Labels
Feature:Dashboard
Dashboard related features
Feature:Embeddables
Relating to the Embeddable system
project:embeddableRebuild
Team:Presentation
Presentation Team for Dashboard, Input Controls, and Canvas
Problem
Currently, the new Embeddable framework has two types of state: SerializedState and RuntimeState.
SerializedState is the form of the state when saved into a Dashboard saved object. I.e. the References are extracted, and state saved externally (by reference) is removed. In contrast RuntimeState is an exact snapshot of the state used by the embeddable to render.
There is an asynchronous method for every embeddable type called
deserializeState
which is responsible for turning aSerializedState
object into aRuntimeState
object. Theoretically,RuntimeState
can be used to restore an embeddable exactly as it appeared without awaiting thedeserializeState
method, which could potentially skip a saved object load for By Reference panels.Because of this, during the course of development, more and more Dashboard functionality was ported from using
SerializedState
to usingRuntimeState
. This was in an effort to speed up Dashboard loading, and make the backups and state diffing more streamlined. Currently the relationship between Dashboards and the Embeddable system is as follows:Unfortunately, these changes also tightly coupled Dashboards to the concept of
RuntimeState
and introduced a few bugs, some instability, and incorrect behaviours into the system. (1, 2, 3). Many of these issues have been fixed temporarily, but the underlying issues still remain.Solution
The Dashboard should only interact with embeddables via their
serializedState
. After this issue is closed, the architecture should look like this:In order to accomplish this, we need to complete a few sub tasks
serialize
function is used a lot more often to compare everything asserializedState
.Copy to Dashboard
work withSerializedState
Save and Return
work withSerializedState
Duplicate panel
work withSerializedState
SerializedStateOnly
flag to the Embeddable registry that changes Dashboard / Embeddable behaviourSerializedStateOnly
flag.The text was updated successfully, but these errors were encountered: