michaelwittig / node-isin-validator

International Securities Identification Number validator
MIT License
3 stars 1 forks source link

Huge bundle size #4

Open rondonjon opened 3 years ago

rondonjon commented 3 years ago

The import of i18n-iso-countries contains far more data (including country names for many many languages) than actually needed by the ISIN validator.

For the most use cases, I think this bloats the bundle size significantly and unnecessarily.

On the other hand, I understand that country codes shouldn't be hardcoded in this package since the underlying ISO dataset still changes occasionally.

But I think there would be ways to get both, a smaller bundle size and up-to-dateness, e.g. by preprocessing at build time.

@michaelwittig, how does that sound to you; would you accept an MR that turns the dependency into a devDependency, extracts only a small array or RegEx from it at build time, and pulls that into the ISIN validator instead of the whole ISO library?

michaelwittig commented 3 years ago

sounds like a good idea. we only depend on one language de at the moment in this lib here.