News for hackers. Stuff that matters.
Re:DOM: attributes sadness by colanderman on Tuesday August 19, 2014 @10:14PM (#8200820)
The sarcasm is annoying and obscures and cheapens the point you're trying to make.

If the point is good, it will stand on its own. Excess sarcasm just comes off as a crutch.

Re:DOM: attributes sadness by earp on Wednesday August 20, 2014 @02:42AM (#8201325)
We didn't like how attributes worked, so we changed it, but then people were using it and now we have to change it back. It's not a particularly good point. I would like to know more about the fundamental problem with existing specs. I've never had a problem with attributes that couldn't be fixed in browser implementation rather than specification, certainly not a "problem" that could only be solved with React or jQuery as suggested in comments. I thought that specs nowadays are modeled after "what works in todays browsers" rather than "what would be better", much like HTML5 is modeled after what works in IE6 (talking about "brave enough"). I also thought that this proposed simplification is already part of DOM4, or did I make that up? Should namespaced attributes simply become unsupported on an API level? That's a cost to pay, much like querySelector comes with the cost of 1) only being able to query the document structure downwards, not upwards, and 2) only being able to query the default namespace. The API may be less awkward, but it introduces problems that are actually problematic, so more arguments would come in handy for me to understand the point.
Re:DOM: attributes sadness by skybrian on Tuesday August 19, 2014 @02:40PM (#8199017)
This seems like reason enough to prefer using a virtual DOM.
Re:DOM: attributes sadness by sehr on Tuesday August 19, 2014 @05:39PM (#8199972)
Excuse me sir, have you accepted our lord and savior React.js into your life?
Re:DOM: attributes sadness by argonaut on Tuesday August 19, 2014 @06:08PM (#8200088)
The only thing you need to solve this specific problem is jQuery.
Re:DOM: attributes sadness by mercer on Wednesday August 20, 2014 @03:40PM (#8204131)
Ractive.js is nice too.
Re:DOM: attributes sadness by skybrian on Tuesday August 19, 2014 @07:12PM (#8200350)
No sir, there are many alternatives. I wrote my own.
Re:DOM: attributes sadness by ufo on Tuesday August 19, 2014 @08:05PM (#8200503)
Is your library public? I'm also implementing my own right now so I am very curious about the different ways people solve this problem.
Re:DOM: attributes sadness by skybrian on Tuesday August 19, 2014 @08:27PM (#8200570)
Yes but it's very experimental: https://github.com/google/dart-tagtree/
Re:DOM: attributes sadness by ufo on Tuesday August 19, 2014 @09:20PM (#8200699)
Thanks. It might be experimental but its certainly well commented :)
Re:DOM: attributes sadness by ufo on Tuesday August 19, 2014 @06:24PM (#8200155)
From the Javascript point of view, isnt it usually better to manipulate dom object properties instead of DOM attributes?
Re:DOM: attributes sadness by jbish on Tuesday August 19, 2014 @06:35PM (#8200202)
Usually yes. The jQuery docs[0] go into why they refactored their .attr into separate .prop and .attr methods way back when in v1.6.

There are also cases, such as the value property, that will also update the value attribute.

[0] http://api.jquery.com/prop/