|jQuery Adopts Semantic Versioning|
|Written by Ian Elliot|
|Thursday, 30 October 2014|
Semantic versioning is a great idea and the ever-logical jQuery has decided that from now on this is what it is going to do. However, at the next upgrade you might be wondering where your jQuery has gone.
Semantic versioning is a very simple idea. Instead of releasing software with version numbers that reflect your development process, or more likely marketing need to shout about a new version, semantic version numbers mean something. What is more they always mean the same sort of thing.
To use semantic versioning all you have to do is stick to the following scheme:
Given a version number MAJOR.MINOR.PATCH, increment the:
Got it? Only increment the major version number when you make a change that might break someone's code. Easy and obvious. Why haven't we always done things this way.
The problem for jQuery is that is has a complicated scenario regarding backward compatibility because it has to take account of what browsers it works with. At the moment there is jQuery 1.11.1, which supports old browsers - more accurately it supports the widest possible list of browsers. Then there is jQuery 2.1.1 which doesn't support older browsers, but makes use of the features of newer browsers to run much faster and more efficiently. Both versions have the same API, but differ in how they implement it.
Now jQuery is going semantic. The next version will be called 3.0 and there will be two named branches - jQuery Compat 3.0 and jQuery 3.0. The "Compat" branch will support as many browsers as possible, i.e. it will feature wide compatibility, whereas standard jQuery 3.0 will work with the current and previous versions of the browsers that are common at the time of its release.
So when the next version of jQuery is released and you are looking at a jump from 1.11.1 to 3.0 don't panic. The change isn't as big as the version number suggests and most things should go on working. From now on you can simply use either the Compat or the standard version and expect that there are no potentially breaking changes unless the move is from 3 to 4.
The good news is that both 3.0 versions will be available on jQuery and Google CDN as jquery-compat-3.0.0.js and jquery-3.0.0.js.
Some day all software will be versioned in this way.
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
or email your comment to: email@example.com
|Last Updated ( Thursday, 30 October 2014 )|