annotorious-v1 icon indicating copy to clipboard operation
annotorious-v1 copied to clipboard

minified annotorious 0.6.3 exports tons of globals

Open aaylward opened this issue 10 years ago • 3 comments

Hi annotorious,

I noticed in your minified js for version 0.6.3 that it exports a large number of global variables with names like aa, ab, Q, etc. Is it possible to configure your build to export a single global instead?

aaylward avatar Apr 27 '15 13:04 aaylward

It looks like there are instructions here on how to create a build that doesn't export so many globals.

aaylward avatar Apr 30 '15 01:04 aaylward

Same deal with 0.6.4, way too many obfuscated global function names (that will change over time for each new build). This is very bad practice. Found because it conflicts with Leaflet's use of L as a function name (also bad practice, and even though they have an L.noConflict() thingamajig it's not clear how to use with ui-leaflet's directive).

One way to make this less complicated would be to distribute a compiled, non-obfuscated version alongside the obfuscated version. Wondering if forking and changing plovr config would be the solution.

Immediate fix (avoiding downloading/learning plovr) was to use https://github.com/igorlino/annotorious-bower via Bower (with overrides since the .bower.json is badly done wrt css) since it's still on 0.6.3 and does not obfuscate into function L(...) (but still uses similar obfuscation). :8ball: . This should be corrected at the library level, not something end-users should need to re-compile for conflicts. My fork:

https://github.com/notbrain/annotorious-bower

@aaylward did you have any success recompiling with plovr?

notbrain avatar Dec 30 '15 21:12 notbrain

@notbrain nope -- sorry I can't be more help

aaylward avatar Jan 05 '16 03:01 aaylward