7 ms·
JQuery 1.8b1: what’s new?
- justindocanto 14y ago"jQuery is now powering about one-half of all the major web sites on the Internet" Anybody have any data on this?
- laserDinosaur 14y agoIt sounds nicely ambiguous. What's a 'major' website?
- deleted 14y ago[deleted]
- pacomerh 14y agoI would just guess that most major websites are using it.
- gnarf 14y agohttp://trends.builtwith.com/javascript/jQuery http://trends.builtwith.com/javascript/jQuery is where we get that statistic from
- justindocanto 14y agoWish I could access the full list, but I think that's convincing enough. Thanks for the link.
- sandollars 14y agoFew of them are major, but the worlds most popular CMS, Joomla, runs 2-3% of all websites, and they will be switching to jQuery (from mootools) later this year.
- justindocanto 14y agoWhat data do you have that supports that Joomla is the world's most popular CMS?
- stephenr 14y ago"powering" is a bit of a weasel word in this case. Plenty of those sites should work just fine without jQuery or any javascript.. So to say jQuery "powers" half the major websites on the Internet is like saying "Cup holders power 99% of all passenger vehicles world-wide".
- ElbertF 14y agoAccording to Wappalyzer 60% of sites that use a JavaScript framework use jQuery: http://wappalyzer.com/categories/javascript-frameworks http://wappalyzer.com/categories/javascript-frameworks It's a different statistic but does make the 50% seem reasonable.
- calvin 14y agoA lot of good changes in here. The modularity will improve usability -- particularly for sites who want the core jQuery features without all the extras. My hope is this will make it easier to use jQuery on mobile -- and more comparable to Zepto in terms of size. I remember reading somewhere that 1.8 would drop support for quirks mode in IE. Anybody know if this ended up happening? I didn't see any mention in this post.
- MatthewPhillips 14y agoI can't imagine why you'd need jQuery on mobile in the first place? What exactly are these core features that the standard DOM apis don't give you?
- pacomerh 14y ago"I can't imagine why you'd need jQuery on mobile in the first place?" How about having the jQuery functionality on mobile device?, Recommended reading http://en.wikipedia.org/wiki/JQuery http://en.wikipedia.org/wiki/JQuery
- agildehaus 14y agoI suppose you write all your code in assembly too? There's no room for going higher-level than the APIs exposed by the browser?
- mkmcdonald 14y agoThe DOM API is clear enough that silly abstractions like "selector engines" are unnecessary. The C vs. Assembly argument is such a silly non-point; apples and artichokes.
- nilliams 14y agoSelector engines are clearly not silly abstractions otherwise all major browsers would not have implemented querySelectorAll.
- mkmcdonald 14y agoWhat the jQuery team either perceives or peddles as "modules" are simply split files; there's no encapsulation. All that's new is a shiny node.js builder. I am interested, though, that the team has finally noticed that optional code should be the norm. Resig himself has been quoted as wanting nothing to do with it[0]. However, omitting every single "module" only truncates 2484 lines, which leaves the 1.8.1b source at a staggering 6763 lines of code. There is still a great deal of work to be done before "modular" is a fair term to apply to the API. [0]: http://i.imgur.com/Ta223.png http://i.imgur.com/Ta223.png
- moonboots 14y agoThere has been recent work to make jquery compatible with Google closure's advanced compilation[1]. As mentioned in John Resig's reddit comment you referenced, this would allow the compiler to automatically remove unused components in jquery and perform whole program optimizations. Unfortunately, this approach requires large rewrites to jquery to conform to the strict conventions required by the closure compiler. [1] https://groups.google.com/forum/#!topic/jquery-bugs-team/2zb5qqKiubU https://groups.google.com/forum/#!topic/jquery-bugs-team/2zb...
- dmethvin 14y agoIf we remove the blank lines and comments, would the line count be less staggering? By that measure we definitely shouldn't include Closure Compiler annotation comments since they add lines. For better or worse, we've focused on min-gzip size as a measure. JavaScript doesn't have a formal notion of a module. What we're referring to here is the ability to exclude some chunk of functionality from jQuery and know that, internally, jQuery does not require it. We cannot know whether other code on the page requires it. > optional code should be the norm Is there an easy way to know what is "optional" code when including third-party plugins, short of analyzing all the code in advance? That's what Closure Compiler AO does, but it is not for the weak. > There is still a great deal of work to be done before "modular" is a fair term to apply to the API. If you've got some ideas we're open to suggestions.
- jdavid 14y agoGlobal ajax events: ( are being removed ) Events such as ajaxStart fired by $.ajax can currently be attached to any element–even to elements that are not in a document at all! This creates an inefficient special case, so we will eventually remove that ability and fire ajax events only on document. I need to look into this. If you are using jQuery outside of a standard browser environment this might be problematic.
- dmethvin 14y agoWouldn't you be using the callback or Promise for those cases?
- gnarf 14y agoOr prefilter if you need to track global requests.
- TheHegemon 14y ago> Ajax events should be attached only on document as of 1.9. Looks like they are not being removed but that you should attach to document only.
- csomar 14y agoVENDOR-PREFIXED CSS PROPERTIES So there are CSS properties with vendor specific implementation, how are they going to handle that? Also what if the browser (like Chrome) changes its spec.? This could break your current code.
- gnarf 14y agoVendor specific cssHooks are always executed when defined, allowing you to deal with specifics of implementation in your own code. How exactly do you handle the "change in spec" case in your code right now?
- TazeTSchnitzel 14y agoThen use -vendor-prefixed-property-name not property-name.
- mark_story 14y agoI'm so happy that the global ajax events are going, they were a big weirdness for me, especially in light of the custom events that were added in recent releases.
- theallan 14y agoI must admit that I'm surprised $.browser is going to disappear in 1.9, not because removing it is a bad thing, but because of the number of scripts that is going to break. Current jQuery UI, Bootstrap etc all use $.browser. There is presumably plenty of time before 1.9 for library authors to address this, but I can certainly see a lot of breakage coming.
- theallan 14y agoReplying to myself - but thinking about it further, there is something a little ironic about the result of removing $.browser in that testing for certain behaviour can in fact increase code size in libraries. For example testing the rendering behaviour of how scrollbar width is added to containers (simplifying the problem somewhat) is something we know happens in IE6/7, which is a nice easy line of jQuery at the moment, but actually testing for it will introduce more code into libraries which can no longer use these properties. I still don't think it is a bad thing to remove $.browser since it does encourage good code practice, but there is a lovely irony that to decrease code size in jQuery core, plug-ins will likely need to have increase their size.