Experimental: Reduce ~3.5 KB via Build Improvement / Staying under 64 KB
It is possibe to bring down the size of the wiki by using the mangle props option of terser and figuring out reserved names.
This is what has been accomplished:
3527 Bytes Saved!
The following example is for the Dove version. For the PUT saver versions, more reserved names may need to be added.
$ terser FeatherWiki_Dove.js -c passes=2 -m --mangle-props reserved=[np,pell,icon,edits,content,editor,img,italic,actionbar,slug,root,edit,help,p,events,name,tags,parent,event,underline,strikethrough,heading1,heading2,paragraph,olist,ulist,image,out,hLink,pg,md,recent,query,changed,sb,sbTab,views,notis,wTitle,wDesc,wPub,wOut,wJs,wCss,wPo,home,desc,pages,\"\",_,\"\*\",\"~\",\"\\n\",\"\ \",\"-\"] > FeatherWiki_Dove_Tersed.js
Some of these reserved names maybe removed to make the wiki more smaller as I may have added things that don't affect.
How to optimize further or for future versions of wiki:
Optimize the above tersed version by looking at beautified (unminified) outputs of both FeatherWiki_Dove_Tersed.js and the following safely tersed one FeatherWiki_Dove_Tersed_Safe.js with visual diff tool like KDE kompare. Debug with the developer tools / browser console, if something breaks, add reserved words to -mangle props reserved array of terser.
$ terser FeatherWiki_Dove.js -c passes=2 -m > FeatherWiki_Dove_Tersed_Safe.js
The results may need Q/A / Testing as extreme property mangling is prone to break stuff.
Things to explore:
- Run terser before closure compiler
- Run terser only
- Compare both
My first instinct is to be wary of mangling the object props because it can cause a lot of problems that you might not expect. Having the option for reserved prop names is good, but it would quickly become a pain to maintain... Plus with the changes I'm making to let extensions be more useful, there are a lot more props that would need to be reserved.
We can definitely play around with it, but it might be more trouble than it's worth.
Neither tersed or untersed will run in Opera, likely because it's still run through the Closure compiler either way. Firefox loads both just fine, but I haven't tried to actually use either.
I'm not sure what Opera's deal is... It always seems to have some kind of issue. But it's true that the more you compress and obfuscate the code, the more starts going wrong.
@nosycat are you able to create your own builds? I believe Firefox runs Feather Wiki fine, but I remember you needed a build without closure compiler run on it. If you are able to build it on your machine, I can show you what to comment out in the build script to skip the closure compiler step if you need help!
Deleting a branch is permanent. It CANNOT be undone. Continue?