Quote:
Originally Posted by felgall
There would be nothing to stop you from discarding 95%+ of the code in the jQuery file and just using the small part that you actually are calling - of course if you know enough JavaScript to actually identify the parts of jQuery you are using then you probably know enough to actually write those parts yourself anyway.
Of course by the time you really know jQuery well enough to use it to its best advantage you will know enough JavaScript that you could have written jQuery yourself.
|
i think you're on the mark but there's two sides to jQuery's intervention.
the first and obvious one is the browser api unification it provides. In the age of IE6, even 7, this was a very compelling feature; after all, why should we as developers need to type both
innerText and
textContent ?
in short, jQuery consolidated the DOM mess and offered what could arguably be called "missing" features to bare dom/js/css stack; mainly reliable "css selectors". I have no doubt that this is why it became #1.
dom unification, or "IE7 support" or what have you, is less compelling by the day. XMLHttpRequest() went "native" in IE7, and even way back in IE8 they added the single biggest jQuery killer-blow:
querySelelctorAll(). Most of jQuery's "Greatest Hits" are now available pretty consistently from the natural environment, especially on mobile, which is where the growth is.
the 2nd half is a much tougher foot to push out of the door jam: plugins.
If anything keeps jQuery alive, it will be it's plugins. There is HUGE momentum for many of these in the CMS and design community. Some of them are not half-bad. They more recently and now continue serve the same role that jQuery did initially: a survey of "what's missing".
Now, we have html5 form validation specs, css reflections and transitions, native smooth scrolling, onhashchange(), history.pushState(), <script defer/async>, CSS animation, <input type=email|url|search|date>, Drag and Drop, and many more emerging in the wild. These capabilities first became mainstreamed as plugins.
personally, i think a lot of plugins are poorly coded and slow, but the concepts they implement and the problems they attempt to address are of note.