-
Notifications
You must be signed in to change notification settings - Fork 35
Just curious #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yep, I like the latter also better, but I set these on all the attributes I want to keep as they are, when they run through closure compiler in advanced mode. I started to use the advanced mode for all my projects and so I rename the attributes after finishing a project to the bracket version. This is only a little tradeoff compared to the things closure compiler brings in advanced mode, like function inlining, and code rewriting in a more optical way. |
Ah, does closure compiler mangle the property names too?! hm, that's not nice. I didn't know that |
Yep, closure compiler tries to minimize them (1-2 chars) if they are not getting exported. By using this explicit syntax, you can mark them as an api. It also tries to remove objects at all. For example the P object, you don't like - if the compiler sees this object has constantly 2 attributes, it will make two variables of it (I'm not sure if in the case of P this really happens, but it tries to flatten internal objects) |
Well, it makes sense of course - mangling internal variable names. But it's not handy debuging in this case, you want to see As for |
I think not performance, as the lookup mechanism of v8 is quite advanced with it's hidden classes. Closure compiler tries to optimize for gzip, meaning building a lot of similar chunks of code, which at the end benefits performance as performance in the web means loading time. And for debugging: You shouldn't debug your minimized code in the best case ;P |
Is there some special reason why you use bracket notation
this["re"]
instead of dot notationthis.re
to access properties? I find the latter easier to read.The text was updated successfully, but these errors were encountered: