📜 ⬆️ ⬇️

jQuery 3.0: future generations



Incredibly, but a fact: almost eight years have passed since the release of jQuery. Web development has changed a lot over the years, and jQuery has changed with it. And all this time, our team tried to maintain the perfect balance between compatibility with legacy code and support for the most modern web development methods.

One of the best ways to do this is semantic versioning ( semver ). In practical terms, for developers and development tools, SemVer gives an idea of ​​the risks associated with the transition to a new version of the software. Version numbers are in the format MAJOR.MINOR.PATCH, where each of the three components is an integer. According to SemVer, if the MAJOR number changes, it indicates a significant API change, with which developers need to be very careful.
')
This versioning concept is overwhelmed with nuances when it comes to jQuery, because browser compatibility can be just as important as API compatibility. In an attempt to create a more elegant jQuery, the team released two versions in 2013. The first one remains in the 1. * line (today it is 1.11.1) and provides compatibility with the maximum number of browsers. The second version, from 2.0.0 to 2.1.1 today, excludes support for a number of browsers such as IE8 and lower, in order to optimize the code. Both 1. * and 2. * versions of jQuery have the same public API, although there are some differences in their internal implementation.

Our future releases will use a different nomenclature. As before, we are talking about two different packages. The successor to today's version 1.11.1 will be jQuery Compat 3.0. The successor to jQuery 2.1.1 will be jQuery 3.0. We are talking about two different packages on npm and Bower, but they will have the same version to indicate the fact that their API is the same.

We are also reviewing our browser support policies, starting with these releases. The main jQuery package remains compact and strong, thanks to the support of only new browsers (current and previous versions of each), distributed at the time of release. We may include support for additional browsers based on market share. The jQuery Compat package offers more browser support, but at the expense of larger size and, potentially, lower performance.

Despite the big difference in the numbering of versions, we do not expect serious problems when migrating from most of the existing jQuery variants. We just want to follow all the SemVer version rules. Changes such as the removal of obsolete methods will determine the new version of the jQuery Migrate plugin - to facilitate their search and correction. We will tell a little more details about the changes in the next blog posts.

So, briefly about the main version 3.0 jQuery API for those who do not want to read a lot of letters:With each future release, we will upload both packages to npm and Bower. Both packages will also be available in a single jQuery CDN build file. Using them will be just like two times two: just turn on jquery-compat-3.0.0 or jquery-3.0.0, depending on the need. We talked to colleagues from Google CDN, and they will also support both packages.

As we work on version 3.0, we’ll be telling the details about code changes, browser support, and the like. Stay in touch!

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


All Articles