[reports] Refactor Block Editor Flow #1348
Labels
effort: 3 - standard
package: reports
priority: 2 - high
type: feature
New functionality, possibly breaking
Milestone
Currently, the components that are responsible for editing blocks are (quasi) controlled -- they are passed a
blockContent
object which represents the latest edited state of a block's content (like its js logic and other metadata). These block-editing components are also passed a setter (setBlockContent
) which is used to change the object they are passed. This is causing a number of unnecessary renders to be triggered because thisblockContent
object is constantly changing (sometimes on keystroke!).Refactor the data flow of these block editors and the
Block
data flow to avoid unnecessary rerenders and make the components of Blocks (renderer, simple ui, adapter) less reliant on lots of props from ancestors so that they are easier to implement as plugins in the future.Some things to do:
blockContent
sosetBlockContent
callback does not trigger so many rerendersblockContent
propBlockPreview
so that all blocks are varSwapped, mortarEval'd, then adaptedThe text was updated successfully, but these errors were encountered: