Conversation
|
This is definitely among the important areas where performance could be addressed especially development in mobile. |
|
@runspired how do you see this RFC relating to "universal event dispatch" http://emberjs.com/blog/2016/01/23/core-team-face-to-face-january-2016.html#toc_universal-event-dispatch
I'm a fan of event delegation and the ideas mentioned in the "universal event dispatch" resonate well with me. So I'm curious if you think the "Capture based eventing" could be expanded to become part of the story around 'universal event dispatch' …
I'm curious if 'capture' is compatible with the ideas around delegation which require bubbling. |
|
It's compatible, and definitely related. The core concerns are that any event management system needs to
I think |
|
I updated the RFC to reflect the general direction and concepts that have evolved from the original proposal over the past few months, as well as to (hopefully) make it an easier read. This led to a great discussion with @mixonic which centered around what to do with the following case:
In the proposal, Components define an This was apparently the intent behind #112 (reflected below). @mixonic floated the idea of adding an Which would enable this to work for 3rd party libs or for glimmer components. I like this idea, but am still thinking it over. The discussion then evolved into a more metaphysical discussion of the differences between actions and events. It seems to me the main problem currently being discussed by core is that the ergonomics of actions and events are clumsy. There are two separate paradigms for things that are essentially events, and neither paradigm currently plays well with 3rd party components, which is quickly becoming a necessity in modern web apps. So the questions become:
The ergonomics of adding listeners in templates. What is the right way to declare event listeners in templates?
Another problem (if unifying events and actions), methods within the This suggests to me that there needs to remain separate hashes for events and actions, differentiating between handlers that are there to be attached elsewhere, and handlers intended to be attached to the component itself. If we accept this mental direction that "actions are for defining event handlers that can be utilized elsewhere", then I think we come back to the It's probably too hard to work over the existing syntax, especially if actions themselves are an event delivery mechanism. The existing system only uses events when no params are specified, not all the time. Existing patterns Potential New Syntax 1 In syntax 1, we repurpose the keyword action to indicate the addition of an event handler, and the first argument becomes the name of the event to listen to. Unfortunately, this is likely going to be problematic to handle deprecations for. Potential New Syntax 2 The "trouble" with new syntax 2 (and syntax 1) is that there's a lot going on with these params, you basically just have a long list that may have little contextual meaning to a new developer. Potential New Syntax 3 For some reason this just feels cleaner in some ways than a long list of things following 'bar', but it also requires the use of two keywords, one of which would have deprecations to deal with. Just some thoughts I wanted to jot down for posterity, have a different direction I'm considering that I feel may be better but I need to let it settle out a bit. |
Replace PhantomJS with Firefox
Link to rendered