3 ms·
This is great. Thanks for the link! The example in the readme suggests that jslim can reduce simple apps combined with jQuery by up 28%. I wonder if it can achi
by buddydvd 14y ago
This is great. Thanks for the link! The example in the readme suggests that jslim can reduce simple apps combined with jQuery by up 28%. I wonder if it can achieve more if jQuery was modified to let you specify selectors by function calls instead of selector string. For calls like $("a.button"), the static analyzer may have trouble removing unused code such as the parts that deal with descendant selector, ID selector. If selectors where specified as function calls like $.find($.byTag("a").byClass("button")), static analyzer may identify and remove more dead code. Though it probably isn't worth the effort if the code requires such drastic modifications.