**Feature summary**:
Compress and decompress stuff.
**Use case(s)**:
Several userscripts of mine store data. As localStorage is limited and MediaWiki preferences even more so, compression is helpful.
**Benefits**:
Store more with less.
Currently we have mediaWiki.deflate (`mw.loader.using('mediawiki.deflate',function(){console.log(mediaWiki.deflate('testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttesttest'))});`), see T236210. But the corresponding decompression function is only available on the [[ https://doc.wikimedia.org/mediawiki-core/master/php/classDeflate.html | server side ]] as far as I can tell.
Could the corresponding inflate function be provided with JS as well? (it's fine if the mw.loader.using triggers a download for it) Another option is [[ https://pieroxy.net/blog/pages/lz-string/index.html | Pieroxy's lz-string ]] (or my [[ https://en.wikipedia.org/wiki/User:Alexis_Jazz/lz-string | JSHint passing fork ]] of that) which is about 3K but doesn't seem to compress quite as well. Compressing $('body')[0].innerHTML of enwiki's WP:VPT the character length of the compressed output is 1.9 times larger than mediawiki.deflate when using lz-string in base64 mode.
This should be relatively straightforward I'd suspect?
* Add pako inflate.js to https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/master/resources/lib/pako/
* Create mw.inflate.js that does the opposite of https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/master/resources/src/mediawiki.deflate/mw.deflate.js
* Put that in a new mediawiki.inflate directory on the same level as the current mediawiki.deflate
* Create entry in https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/refs/heads/master/resources/Resources.php
If I had a testing environment I could almost do it myself, emphasis on almost.