-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Implement options extraPlugins and removePlugins #2873
Implement options extraPlugins and removePlugins #2873
Comments
Right now, it would be done by the |
Well, it's the same problem as in CKEditor 4. If a bundler provides the default plugins it needs to do that through So there are two options: Either we can implement Or we can try to take a different path, about which I forgot when reporting this ticket. We can add WDYT? When I'm thinking about this now, I like the second option more as it's pretty transparent to the developers. We don't reserve the |
+1 I would call it |
|
|
AFAIK, it should be singular if it works as an adjective. E.g. @AnnaTomanek was telling us to e.g. have |
While in a collection you have a "basket full of plugins" in the "map" you have a "basket full of plugin mappings"... it's a different context. So for me it is either |
Oh god... :D |
In order to simplify creating builds, I'd like the This will allow creating such an entry file to bundle: import BaseClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classic';
import PluginA from '...';
import PluginB from '...';
import PluginC from '...';
export default class ClassicEditor extends BaseClassicEditor {
static get availablePlugins() {
return [ PluginA, PluginB, PluginC ];
}
} And then, if you use the editor class like: ClassicEditor.create(); All the available plugins will be used. Or, you can list the plugins you want to use: ClassicEditor.create( {
plugins: [ 'plugina/plugina', 'pluginb/pluginb' ]
} ); We can also later think about introducing NOTE: If |
Or, a small amend – instead of a property a static The methods would be used like this: import BaseClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classic';
import PluginA from '...';
import PluginB from '...';
import PluginC from '...';
export default class ClassicEditor extends BaseClassicEditor {}
ClassicEditor.setBundledPlugins( [ PluginA, PluginB, PluginC ] ); And later, somewhere inside the editor's constructor (although, I'm unsure how safe is accessing this.constructor.getBundledPlugins(); // [ PluginA, ... ] |
this.constructor.getBundledPlugins().map( plugin => plugin.pluginName ); // [ 'plugina/plugina', ... ] |
Or yet another proposal: import BaseClassicEditor from '@ckeditor/ckeditor5-editor-classic/src/classic';
import PluginA from '...';
import PluginB from '...';
import PluginC from '...';
export default class ClassicEditor extends BaseClassicEditor {}
ClassicEditor.bundledPlugins = [ PluginA, PluginB, PluginC ]; // (or with a static getter for consistency) And if you want to get all the available plugins (so the bundled one with their dependencies) then instantiate an editor and use ClassicEditor.create()
.then( ( editor ) => {
Array.from( editor.plugins ).map( plugin => plugin.pluginName );
} ); |
The reason why I thought it doesn't make sense to have E.g. if |
Time for a final proposal. Related tickets:
In order to add support for the new options
|
I'm for the second option - pass the plugin names directly to the I'm also thinking about renaming the Does it make a sense? |
In the |
Not exactly. When I'm creating a new instance of an editor, I'm ignoring the plugins that are built-in the bundled package. I don't want to use all plugins. I want to use some part of them, so I'm ignoring the rest. I cannot remove the plugins because they are compiled in the sources but I can ignore part of them. I'll do as you wish but it's my point of view. |
@pomek, I understand your POV, but we have the very same concept in CKEditor 4 and therefore it would be good to use the same configuration name here: |
Feature: Added support for loading plugins by name and the "removePlugins" option. Closes #49.
Turns out that ckeditor/ckeditor5-core#70 didn't introduce |
Fix: Now introduced support for `config.removePlugins` for real (we said that we did this in the previous release). Closes #49.
This is a response to https://github.com/ckeditor/ckeditor5-dev-bundler-rollup/issues/1. The ability to adjust which plugins are loaded from a bundle is implemented in exactly the same way in CKEditor 4 and I don't see another, simpler solution.
PS. Since plugins are named now (https://github.com/ckeditor/ckeditor5-core/issues/27), this option will be easy to use.
The text was updated successfully, but these errors were encountered: