As you're the article author, if you're even remotely interested in being taken seriously (because right now there's less-than-no reason to) it behooves you to actually demonstrate a perf or memory delta that anybody would notice in the first place.
I thought people minified code in extensions just for the two reasons: force of habit (they do it for all their JA that is served online) and obfuscation.
(not sure why you are getting downvoted: your point is valid, though probably insignificant)
The code is compiled (once) and injected into all pages loaded. The minified code and original code will look exactly the same at this point unless the minify process does something really clever.
Perhaps Opera can perform the minification after reviewing the code and achieve the performance gains while still being able to prevent malicious code entering the store.
The only way to be sure is to implement a (bug free) sandbox that the code runs in, as then it won't matter what the code does.
While it is not possible to spot all malicious code by inspection, minification certainly makes the job much harder.
Obfuscated code is for competitions, not functional software. This is not 1978; the space savings from single-character variable names is not significant. (Or if it is, your code is way too heavy to be running in a browser extension.)
It means I work with people who have no sense of reality, and it means all my debugging sessions are going to be way harder and much less productive.
That's a real loss for a fictional gain. Minifying needs to die.
Still, in the case of a browser extension it wouldn't really make a difference since the files are coming from the disk.
The Javascript engine will JIT it or at least use an intermediate representation as soon as it's loaded, rendering minified or regular code the same. Minifier helps with load times but extensions are local, (and the difference in time is really negligible this first time)
1) Protect your intellectual property by obfuscating code
2) Make web pages load faster by reducing the size of the Javascript file(s) to transfer
Minifying an extension won't make it run faster since extensions are loaded from memory or disk, not from the network (ok, maybe it will be faster by a few nanoseconds?). It could make the initial download of the extension faster but it's only a one time download. Therefore, the only valid reason to minify an extension would be #1. However, it seems Opera is more concerned by user security (it's much easier for a backdoor to go undetected in minified code) than protecting the IP of extension developers.
There are exception of course ... but unless a team includes a few Carmacks and the likes its value is often overstated.
There is no protection in minifying an interpreted language. This is an invalid argument.
So since minified code shouldn’t even need uncompressing, I could imagine it to speed up the time it takes Opera to load the extension – if you always start a new browser if you want to go to a website, that might even make sense.
Our extension (https://addons.opera.com/en/extensions/details/disconnect/) uses the minified versions of seven libraries, which are about half the size of the unminified versions. Why not give users a better experience by shaving a few seconds off the install time?
> Hi as I written before "We must be able to review the code in a reasonable manner", you can upload somewhere your not-minified code and give us a link to it, write what library are you using to minify and write a command which will minify your package. As fast as we read your code we will publish your extension.
https://addons.opera.com/en-gb/extensions/ compared with https://chrome.google.com/webstore
The memory and parse time argument is invalid imo. Lexing a file with wildly abudant whitespace is going to take a delta longer that's insignificant compared to the parse time.
Loading it is normally a concern because of network bandwidth and latency, especially if it'll push you over MTU.
Well, duh, yes they will do their best even if they may fall short. Props to Opera.
However, minifying is useless if there is bandwidth overhead (read: file:// URLs.)
I'm really sad though that there's even in the JS community people that are promoting micro-optimisations like they do in the PHP world..
Opera could just de-uglify the code (and even automate that). still a non-argument to decline a deployment IMO.
Clearly, no. But they do probably want to check if your js might be pulling on some funny URLs behind user's back.