Would it be worth having "version" contain the date of the build as a number (eg. Date.getTime() style) instead?
This way, JS devs can adapt their script to API changes using something like:
Code: Select all
var foo = (version >= dateOnWhichSomethingChanged)
? function() { ... }
: function() { ... };
Code: Select all
function foo() {
if (version >= dateOnWhichSomethingChanged) {
// do it the new way
} else {
// do it the old way
}
}
Code: Select all
var dateOnWhichSomethingChanged = (new Date(year, month, day)).getTime();