-
Notifications
You must be signed in to change notification settings - Fork 18
t/291: ToolbarView#fillFromConfig should warn when the factory does not provide a component #292
Conversation
…ot provide a component. Closes #291.
src/toolbar/toolbarview.js
Outdated
* @param {module:ui/componentfactory~ComponentFactory} factory The factory that is missing the component. | ||
*/ | ||
log.warn( | ||
'toolbarview-missing-component: There is no such component in the factory.', |
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 was supposed to be a more meaningful error, but it's still all about esoteric components and factories. I think you should read https://medium.com/@thomasfuchs/how-to-write-an-error-message-883718173322 ;)
src/toolbar/toolbarview.js
Outdated
this.items.add( factory.create( name ) ); | ||
} else { | ||
/** | ||
* There was a problem with expanding the toolbar configuration into toolbar items. |
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.
Same here as below – "expanding" – really? There should be a registry of forbidden words. Here, try not to use "expanding" and "factory" and "components" :P
R- because of the wording (which is the essential part o this ticket). |
Hopefully, this will look more understandable now. |
Since there's only one factory of UI items in the editor I'll remove it from the error details. This will make reading the error easier since there will be only the critical information. |
Don't forget that ckeditor5-ui is not only about CKEditor, it's a UI framework and it could be used anywhere, each time with a different factory. |
Sure. And this will happen how many times? ;) Besides, in such special use cases, the developer will be more aware of what they are doing anyway. |
Suggested merge commit message (convention)
Other: ToolbarView#fillFromConfig should warn when the factory does not provide a component. Closes ckeditor/ckeditor5#5398. Closes ckeditor/ckeditor5#526.
Additional information