You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(I've only recently delved a little into js, so feel free to point out where there's a problem)
Consider the following code:
//Initialize all sstp operationsletsstp_version_table={SEND: "1.4",NOTIFY: "1.1",COMMUNICATE: "1.1",EXECUTE: "1.2",GIVE: "1.1"};
It could be written in such a way as to bring about additional space compression, but UglifyJS does not do this
letv1_1="1.1",//This variable will make the compressed code 7 bytes smaller!//Initialize all sstp operationssstp_version_table={SEND: "1.4",NOTIFY: v1_1,COMMUNICATE: v1_1,EXECUTE: "1.2",GIVE: v1_1};//let _="1.1",v={SEND:"1.4",NOTIFY:_,COMMUNICATE:_,EXECUTE:"1.2",GIVE:_}
As long as it's not global, we can compress things that are used repeatedly in a piece of code and are long enough to be compressed further by letting some variables
At the moment I'm manually bringing things up in the files I maintain and putting them at the beginning of the block to compress the size of the resulting min.js file, but I think doing this manually is little silly, breaks the readability of the code and makes maintenance a lot harder https://github.com/ukatech/jsstp-lib/blob/32fa164cbcac736d48b536a6487ee3d7454d410b/src/base.mjs#L2L15
I'm hoping that UglifyJS will do this for me.
(I've only recently delved a little into js, so feel free to point out where there's a problem)
Consider the following code:
It could be written in such a way as to bring about additional space compression, but UglifyJS does not do this
As long as it's not global, we can compress things that are used repeatedly in a piece of code and are long enough to be compressed further by
let
ting some variablesAt the moment I'm manually bringing things up in the files I maintain and putting them at the beginning of the block to compress the size of the resulting min.js file, but I think doing this manually is little silly, breaks the readability of the code and makes maintenance a lot harder
https://github.com/ukatech/jsstp-lib/blob/32fa164cbcac736d48b536a6487ee3d7454d410b/src/base.mjs#L2L15
I'm hoping that UglifyJS will do this for me.
These are some examples of this issue
=>
=>
=>
The text was updated successfully, but these errors were encountered: