Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion builder refactoring #4242

Closed
pjasiun opened this issue Jan 15, 2018 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1274
Closed

Conversion builder refactoring #4242

pjasiun opened this issue Jan 15, 2018 · 0 comments · Fixed by ckeditor/ckeditor5-engine#1274
Assignees
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@pjasiun
Copy link

pjasiun commented Jan 15, 2018

There are 2 problems with the current conversion builder.

First, since the API is chainable, not declarative, it is hard to pass parameters to the config. Recently we realized that we need to make plugins like font size or headings configurable and conversion builder is nothing similar to what you want to pass to the config.

Second, since conversion builder mix all converters together it is hard to learn, based on in, how to create your custom converter.

This is why converters should be more specific. In the F2F talk with @Reinmar and @scofalik we agreed on the solution simmilar to what @szymonkups proposed some time ago.

editor.conversion.for( 'model' ).add( elementToElement( 'paragraph', 'p' ) )

There will be specific model to view converters like:

elementToElement
attributeToElement
attributeToAttribute
markerToElement
markerToHighlight

And corresponding view to model converters.

editor.conversion will have predefined sets of dispatchers:

editor.conversion = new Conversion();
editor.conversion.register( 'data', editor.data.moveToView );
editor.conversion.register( 'editing', editor.editing.moveToView );
editor.conversion.register( 'model', [ editor.editing.moveToView, editor.data.moveToView ] );
editor.conversion.register( 'view', editor.data.viewToModel );
// The type of the conversion might be taken based on the constructor type.

Conversion function should get configuration defined the way it will be simple to use it with the conversion definition.

pjasiun referenced this issue in ckeditor/ckeditor5-engine Feb 9, 2018
Other: Conversion utilities refactor. Closes #1236.

---

### Additional information

* `ModelConverterBuilder` and `ViewConverterBuilder` are removed,
* `definition-based-converters` are removed,
* `conversion.Conversion` class is introduced,
* new converter functions, basing on declarative config, are introduced,
* other related changes.
@mlewand mlewand transferred this issue from ckeditor/ckeditor5-engine Oct 9, 2019
@mlewand mlewand added this to the iteration 14 milestone Oct 9, 2019
@mlewand mlewand added module:conversion type:improvement This issue reports a possible enhancement of an existing feature. package:engine labels Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants