Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Removed StandardEditor class #116

Merged
merged 20 commits into from Jan 15, 2018
Merged

Removed StandardEditor class #116

merged 20 commits into from Jan 15, 2018

Conversation

oskarwrobel
Copy link
Contributor

@oskarwrobel oskarwrobel commented Jan 11, 2018

Suggested merge commit message (convention)

Fix: Removed StandardEditor class in favor of DataInterface and ElementInterface mixins. Added EditorWithUI interface. Closes ckeditor/ckeditor5#2930. Closes ckeditor/ckeditor5#2931. Closes ckeditor/ckeditor5#303.

BREAKING CHANGE: StandardEditor class is removed. Use Editor class with DataInterface and ElementInterface mixins.


Constelation: https://github.com/ckeditor/ckeditor5/tree/t/ckeditor5-core/115

Requires:

@oskarwrobel oskarwrobel changed the title T/115 Removed StandardEditor class Jan 11, 2018
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling a9437fe on t/115 into 912570d on master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 4865201 on t/115 into 912570d on master.

* methods and properties.
*
* See also {@link module:core/editor/standardeditor~StandardEditor}.
* Editors implementation (like {@link module:editor-classic/classiceditor~ClassicEditor Classic Editor} or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Classic editor" or simply remove this (so it will say ClassicEditor).

* @readonly
* @member {HTMLElement} #element
*/
element: null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be a part of the mixin. It will go into the prototype anyway. It's simply unnecessary here.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

into the prototype anyway.

You mean to the interface?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "will go" I meant that this property will be added to SomeEditor.prototype. It makes no sense there. Properties (physically) should only be added in instances. The property documentation, though, should go to the interface, together with other docs.

* @mixin DataInterface
* @implements module:core/editor/utils/datainterface~Data
*/
const DataInterface = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So far we called all mixins "mixins". Like ObservableMixin which implements the Observable interface. So we didn't use the word Interface.

Also, a simple Data interface is kinda confusing. Editor, by implementing the Data interface becomes a data itself? The name needs to be clearer.

I'd propose something like:

  • EditorDataApi interface
  • EditorDataApiMixin mixin

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with EditorDataApiMixin. However, note that these are in the editor/utils file and will be imported in the editor implementation class, so I believe it will be clear for everybody who imports it that, use it or see it there that it's about DataApi for the editor, not for something else. This is why DataApiMixin is fine for me as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for DataApiMixin. This will be consistent with our approach to not duplicate module's path in class names.

this.data.set( data );
},

/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definition of these should go into the interface, not to the mixin. The interface defines the API. The mixin implements it.

* @mixin ElementInterface
* @implements module:core/editor/utils/elementinterface~Element
*/
const ElementInterface = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the same notes as in case of the EditorDataApi. Here we could have:

  • EditorElementMixin mixin
  • EditorElement interface

But, just like with the "data" stuff, I don't like the fact that editor doesn't become an editor element but it gets an API of such type, so (however I don't like the length of this) the following seems more correct:

  • EditorElementApiMixin
  • EditorElementApi

PS. API ~= Interface, but I use API because we'd end up with EditorElementInterfaceMixin and EditorElementInterface. Unless... we'd decide that we can omit Interface suffix, but then we end up with an also ugly EditorElement interface.

In other words, I chose "API" because it reads well: "My editor implements the editor element API". While this makes no sense at all: "My editor implements editor element".

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 0371a48 on t/115 into 912570d on master.

@oskarwrobel
Copy link
Contributor Author

Ok guys, I think everything is fixed.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 2b7183e on t/115 into 912570d on master.

@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 5efdaec on t/115 into ** on master**.

@pjasiun pjasiun merged commit fe81992 into master Jan 15, 2018
@pjasiun pjasiun deleted the t/115 branch January 15, 2018 13:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
4 participants