While working on Paste from Word (see https://github.com/ckeditor/ckeditor5/issues/1184 or https://github.com/ckeditor/ckeditor5-paste-from-word) there is a need to manipulate the view instance which was created from pasted HTML.
The ViewElement class has all the necessary methods which enables to manipulate view elements, however those methods are protected and should not be used outside. There is also a Writer class, however it is strictly designed to manipulate the view which was created based on the model (so the semantic one) and should not be used for non-semantic/dirty view manipulation.
There is a need for simple Writer class which can be used to manipulate non-semantic view (as we initially agreed it can be a simple wrapper for all Element manipulation methods).
The name proposals:
Upcast/DowncastWriter (so the current Writer will be renamed)Semantic/NonsemanticWriter (same as above)RawWriter, LowWriter, LowLevelWriter, GenericWriterBasicWriter, BaseWriterI wonder if the new writer should be a regular class or just class containing static methods? Since it is more like a proxy for an Element protected methods it will not use this anywhere. All methods could be just static.
OTOH, we may want to keep it consistent to what we have in a current Writer so it is very similar to use - then it should be possible to create instances of the new writer. WDYT?
GhostWriter 馃槢
OTOH, we may want to keep it consistent to what we have in a current Writer so it is very similar to use - then it should be possible to create instances of the new writer. WDYT?
I'd make it consistent with the current Writer. Of course, different methods will be available there, but the whole class should be used in the same way.
Agree. We need to keep them consistent. Also, both should have similar methods names and parameters order. We do not need to have the same methods since it does not makes sense for some cases, but in cases when it makes sense we should keep it consistent.
Most helpful comment
GhostWriter馃槢