v2.0.0
I'm happy to introduce compatto v2 ๐ง
While developing v2 all the focus was on improving performance and reducing the bundle size, but this also led to a breaking API change, hence the major version release ๐
If the focus was on performance, what did change?
Well, now compress() internally converts the dictionary in a trie, or something close to it. This is a lot faster than the old method used!
How much faster? Approximately 30% faster!
Do you want to know more about performance? Check out the Performance section of the readme ๐ฆฆ
Reducing bundle size you say?
Yes, now the dictionary has to be explicitly set by users, like that:
import { dictionary } from 'compatto/dictionary'
import { compatto } from 'compatto'
const { compress, decompress } = compatto({ dictionary })This helps to reduce the bundle size for people that don't use the default dictionary.
Also moving away from the class implementation helped, now the code can be minified better, like almost 2 times better ๐
I think that that is a breaking change, are there others?
As you've seen in the example code above, now the compatto import is a function and not an object anymore. To use compress() and decompress() you have to call it, you can then use these functions through the returned object of compatto().
A quick way to update without having to mess up the existing code is:
import { dictionary } from 'compatto/dictionary'
import { compatto as c } from 'compatto'
const compatto = c({ dictionary })Another breaking change is the removal of create(), now compatto() itself is create().
You can explore v2's API in its section of the readme ๐ฆฆ
Other changes
- The readme has been updated, I hope it is clearer now ๐
- Typings and in-code docs updated as well ๐ง
- More tests that should help prevent implementation errors ๐๐ผ
See v1.0.0...v2.0.0 for all changes.
That's all for now, see ya ๐๐ผ