Proposing a minor refactor of ember views. Mainly for improving aesthetics of the output, HTML attribute compliance, and possibly minor perf improvements.
Typical DOM node generation for a view currently looks something like this:
<div id="ember638" class="ember-view"></div>
or with an action:
<div id="ember639" class="ember-view" data-ember-action="3"></div>
The proposal is to generate this instead:
<div data-ember-id="638"></div>
or with an action:
<div data-ember-id="639" data-ember-action="3"></div>
Why?
- ‘ember-view’ class has nothing to do with styling.
- ‘ember-view’ selector is currently is only used for jQuery event delegation. Can check for existence of data-ember-id instead.
- Currently prohibits the use of your own ‘id’ attribute.
- Proper use of html5 data attributes
- Bring in-line with actions
- Reduce overall output
It doesn’t look like much work to update. Trying to see other’s thoughts before starting a PR.