|
A particularly cheeky ToTD.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
May I propose a toast...
... to your next pun?
... such stuff as dreams are made on
|
|
|
|
|
Hopefully it lands butter-side up!
Latest Article - Contextual Data Explorer
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
If he wasn't dead we could ask Marlon BRANdo. Oh wait, he used the butter.
|
|
|
|
|
I know you like cracking, butt that's the yeast enjoyable pun this week. I rectum you'll have to try again, tomorrow.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
So I just tried 4 minifiers. Here are the results:
https://javascript-minifier.com/
Fails on class Helpers {
https://jscompress.com/
Fails on class Helpers {
https://www.minifier.org/
Worked!!! Input was 81K, minimized is 46K.
NUglify: https://github.com/xoofx/NUglify
Fails. Produced: Object.entries(t).map([n,t]=>i.setAttributeNS(null,n,t))
Note [n,t] needs to be ([n,t])
Too bad about NUglify. It produced a 37K minified file.
3 out of 4 failed.
Latest Article - Contextual Data Explorer
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Having never heard of a 'minifer', I followed the link that you said worked; OK, I understand what they are now.
The next question is: does the page/site load noticeably faster when using the 'minifer'ed version?
If so, what percent increase was seen?
|
|
|
|
|
Tim Carmichael wrote: The next question is: does the page/site load noticeably faster when using the 'minifer'ed version?
Yes -- keep in mind not everyone is on highspeed internet, so minifying the javascript your website references can result in a 50% speed improvement on loading. Potentially more if you're on a satellite connection where the round trip ACK for each TCP/IP packet (typical MTU of 1500 bytes) can be time consuming, though having simulated such stuff, I would imagine that a satellite "router" attempts to deal with this by not using TCP/IP directly over the satellite, where every 1500 byte packet requires an ACK.
Basically, minifying Javascript is a quite simple method of improving website performance regardless of the connection quality. It also makes the javascript harder to read by would-be hackers or the just plain curious. Obviously one wouldn't do this during development!
Latest Article - Contextual Data Explorer
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Thank you; I can see where it would be beneficial.
I've largely spent my career in the local world and largely avoiding web development.
Now, if there was some way to compile it... but that is a whole other barrel of fish.
|
|
|
|
|
Tim Carmichael wrote: if there was some way to compile it...
Isn't that what WebAssembly is all about?
(and now, being aware of that name's existence, you know as much about WebAssembly as I do)
|
|
|
|
|
Yes, that is exactly what WASM is all about.
MDN has done its usual due diligence and added several sections about it:
WebAssembly | MDN
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
Marc Clifton wrote: It also makes the javascript harder to read by would-be hackers or the just plain curious. Not so much anymore, Chrome has the ability to pretty print JavaScript and CSS now. Plus unminifier tools are freely available out there too.
Accidentally minified my source JS file once... yay for unminifiers.
|
|
|
|
|
2Ahosting in combi with cloudflare will minifie your scripts by default
|
|
|
|
|
So you have about (46K-37K)/2 times something like ...map(([n,t])=>.... ?
It does not solve my Problem, but it answers my question
modified 19-Jan-21 21:04pm.
|
|
|
|
|
0x01AA wrote: So you have about (46K-37K)/2 times something like
It did make me wonder, but no, I don't.
Latest Article - Contextual Data Explorer
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Weird. I believe we use the Microsoft one and it runs post build. Never had a problem with it and have been using it for 8 years.
Everyone is born right handed. Only the strongest overcome it.
Fight for left-handed rights and hand equality.
|
|
|
|
|
That's why I write my code uglified and minified to begin with
|
|
|
|
|
Plus it's fun to watch co-worker eyes cross, I imagine.
"There are three kinds of lies: lies, damned lies and statistics."
- Benjamin Disraeli
|
|
|
|
|
What is the actual size being transmitted?
Since web traffic is / can be compressed by default, is it worth doing "minify" explicitly? (i.e. is it redundant when considering compression).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Zipping the raw js vs. the minified js resulted in 17K and 9K respectively, so even if the web traffic is compressed, it's still ~50% reduction. At least, in my one little test!
Latest Article - Contextual Data Explorer
Learning to code with python is like learning to swim with those little arm floaties. It gives you undeserved confidence and will eventually drown you. - DangerBunny
Artificial intelligence is the only remedy for natural stupidity. - CDP1802
|
|
|
|
|
Nice. Thanks for the info (and your testing)!
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
i've used this no-name compressor: JSCompressor[^]. i think it's pretty old and i don't have complex js. i don't know how it will work with modern/latest js.
|
|
|
|
|
|
Tomorrow is a public holiday in the UK, as is Monday. I suspect it's the same in many European countries.
Should CCC OTD "play through", or be deferred until Tuesday as a result?
I don't mind either way, but I'll leave it up to you lot: whatever you decide in teh next four hours (just to give us a limit) I will go with.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
modified 29-Mar-18 10:04am.
|
|
|
|
|
You are probably not roman catholic. If you were, you probably would not have to ask. Just confess your sins and use the days for atonement.
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|