Comments (7)
The length limitation has been removed.
from wakaru.
smart-rename
will check if the new name is longer than the original one to ensure that the meaningful or, let's say, the longer name won't be eliminated accidentally. This rule might not be reasonable when both names are relatively short. I think we can adjust the rule to be:
- replace when key length > value length. It means the key should be more expressive
- replace when both key and value are short (e.g. <= 3). It means the value might be a temporary variable, and the key should be more expressive or readable in most cases
- don't replace when key length <= value length. It means the key is not more expressive than the value, or the author wants to provide a more expressive name for the value
from wakaru.
you can update id
to idd
, and you will see aa
becomes idd
😄
from wakaru.
i dont care about the length, i just want to remove the rebindings
rebindings should only be preserved if there is a collision with other identifiers
and these other identifiers cannot be renamed
from wakaru.
@milahu I believe the length is being used as a method to figure what is a minified variable or not.
If you have a better method of consistently determining that in an automated fashion; feel free to suggest it.
--
I haven't thought about this too deeply, but perhaps if a variable is being destructured, and the key it is being destructured from doesn't clash with any existing variables, then use that key as the variable name (regardless of length)
from wakaru.
Rephrase the updated rule I mentioned: Only keep the destructured name when the variable's length is >= 4 to avoid removing non-minified variables. However, this may not be a good strategy for obfuscated input. Then, we can also consider simply ignoring the length.
from wakaru.
this may not be a good strategy for obfuscated input
exactly
from wakaru.
Related Issues (20)
- [unminify-bugs] Multiple errors during unminify with CLI 0.0.5 HOT 18
- Support `--perf-output` in CLI
- Improve CJS / ESM transformation (`un-esm`
- Next.js webpackJsonp_N_E HOT 1
- @wakaru/ide:build: RollupError: Identifier "a" has already been declared HOT 2
- infinite loop? wakaru unminify runs forever HOT 2
- wakaru removes unused imports HOT 1
- document.createElement is converted to JSX HOT 12
- inline constant tag name in JSX transformation HOT 4
- CLI: add support for config files HOT 7
- broken output code: ReferenceError: x is not defined HOT 1
- Explore creating a 'reverse engineered' records.json / stats.json file from a webpack build HOT 1
- un-sequence-expression is incorrect HOT 1
- wrong position for default parameters HOT 1
- Contexts that are too large are not further parsed for objects within the array. HOT 1
- feat: support Webpack SplitChunksPlugin HOT 6
- BrowserFS Deprecated HOT 1
- React 19 and React Compiler support
- [unpacker] SyntaxError: Private name #Y is not defined HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wakaru.