Many years ago, we chose to use Object.defineProperties for getter/setters.   
Google Closure Compiler sees the Object structure and will not rename the keys 
in the structure and then will not rename property fetches used in prototype 
methods.  We might be able to take away the @export in the JSDoc, but I'm 
pretty sure it won't cause Closure Compiler to rename the keys.  Without 
preventing Closure Compiler from renaming keys, the property fetches in the 
prototype methods get different minified names than the keys in the structure 
and getter/setters don't work.

If you are worried about private property access, keep in mind that there 
really isn't such a thing in the JS we currently output.  If you are worried 
about obfuscation, I think even before we renamed private variables, the 
undecorated private variable name was not renamed in the production output.  If 
you are worried about download size now that private names are decorated, now 
that you've seen how formatPrivateNames is used in the compiler, maybe you can 
devise a shorter decoration scheme.

HTH,
-Alex

On 12/18/18, 3:54 AM, "Harbs" <[email protected]> wrote:

    I just noticed that I have over 900 qualified variable names in my release 
app (com_printui_model_foo_baz etc.)
    
    It seems like a significant number of them are due to private getters.
    
    Why are we @exporting private getters in the JS output?
    
    Harbs

Reply via email to