Is there interest from the project in reducing package install size?
I noticed the package includes common JS modules (twice — once for Node, once for other runtimes), but none of the major npm dependents on @badrap/valita are using common JS at all. The most “popular” dependent that ships CJS has ~20 monthly downloads and was last published in 2023. Dropping CJS support would save ~215 KB or ~40% of the install size.
There may also be scope for further savings by dropping the separate node and default builds and just shipping a single ESM build. As far as I can tell, the two builds are included to support older environments where syntax like the nullish coalescing operator and optional chaining is not supported, but these are now very rare — both have been supported across browsers since July 2020 (nearly 6 years ago).
(After that, there’s always the possibility to not ship src and source maps, which aren’t so useful for end users, but that’s more opinionated, and the above two steps would already make a big difference.)
If this is something you’d be open to, I’d be happy to help if needed.
Is there interest from the project in reducing package install size?
I noticed the package includes common JS modules (twice — once for Node, once for other runtimes), but none of the major npm dependents on
@badrap/valitaare using common JS at all. The most “popular” dependent that ships CJS has ~20 monthly downloads and was last published in 2023. Dropping CJS support would save ~215 KB or ~40% of the install size.There may also be scope for further savings by dropping the separate
nodeanddefaultbuilds and just shipping a single ESM build. As far as I can tell, the two builds are included to support older environments where syntax like the nullish coalescing operator and optional chaining is not supported, but these are now very rare — both have been supported across browsers since July 2020 (nearly 6 years ago).(After that, there’s always the possibility to not ship
srcand source maps, which aren’t so useful for end users, but that’s more opinionated, and the above two steps would already make a big difference.)If this is something you’d be open to, I’d be happy to help if needed.