data-blah is HTML 5 legal and dojo is changing its patterns to use it.
dojoAttachPoint is an attribute dojo uses in widget templates. I don't really know what you would propose to replace it (except data-attachPoint, say). If you're going to design a tempting system you need a binding mechanism, and that's what dojo does.
You can't complain too much about abusing the liberty HTML has always allowed with unrecognized attributes. Dojo cleverly leveraged the capability. And frameworks like dojo are the very reason we even have data-blah now.
Unless you are designing widget templates, you can do everything in dojo programmatically, if you choose, and keep your HTML pure. But, why?
Because I, for one, would like to keep my HTML separate from my Javascript.
Separate looks and from behaviour. The HTML is created already from another templating system server-side, its a pure hell to introduce HTML from Javascript and mix it.
That's fine. Dojo doesn't make this decision for you. Instead it gives you a full range of tools to choose for yourself how you want this to work.
Some UI widgets (Dijits) choose to use a client-side HTML fragment, but others do not have that requirement. Some of the work on projects like xstyle and put-selector seek to reduce this reliance further.
Dijits can be invoked either through extra markup in your base HTML page, or through a JS constructor. In the HTML templated widgets, there are attributes that bind DOM nodes to reference variables in your JS, so the widget knows where to insert content, or subwidgets, etc., and where to attach DOM events. The HTML isn't stored in JS, it's stored in an HTML file that gets combined through build tools (so you don't need to do this mix in process, it just works).
But again, that's an optional feature that's used primarily by the widget system and some of the widgets in Dojo.
dojoAttachPoint is an attribute dojo uses in widget templates. I don't really know what you would propose to replace it (except data-attachPoint, say). If you're going to design a tempting system you need a binding mechanism, and that's what dojo does.
You can't complain too much about abusing the liberty HTML has always allowed with unrecognized attributes. Dojo cleverly leveraged the capability. And frameworks like dojo are the very reason we even have data-blah now.
Unless you are designing widget templates, you can do everything in dojo programmatically, if you choose, and keep your HTML pure. But, why?