JavaScript library version support

I have developed a small library of Chart widget widgets and am wondering if there is an approach to switching to a version or meta tag for my JS files so that when a new version appears, the version check code takes care of compatibility between newer and older versions. First I need to write down the current version somewhere. Any suggestions? I have not yet seen how JQ identifies itself ... will it be just a file name?

+4
source share
2 answers

If you use the bootloader, you will need to support the bootloader yourself, I would see how Google deals with loading JS. It allows the user to select significant minor or point specificity for the library.

http://code.google.com/apis/loader/

+1
source

to support versions, this must be done.

myLibrary.version = { major : 1, minor : 4, datetime : "20110225223456", toString : function () { return this.major+ "." + this.minor; } } 

and for the bootloader mechanism, I found this to be a good place to start with .. http: //ajaxian.com/archives/modulesjs-a-new-stand-alone-javascript-module-loader or specifically http: //requirejs.org/ useful.

And something that I just stumbled upon. http://labjs.com/

0
source

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


All Articles