frictionless-js
frictionless-js copied to clipboard
NPM package size is huge
The package increases bundle size significantly, please, check: https://bundlephobia.com/[email protected]
nearly 50% is xlsx which is not even essential IMO. I wonder if all "readers" other than CSV should be outside of core and only built optionally (we could do 2 builds: a full build and a lean build).
Also why do we need moment? (and is iconv-lite necessary?)
@rufuspollock this is one of the reasons for data explorer's size. cc/ @starsinmypockets
- Removing xls seems like a no-brainer
- I like the idea of having pluggable or configurable builds
-
dayjs replaces moment, is 2kb and has
23k ⭐️
(i've never used it)
@starsinmypockets can you have a look at this and estimate.
I also think iconv-lite is not need most of the time.
@rufuspollock
I would estimate:
- 2 hrs to strip xls (or see lazy-loading below)
- 2 hrs to replace moment
- .5 - 1d implement a lazy-loading scheme (load if needed only -- I think there's some risk here / need further analysis)
- stripping iconv-lite we should wait on it -- we use it to decode non-utf8 encoded csv's -- a robust solution here will probably save us all loads of hair-pulling and is worth the weight. Should be able to lazy-load it also as per lazy-loading scheme (tbd)
OK, i think we should think about this in the bigger picture of data explorer first.
xlsx
seems huge as it has both reader and writer for xlsx/xls. I guess we need only xlsx/xls reader so we could replace it with, e.g., xlsx-extractor
which is 4x smaller (163kb vs 646kb).
@starsinmypockets I think implementing lazy loading would make sense in data explorer but not in data.js.