Web IDE: Normalize state
Description
There is a lot of data sharing and data duplication across the Web IDE state. This creates issues when:
- Updating values (i.e. removing from
stagedFiles
array and flippingstaged
flag) - Cloning values in an update (because all references need to reference the exact same object)
Context
The following discussion from !18647 (merged) should be addressed:
-
@pslaughter started a discussion: Why did this fix things?
Unfortunately, there's a lot of duplication of data in the IDE. In this case, it's important that
state.entries
andstate.entries[x].trees
reference the exact same object.I'm going to create a follow up issue to explore normalizing the state (which will prevent future issues like this).