Hi, I am developing a graphics editor. In which the user should be able to change the layout similar to how it can be done in Photoshop.
I found a couple of libraries like:
- golden-layout (https://golden-layout.com/)
- phosphorjs-dockpanel (https://phosphorjs.github.io/examples/dockpanel/).
But even before I tried to integrate them, I realized that I don't fully understand what Solid mechanisms I should use to make it work adequately without unnecessary redraws, etc.
The problem of not allowing a component to be redrawn is important, because when dragging Tab from one View to another, its state must not be lost. Let's say we're drawing something on canvas and want to move the Tab with it. The content should be intact and signals and storages should be preserved.
So I guess I have to somehow manually change the DOM by setting element parent via appendChild or something like that. But I don't know how Solid will take into account the Lifecycle of this tab. For example how can I get onCleanup to be called when I close the tab?
If to structure, the questions will be about the following:
0. Is the lifecycle of a solid component related to its existence in the DOM? And where can I read/see more about it.
- How to organize the ownership of the tabs so that when they are moved, there is no re-rendering and when they are closed, onCleanup is called.
- Which Solid mechanism is better to use to organize tab content display (Dynamic, Show, Switch, ... ?)
Basically, I want to understand how to change the DOM structure, so that it makes sense from a Solid component lifecycle perspective. All in all, best practices are needed.
Translated with www.DeepL.com/Translator (free version)
GoldenLayout- a multi-window javascript layout manager for webapps