12 ms·
This month I decided to go on a jQuery diet, as a kind of fun challenge. I'd increase my familiarity with the standard DOM and selector APIs, and reduce my depe
by WickyNilliams 13y ago
This month I decided to go on a jQuery diet, as a kind of fun challenge. I'd increase my familiarity with the standard DOM and selector APIs, and reduce my dependency on jQuery.
After a few hours of working without jQuery, it became obvious that the standard DOM & selection APIs are verbose and a little awkward. In about 20 minutes I produced a little wrapper that was compatible with a small - but common - chunk of jQuery's surface, and it made life so much more bearable. It clocked in at about 1kb minified (no GZIP).
Obviously it wasn't battle hardened and didn't deal with cross browser issues, as it was just for hacking with - but it felt like proof that a wrapper of some form, if not jQuery, is pretty much always necessary
- jakejake 13y agoI think that's an accurate observation. Ironically, if you only code with a library then it's easy to lose track of what that library actually does for you. Writing a bit of "raw" code can really make you understand why jQuery may do things in a certain way or why they have chosen certain abstractions.