Hi,
I like Google Web Tookit API approach. It use Java language behind the scenes that compiles ONLY JavaScript code WHOSE TARGET BROWSER NEEDS. It happens some developers would like to use that feature in pure JavaScript language.
Anwser: WHAT COULD WE SUGGEST in order to fullfill this requirement ?
I suggest to use JavaScript comments (as a flag) as a way some compiler (like Yahoo JavaScript compiler) analises our app JavaScript code and generates only a JavaScript Framework code needed.
Example: a hypothetical JavaScript framework (JQuery, Mootools, Prototype ect) code
// depends function say
funcion sayHello() {
// some code
}
function say() {
// some code
}
// more and more no needed Javascript framework functions in our app
So when my app use a function sayHello, only that sayHello function and its dependencies would be filtered through JavaScript comments, nothing else. So, this way our application would be lighter, by using only JavaScript Framework code needed.
And you: what do you suggest ?