News for hackers. Stuff that matters.
Re:Reverse engineering Wordle by tyingq on Wednesday January 12, 2022 @11:02AM (#29908283)
How common is it to have your minifier change symbol/variable names to short ones?
Re:Reverse engineering Wordle by deergomoo on Wednesday January 12, 2022 @11:08AM (#29908419)
Pretty much all of them do it. You can’t minify keywords or literals, so that just leaves whitespace, which would be barely any minification at all.
Re:Reverse engineering Wordle by tyingq on Wednesday January 12, 2022 @11:44AM (#29909162)
Jsmin cited a typical 50% reduction without touching symbols, though perhaps that's an average that included removing comments.
Re:Reverse engineering Wordle by joek1301 on Wednesday January 12, 2022 @11:08AM (#29908413)
I just popped open DevTools on an SPA I made using create-react-app with default settings. Sure enough the minified production JavaScript uses shortened variable names. This is default configuration for Webpack, which is pretty widely used throughout (and outside) the React ecosystem.

Interestingly you can still view the unminified source, since create-react-app generates source maps by default.

Re:Reverse engineering Wordle by VoidWhisperer on Wednesday January 12, 2022 @11:07AM (#29908399)
It is pretty common. The goal of the minifier is to reduce the size of the file, so taking the function names, variable names, etc and making them as short as possible works towardd that goal
Re:Reverse engineering Wordle by spdustin on Wednesday January 12, 2022 @11:06AM (#29908375)
Closure Compiler (for JavaScript) does it. With the SIMPLE_OPTIMIZATIONS [0] flag, it will rename parameters for—and variables local to—functions to save space.

[0]: https://developers.google.com/closure/compiler/docs/compilat...

Re:Reverse engineering Wordle by kbelder on Wednesday January 12, 2022 @03:18PM (#29912194)
I've seen some minifiers that can restructure your code... replace if{} with a ternary ?: operator or use boolean shortcutting to replace the whole conditional with a ||, and so on. It's supposed to never do anything that actually affects the logic, but that sort of stuff scares me.
Re:Reverse engineering Wordle by nilsbunger on Wednesday January 12, 2022 @11:06AM (#29908361)
Very common
Re:Reverse engineering Wordle by 0xfeba on Wednesday January 12, 2022 @11:10AM (#29908443)
That's literally what they are for.
Re:Reverse engineering Wordle by tyingq on Wednesday January 12, 2022 @11:32AM (#29908905)
For some context, it didn't used to be terribly common. There's a fair amount of minifying that you can do without touching symbol names, though obviously it doesn't help as much as shortening them. The old jsmin cited about 50% reduction, and it didn't touch any variable or class names.
Re:Reverse engineering Wordle by k3liutZu on Wednesday January 12, 2022 @11:25AM (#29908768)
It's actually pretty standard