-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Plugins loading improvements #5602
Comments
ps.: We should also check what plugins should |
My biggest surprise here is that I never got https://github.com/ckeditor/ckeditor5-core/blob/ee4f9dbb2974c5461efb75b751448ad962104ac5/src/plugincollection.js#L261-L275 when testing. And I should at some point. So, I think that something is seriously broken there. I knew this situation may occur when implementing plugin collection so I specifically wrote this error for it. I guess there are more potential problems with removing plugins, so we can investigate them. But our goal doesn't need to be to make the editor somehow work with some deep dependencies removed. It's ok if it just throws. The developer will be forced to review what they want to remove from the editor and why it cannot be removed or what else needs to be removed with it. |
Adding to the next milestone because this is a pretty serious problem. |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
📝 Provide a description of the new feature
The plugin require/exclude chain fails in certain scenarios ([1]).
Problem description
Example
requires()
chain:Scenario 1:
plugins that will be loaded (in that order):
This might be "counter intuitive" since
FooEditing
will work eventhoughFoo
was removed.Scenario 2:
The plugin
FooBaz
will fail because it usesFooEditing
Scenario 2 might be fixed by adding
FooEditing
to therequires()
call.The main reason for this is that in such scenario that
removePlugins
forbids loading this and only this plugin.The real-life examples of plugins causing problems:
Image
(Foo
),ImageEditing
(FooEditing
),ImageUploadEditing
(FooBaz
),Bar
(CKFinder
),BarEditing
(CKFinderEditing
).Solution
I think that we could fix that with somthing similar to "softRequirement". The idea is to differantatie between plugins loaded together (thus if main plugin is removed then it's children also) and plugins that are required by this plugin to work.
Plugin.depends()
- tl;dr: currentPlugin.requires()
- will load a plugin before and will yield errors if plugin is not loaded (ie byremovePlugins
)Plugin.bundles()
- loads those plugins with current one if current plugins is removed then all bundled are removed also.In the plugin chain from above:
This way in both scenarios the editor will throw error because required plguin
FooEditing
of theBarEditing
plugin was removed usingremovedPlugins
call.Real world examples:
Bold
:BoldEditing
,BoldUI
Table
:Widget
TableEditing
,TableUI
EasyImage
:Image
,ImageUpload
(probably should beEditing
parts),CloudServicesUploadAdapter
Cons:
If you'd like to see this feature implemented, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: