4 ms·
the problem is that you will still include the whole of jquery given that it is passed in through an externs file to the compiler.
by lennel 13y ago
the problem is that you will still include the whole of jquery given that it is passed in through an externs file to the compiler.
- ataggart 13y agoIf the point is to perform dead code elimination, why would you declare it as an extern? It seems reasonable to me to just treat it as another of your javascript files to be included in the compilation run.
- lennel 13y agoits a tad more complex that you would imagine from the get go. Certain coding patterns don't work well with closure; for example obj["name"] = a and elsewhere obj.name will cause issues. Of course it would make a lot of sense if they simply wrote it for AO, but I doubt that will happen. tldr: The reason people pull it as an extern is because it does not work with advanced optimisations.