You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not that simple to build an flexible helper functions for converters with readable API, they take too many parameters. But it should be simple to build converters.
BuildViewConverterUsing() may take many ViewConversionDispatchers, so it may handle many pipelines (editing and data) at the same time, or user can build separate converters for each pipeline.
What I don't really like is that there is no definite point in the chain that marks that it's over. You could say that .toXXXX() is over but if the API should be extensible we might add something that makes sense after toXXXX(). Do you think this might happen?
If yes, maybe we should write them: BuildViewConverter().fromElement().....toElement().for( dispatcher1, dispatcher2, ... );
Okay, right now we agreed that .toXXXX() will add the callback and in future if we will have any modifiers applicable after .toXXXX() the builder will off the old callback and on modified one.
I think the priority here is keeping Builder API simple as possible. We do not need to care about the performance, it will be called once, during the editor initialisation.
And I like the for( dispatcher1, dispatcher2, ... ) part, but I should be able to use it also in different order:
View To Model:
It is not that simple to build an flexible helper functions for converters with readable API, they take too many parameters. But it should be simple to build converters.
This is why I suggest chainable API:
Note that:
BuildViewConverterUsing()
may take manyViewConversionDispatcher
s, so it may handle many pipelines (editing and data) at the same time, or user can build separate converters for each pipeline.fromElement
takeMatcher
(https://github.com/ckeditor/ckeditor5-engine/issues/274) instance or string or object which will be used to buildMatcher
.fromElement
,consuming
defines the list of elements to consume from the last added element, or, if not defined, the consuming list is created based on the match,.withoutChildren()
).Model To View:
Converters from model to view could provide similar API:
The text was updated successfully, but these errors were encountered: