📜 ⬆️ ⬇️

JQuery 1.8 release

(Published on the developer site on August 9, 2012)
August became a little hotter because jQuery 1.8 was released! You can take the code from the CDN on the jQuery website:

code.jquery.com/jquery-1.8.0.min.js (minified and compressed code for working versions of sites)
code.jquery.com/jquery-1.8.0.js (uncompressed library, for debugging)

As usual, Google and Microsoft CDNs will also distribute these files (do not ask us when - we do not know!). If you really want, use our copy from jQuery CDN.
')
We do not expect you to report bugs in the release version, as there were several beta versions and a release candidate; You had a lot of opportunity for thorough testing (haha, joke). We know that too many of you have been waiting for the final release. So now there is no reason to wait, and you can find out if there are any errors that were reported earlier in the bug reports.
UPD 08/31/2012: jQuery 1.8.1 .

If you find an error, please create a test for jsFiddle or jsbin and send an error report to our bugtracker. If you are not sure that you have found a mistake, we invite you to our forum. The jQuery 1.8.0 kernel is compatible with the latest versions of jQuery UI (1.8.22) and jQuery Mobile (1.1.1). Remember to update them if you report errors on pages that are related to them.

JQuery 1.8 quick review


Here are the important changes in this release:

Sizzle refactoring . The selectors in jQuery have become even faster thanks to the rewriting of the code by Timmy Willison (in fact, two authors). Of course, most browsers have querySelectorAll , but almost every implementation in some places lags behind in speed and has cross-browser features. Sizzle makes it easy. In addition, you can use selectors of the type : has () with a complex selector or : contains () . Oh yeah, IE6 / 7 is still supported.
Redraw the animation . Over time, the animation code in jQuery became rather messy. Corey Frang plunged into this swamp and killed almost all alligators, well, that is, mistakes. Most of the changes are not obvious, the interface is not affected, so the previous animations should work (and work better). But there are some great improvements that make the animation more powerful and expandable. One of the notable and useful features is the use of progress callbacks in Promises . We are still working on detailed documentation, but we have a preliminary draft . And an example of a new code in action: jsbin.com/odocid/1/edit .

Auto prefix CSS . When using the CSS property - .css () or .animate () , we make the correct prefix in the browser styles, if necessary. For example, take .css ("user-select", "none") . In Chrome / Safari, set the value to " -webkit-user-select ", in Firefox - " -moz-user-select ", and IE10 will use " -ms-user-select ".

More flexible $ (HTML, properties) . In jQuery 1.8, you can use any method or plugin for objects from $ (html, props) . Previously, a short list of methods was allowed, and there was no documentation of it. Now this list is not needed! But keep in mind that this may lead to a different behavior of your code if the plugin is added later and has the same name as the HTML attributes.

Closed over 160 bugs . In particular, the rewriting of Sizzle and animations gave impetus to correct several old mistakes, some of which are already 2-3 years old. Mike Sherov (Mike Sherov) solved most of the CSS errors and positioning and reduced them to almost zero. In addition, we have not abandoned our line to eliminate the annoying differences between IE 6/7/8 and modern browsers, so you don’t have to deal with them.

Smaller amount of code . Despite all the refactorings, new features and bug fixes, the jQuery 1.8 compressed file has become a few hundred bytes less than in version 1.7.2. Reducing the size was not an end in itself in this version, but we felt that it was important to monitor the growth of the code, and this gave fruit. Many thanks to Richard Gibson, who controls the size of the code for the entire project.

Modularity : If you know your project's jQuery well, you can use the new grunt-system to cut out a part of jQuery that you definitely won't need. What we did now at 1.8 is really just the beginning; still more flexible in upcoming versions.

A complete list of changes is provided below (in case you are wondering if your favorite bug is fixed).

What was removed


The short answer is “very little.” We would like to provide a complete list of obsolete feature notifications that will be removed in 1.9 to allow time for code adaptation. Some of the things removed in 1.8 are undocumented internal functions that were successfully used by some through reverse engineering, but it is always risky to use undocumented functions. Here is what is removed:

$ (element) .data (“events”) . In version 1.6, jQuery began to separate its internal data from user data to prevent name conflicts. However, some people use undocumented internal “events” of the data structure, so we made it possible to still receive them via .data (). Now this is not possible in 1.8, but you can still get event data for debugging with $ ._ data (element, "events") . Note that this is not supported by the open interface - the actual data structure may be incompatible from version to version.

Deferred.isResolved () and Deferred.isRejected () . Calling N-1 methods that return Boolean to get the state of the Nth variable became a bit silly, so we added Deferred.state () to jQuery 1.7 to determine the state in one call. Thus, these two old methods are no longer needed. This is much more convenient for debugging scripts in which you often want to know the state of Deferred as a string.

$ (element) .closest (Array), which returns an Array . This was a strange feature of the .closest () method needed for the obsolete .live () , but as far as we know, it was not used by other code. Now, as elsewhere, .closest () will return a jQuery object.

$ .CurCSS . This method was just a pseudonym for jQuery.css () , starting with jQuery 1.3. Although the property was never part of the API documentation, some used it. Now he is no more.

$ .AttrFn : Another undocumented property, used to determine which methods can be used in conjunction with $ (html, props) . Although this does not work in jQuery 1.8, we leave $ .attrFn empty in jQuery to avoid errors in the code that uses it. Warning: This will be completely removed in jQuery 1.9, so update your code!

Members


This release could not take place without the hard work of a talented team. The main contributors to jQuery are: Julian Aubourg (jaubourg), Corey Frang (gnarf), Richard Gibson (gibson042), Mike Sherov (mikesherov), Rick Waldron (rwaldron), and Timmy Willison (timmywil).

We are grateful to the members of the team and the community who contributed most to the jQuery 1.8 development cycle: Andy Monat, Robert Katic, Joaoh Bruni, Sindre Sorhus Oleg Gaidarenko, Yehuda Katz, Timo Tijhof Dominic D. Geyer Scott Gonzalez, Jorn Zaefferer, Matt Farmer, Trey Hunner, Jason Luna, Ben Alman, Jeffrey For Chris Borchers, Daniel Herman, Vladimir Zhuravlev, Jacob Thornton, Chad Killingsworth, Nowres Rafid, David Benjamin, Uri Gilad, Chris Faulkner, Elijah Manor, and Daniel Chatfield.

We are very grateful to those who took the time to report errors. However, we cannot correct the error if we do not reproduce it. If you're looking for an easy way to contribute to jQuery, look at tracker errors and help us by creating visual regression tests. As soon as we can reproduce the problem, the solution usually follows quickly. These tests will be the basis for unit testing, which will prevent errors in the future for code that does not change in the following editions.

Change Log : #

(The list of bugs and tasks is ambiguous: the headlines do not indicate whether this property was discarded (such as% 80), or the solved problem of obtaining a new property. Compiled by different people at different times, therefore there is no identical terminology in the description. According to the title of the bug, you have to guess everything yourself, but in 98% of cases this is not a problem. The translation can worsen the understanding, so a couple of points are left without translation. However, this is an almost complete list of changes in the library, which will create a presentation. about them. - comment perev.)

Ajax



Attributes



Build



Core



Css



"Data"



Deferred



Dimensions in DOM



Effects



Developments



Manipulations (in DOM)



offset method ()



Selectors



.support property



Moves




*) deprecated use of methods and properties;
**) implementation of new features or elimination of significant bugs (- translation labels) .

Add. QA (from transl. From comments)


Q: how to download not the full library, but select its parts?
A: github.com/jquery/jquery#how-to-build-your-own-jquery leshaogonkov

To create a custom build, use the following special grunt commands:
Exclude ajax:
grunt custom:-ajax 

Exclude css:
 grunt custom:-css 

Exclude deprecated:
 grunt custom:-deprecated 

Exclude dimensions:
 grunt custom:-dimensions 

Exclude effects:
 grunt custom:-effects 

Exclude offset:
 grunt custom:-offset 

Exclude all optional modules:
 grunt custom:-ajax,-css,-deprecated,-dimensions,-effects,-offset 

Note: dependencies will be handled internally, by the build process.

Source: https://habr.com/ru/post/149403/


All Articles