-
Notifications
You must be signed in to change notification settings - Fork 15
T/78: Make Plugin an interface (PluginInterface) #84
Conversation
src/plugin.js
Outdated
/** | ||
* The base interface for CKEditor plugins. | ||
* | ||
* @interface Plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be an InterfacePlugin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would call it Plugin
and the base plugin class as BasePlugin
(which implements the Plugin
interface).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just be consequent with the Plugin
name later.
src/plugin.js
Outdated
* The editor instance. | ||
* | ||
* @readonly | ||
* @member {module:core/editor/editor~Editor} module:core/plugin~PluginInterface#editor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should be able to write just @member {module:core/editor/editor~Editor} #editor
* | ||
* @static | ||
* @readonly | ||
* @member {Array.<Function>|undefined} module:core/plugin~PluginInterface.requires |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if an interface might contain static members in JSDoc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, JSDoc doesn't support inheriting any static members (jsdoc/jsdoc#1229). We have a plugin for that, fortunately.
src/plugin.js
Outdated
* {@link #afterInit} servers for the special "after init" scenarios (e.g. code which depends on other | ||
* plugins, but which doesn't {@link module:core/plugin~PluginInterface.requires explicitly require} them). | ||
* | ||
* @method constructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method and below methods should start with a #
.
OK, so:
|
Why couldn't you just merge the #83 into this PR?
https://github.com/ckeditor/ckeditor5-core/pull/83/files#diff-817ad8f70e1fee22c97e006f62a50aeaR201 |
It requires changes in the Editor class. Will do it tomorrow. |
@Reinmar, I guess it's ready to review. |
|
Undo works fine. |
also works fine :| |
And I don't understand what happens. |
Some tests affect other tests. Have fun debugging ;) |
I guess the tests fail because some of the plugins call |
Makes sense. So, let's add empty |
@Reinmar, |
Suggested merge commit message (convention)
Feature:
PluginCollection
handles with plugins which do not extend the basePlugin
class. IntroducedPluginInterface
. Closes ckeditor/ckeditor5#2913.init()
,afterInit()
anddestroy()
methods for plugins are optional now.