title: Dojo/on. emits, widget.on etc. in Dojo 1.8/2.0
body: <p>I would like to gain a full understanding of how events work in Dojo. I am actually interested in the way Dojo 2.0 works -- I am using 1.8 now, but I am only really interested in using/documenting features that will <em>not</em> be deprecated for 2.0. 
  Now... in _WidgetBase.js I read: </p>
  
  <pre><code>on: function(/*String|Function*/ type, /*Function*/ func){
    // For backwards compatibility, if there's an onType() method in the widget then connect to that.
                  // Remove in 2.0.
  </code></pre>
  
  <p>This basically means that in the near future a widget's on will basically do: </p>
  
  <pre><code>  on: function(/*String|Function*/ type, /*Function*/ func){
              // Otherwise, just listen for the event on this.domNode.
              return this.own(on(this.domNode, type, func))[0];
  </code></pre>
  
  <p>Which is fine. Now... in the release note for 1.8, I see: </p>
  
  <p>"Widget events, including attribute changes, are emitted as events on the DOM tree" </p>
  
  <p>The release note point to this: <a href="http://livedocs.dojotoolkit.org/quickstart/events#widget-events-published-to-the-dom" rel="nofollow">http://livedocs.dojotoolkit.org/quickstart/events#widget-events-published-to-the-dom</a> Which "sort of" explain things, although the document seems to be outdated (it still talks about aspect for "plain object"). </p>
  
  <p>So, my question: is there a spot/bunch of pages/tickets that would describe the current <em>updated</em> way in which the whole events thing works? </p>
  
  <p>My current understanding (for Dojo 2.0): </p>
  
  <ul>
  <li>on: 100% delegated to on.js </li>
  <li>emit: when you run randomWidget.on('something', function(){}): 
  -if randomWidget has 'onsomething', it will simply run that; &lt;--- will this go away with 2.0? 
  -Otherwise, it will delegate to on() </li>
  </ul>
  
  <p>So, it's all about understanding dojo/on. That's when I get confused: reading the source code, on.js seems to delegate functionality to the widget itself (which... I just wrote above, will simply delegate to dojo/on from 2.0...?!?). Unless the bit that delegates to the object is destined to disappear...? </p>
  
  <p>Also, I am used to writing widgets with templates, and then add  items where I do data-dojo-attach-event="onclick:_click" where I make sure a function is called when somebody clicks on it. With the new on() system, will this change? (I mean, is all events propagates to DOM, is the opposite also true?) </p>
  
  <p>So, can somebody shed some light on this? I feel a little uneasy at the moment, adding events and doing things, because I am not 100% sure of what is going on. </p>
  
  <p>Thank you! </p>