4 ms·
How well does it compare to the original un-minified code if you compare it against minify + humanify. Would be neat if it can improve mediocre code.
by bgirard 2y ago
How well does it compare to the original un-minified code if you compare it against minify + humanify. Would be neat if it can improve mediocre code.
- jehna1 2y agoOn structural level it's exactly 1-1: HumanifyJS only does renames, no refactoring. It may come up with better names for variables than the original code though.
- Thorrez 2y agoCan it guarantee 1-1? Doesn't Javascript allow looking up fields using a string name? That string could be computed in a complex manner.
- j4k0xb 2y agoIt does in fact change the structure, but only safe-ish AST transformations related to minifiers (e.g. `void 0` to `undefined`): - https://github.com/jehna/humanify/blob/eeff3f8b4f76d40adb11663ff8805056c98e2ce1/src/plugins/babel/babel.ts https://github.com/jehna/humanify/blob/eeff3f8b4f76d40adb116... - https://webcrack.netlify.app/docs/concepts/unminify.html https://webcrack.netlify.app/docs/concepts/unminify.html properties and strings aren't renamed