-
-
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
Followup for the big UI library refactoring #5269
Comments
PS. Please mind that I made a broader review of the UI than just focusing on what has changed. It's the right time I feel to also clear some other things like the bindings. |
|
It was called
It is to prevent form submit. Related discussion: https://github.com/ckeditor/ckeditor5-theme-lark/issues/14#issuecomment-244999963
I don't agree that it makes them more fragile. It is a quite bulletproof solution. But yes, it makes it more complicated and requires more code. |
👍 |
Right, makes sense. But I also asked more generally whether we find this API clear. Like:
Perhaps it'd be worth trying to find a better names for all this. "bindTemplate" is a verb+noun so it sounds like an action... but it's an object. Then, you don't "bindTemplate.to" a thing. You bind a specific template property to an observable property and you delegate a DOM event to a view event. We'll never make this API a natural language, but perhaps we can work on making it as close to that as possible. This requires a lot of creativity and I'm not able to propose something complete so I raised this as an issue. |
In https://github.com/ckeditor/ckeditor5-engine/issues/678 I mentioned that perhaps the editor UI controller should simply be called |
What is the difference? One big I'm just curious why you prefer to merge it into one set. For me this looks better /**
* Some docs.
*/
this.staticProperty = 'value';
/**
* Some docs.
*/
this.otherStaticProperty = 'value';
/**
* Some docs.
*/
this.set( 'observableProperty', 'value' );
/**
* Some docs.
*/
this.set( 'otherObservableProperty', 'value' ); than /**
* Some docs.
*/
this.staticProperty = 'value';
/**
* Some docs.
*/
this.otherStaticProperty = 'value';
this.set( {
/**
* Some docs.
*/
observableProperty: 'value',
/**
* Some docs.
*/
otherObservableProperty: 'value'
} ); |
I don't know. I wrote it down and immediately thought that it's a premature optimisation (code size). So in fact, I'm against this :D. |
Follow-up for https://github.com/ckeditor/ckeditor5-ui/issues/95.
ckeditor5-ui
View#addChild
->View#addChildren
and can't the param be an iterable? It's not consistent with e.g.engine.view.Element#insertChildren()
and look bad here: https://github.com/ckeditor/ckeditor5-link/pull/58/files#diff-55321c76ff0d0fac681dcdaa3f17de75R60. (fixed by https://github.com/ckeditor/ckeditor5-ui/issues/108)View#bindTemplate
requires some example. Or, in fact, there should be a more rich example (with bindings) in the class.bind
orbinder
or sth? I'd try to find a better name for it cause the current one confused even me.domEventName: bind.to( 'viewEventName' )
. It's the opposite direction than data binding, so a separate function for that would be more clear (bind.fire()
?... but thenbind
isn't the best word too). WDYT? Actually, maybe this deserves a bigger ticket because I also have a problem with readingbind.if()
. Maybe someone will have a better idea for this API.ckeditor5-ui-default
General thing – merge multiple
this.set()
calls into one bigthis.set( { keys } )
.EditorUI
should be brought back (closed in Bring back EditorUI "controller" ckeditor5-ui-default#119)So, we need to decide whether it's good that a view knows about the editor. If not (and I think so, though the reason is purely theoretical – it's the view's reusability) then
EditorUI
is needed. If not, thenEditorUI
may still be needed... :D.EditorUI
. Perhaps it's enough to define an interface in thecore
(notui-default
!). This will allow easily documenting in the core whateditor.ui
is supposed to contain.ComponentFactory
must be fixed.(all below fixed by ckeditor/ckeditor5-ui-default#118)
ButtonView
click
prevented only when button is not enabled?EditorUIView
#icons
observable?#editor
(after bringing backEditorUI
).EditableUIView
#name
defined here and not used (it's used in a child view only)?IconManagerView
#sprite
observable?StickyToolbarView
destroy()
return a promise?editor-classic
EditorUI
is brought back.ClassicEditorUIView
shouldn't know about the editor. (closed in https://github.com/ckeditor/ckeditor5-editor-classic/issues/38)basic-styles
isOn
andisEnabled
aren't needed here cause they are set below.(fixed by https://github.com/ckeditor/ckeditor5-basic-styles/issues/35)
heading
isOn
andisEnabled
aren't needed (cause they equal their defaults).(fixed by https://github.com/ckeditor/ckeditor5-heading/issues/48)
undo
(fixed by https://github.com/ckeditor/ckeditor5-undo/issues/49)
link
LinkFormView
cancel
andunlink
events is missing.(fixed by https://github.com/ckeditor/ckeditor5-link/issues/63)
The text was updated successfully, but these errors were encountered: