4

I have developed a small widget library of Chart controls and wondering if there is a best practice approach to version or meta tag my JS files so that when I bring out a new release, the version checking code would take care of compatibility across new and older versions. To begin with I need to record the current version somewhere. Any suggestions? I'ven't yet looked at how JQ identifies itself...would it be only the filename?

2
  • 1
    Do you plan on using some sort of loader or sticking with normal script tags? Commented Feb 16, 2011 at 15:02
  • @Jeff Beck yes using Loader is the preferrd approach! Commented Feb 16, 2011 at 15:15

2 Answers 2

1

If you are using a loader you will need to maintain the loader itself I would look at the way google deals with loading JS. It allows the user to select major minor or point release specificity to a library.

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

Sign up to request clarification or add additional context in comments.

Comments

0

for version maintainence, this should do.

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

and for loader mechanism, I found this is nice place to begin with ..http://ajaxian.com/archives/modulesjs-a-new-stand-alone-javascript-module-loader or in particular http://requirejs.org/ useful.

And something I just came across.. http://labjs.com/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.