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.stagedFiles
to not duplicate file object and look more like{ path, modification }
- Normalize
file.name
withfile.path
. - Remove need for
file.url
with agoToFileUrl
action. - Remove multi-project abstraction.
- Normalize
file.active
intostate.activeFilePath
- Sort tree children by default.
Potential iteration steps:
- Make
state.stagedFiles
reactive. - Remove
trees
and just useentries
with a root entry.
Edited by Roman Kuba