Right not both "helpers" (like downcastAttributeToElement) and "converters" (like wrap) are exposed. As long as we do not need both, we should limit exports only to "helpers" which can be call "converters". Current "converters" should be just a part or it, which is not exposed as separate function. It can even be merged into the single function.
I remember, that on the latest TM some of us weren't sure about this change.
cc @scofalik
We were sure that we want to make it now, because we can always re-expose some things if needed. But we can't hide things which are published that easily.
PS. Of course, unless, when working on this task, we'll realise that we need some of them even now :D
So, in downcast-converters.jsonly these functions should be exported:
downcastAttributeToElement
downcastAttributeToAttribute
downcastMarkerToElement
downcastMarkerToHighlight
insertText (renamed to downcastText)
remove
createViewElementFromHighlightDescriptor
While these should not be exported:
insertUIElement
removeUIElement
changeAttribute
wrap
highlightText
highlightElement
removeHighlight
The tricky part here might be, how to modify tests to avoid using private functions.
how to modify tests to avoid using private functions
Not only the tests but also dev-utils/model.
Not only the tests but also dev-utils/model.
For dev-utils we may have protected API.
I'll quote myself from ckeditor/ckeditor5-engine#1556:
I'm actually unsure now about hiding them :D With time, I got the feeling that most questions about conversion are questions about some odd cases. Like, extending existing converters, overriding some things, etc. I can't tell from my experience which of the functions we need, but if these helpers are used in our converters, there's a high chance that they can help in people's scenarios.
See my reply in https://github.com/ckeditor/ckeditor5-engine/issues/1556#issuecomment-423473492.
As I thought – I actually had to use insertElement() and not downcastElementToElement(). Using insertElement() allowed me to perform some custom actions (mapping) while still reusing 90% of the logic.
I'm closing this :D We're not going to do it anyway.
I believe it was fixed by https://github.com/ckeditor/ckeditor5-engine/pull/1613.
Most helpful comment
We were sure that we want to make it now, because we can always re-expose some things if needed. But we can't hide things which are published that easily.