Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Huh, I'm surprised this gets past the symbol mangling done by most js minifiers. Though maybe they don't mangle attribute fields everywhere.

However this is a nice hack around "modern" page structures and kudos to the author for making a proper tool out of it.




Most/all minifiers won't actually mangle object property names as those often have observable side effects. You want to grab all the keys for an object and do something different depending on the name of the key - you can no longer do that if the minifier has mangled all the object keys. Not to mention I imagine it would be significantly harder track all references to object keys across an application (as opposed to just local variables).


As I recall, the only minifier that went this far was Closure Compiler [0] - the caveats documented there still apply!

(Fun fact: I believe that Closure Library, and by extension the Closure Compiler, are still used for the Gmail rich text editor! [1])

[0] https://developers.google.com/closure/compiler/docs/api-tuto...

[1] https://google.github.io/closure-library/source/closure/goog...


And ClojureScript.


It's the JSON data payload that has unminified keys. Though YouTube is one of the few google sites that still use JSON, most use protocol buffers which generate JS interfaces which would indeed be mangled by minifiers.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: