CKBox(Editing) should warn if the library has not been loaded
📝 Provide a description of the improvement
While working on docs (configuring the build) I came across the following scenario:
- I loaded
CKBoxin theplugins: []. - Added
'ckbox'to the toolbar config. - Then I got
toolbarview-item-unavailable {item: 'ckbox'}warning in the console. Weird, right? - I couldn't understand why, though. I checked and
CKBoxUIwas loaded. - I started digging into the code and I found out
CKBoxUIwill not register the button unless the command has been registered. - OK, not the most common pattern across our codebase but it makes sense. What does not make sense is that
CKBoxEditingis loaded but the command is not there 🤔 - Then I searched the editing plugin and I found out it will not register command unless there's config and the lib already loaded.
- Finally I found out I forgot to load the lib
<script src="https://cdn.ckbox.io/CKBox/1.2.1/ckbox.js"></script>🤦
It took me a while to debug this and I had access to the source code and knowledge about the architecture. For a developer who tries to integrate this feature and knows very little about the editor this is going to be a nightmare.
What we really need is two warnings:
- about a missing config
- about a missing lib
If you'd like to see this improvement implemented, add a 👍 reaction to this post.
Add warnings here: https://github.com/ckeditor/ckeditor5/blob/57f2a6833f334c49b9c52e56b0c9f46ec0bfd67e/packages/ckeditor5-ckbox/src/ckboxediting.ts#L68.
@Witoso, this plugin (CKBox) is included as a built-in plugin in all of our builds (i.e. ckeditor5-build-classic). And none of them provides default configuration for ckbox or cloud-services. All of them would emit warnings then (which worries me a bit).
The ckbox config is not required in order for it to work. cloud-services config would do the job. And the latter has all the default values, except tokenUrl. Shouldn't we scope the warning to tokenUrl only?
Moved to backlog. Let's decide first what to do with https://github.com/ckeditor/ckeditor5/issues/13062#issuecomment-1759515299
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 still 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. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).