Draft: POC for "Redesign Web IDE state management of files and file changes"
DO NOT MERGE
This MR is a POC for #216180 (closed)
POC Issues
-
Adding files isn't implemented yet (but should be really easy) -
Some components start complaining on load because they are coupled to certain file properties which are no longer used. -
Increase scope of editor module to replace functionality that no longer exists on the file object itself.
Iteration steps
Here are some steps we can take in parallel to help set up the code to adopt this state management pattern:
- Update
state.tree(and other.tree) to contain references to children (i.e.{ type, name }) and not the whole object repeated. - Decouple editor and editor properties from the file object (i.e.
openFiles,loading,editorRow,editorColumn). - Update
state.stagedFilesto not duplicate file object and look more like{ path, modification } - Normalize
file.namewithfile.path. - Remove need for
file.urlwith agoToFileUrlaction. - Remove multi-project abstraction.
- Normalize
file.activeintostate.activeFilePath - Sort tree children by default.
Potential iteration steps:
- Make
state.stagedFilesreactive. - Remove
treesand just useentrieswith a root entry.
Edited by Roman Kuba





