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:

  1. MAJOR version when you make incompatible API changes,
  2. MINOR version when you add functionality in a backwards-compatible manner, and
  3. PATCH version when you make backwards-compatible bug fixes.

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.

jquerysquaure

More Information

Semantic Versioning 2.0.0

jQuery 3.0: The Next Generations

Related Articles

JQuery 1.11 and 2.1 Released       

New jQuery Betas Released

jQuery 2.0 Leaves Behind Older IE Browsers

New jQuery Releases

 

 

To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, FacebookGoogle+ or Linkedin,  or sign up for our weekly newsletter.

 

Banner


Discover PostgreSQL How-Tos
16/12/2024

A veritable treasure trove of assorted how-to recipes for PostgreSQL, stored as a Github repository, has been started by Nikolay Samokhvalov, well known in the PostgreSQL world.



Pico 2W Announced But There Is A Surprise!
25/11/2024

Raspberry Pi released the Pico 2 a few months ago and we have been waiting for the Pico 2W since then. But Pimoroni beat them to the draw with the Pico Plus 2W based on the RM2 radio module and hinted [ ... ]


More News

 

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Thursday, 30 October 2014 )