3 ms·
Support for tree-shaking in Javascript build tools is improving. This means that unused functions are not included from a dependency when they are not used. Thi
by jononor 8y ago
Support for tree-shaking in Javascript build tools is improving. This means that unused functions are not included from a dependency when they are not used. This could be a foundation for a more trusted utility library.
Such a library could be made by crawling NPM stats to find out what kind of small packages/functions are most used, and select a subset of these. The code could be lifted from the original packages (with proper licenses and attribution). The package maintainers could be approached if they are interested in helping to maintain this new collection package.
The thesis being that such a package can be more efficiently maintained by a group, than each individual maintainer and package alone.
Once it exists, one can post PRs to common dependants to use the new package.
Could it work?
- qudat 8y ago> Support for tree-shaking in Javascript build tools is improving. I agree tree shaking could help a lot. But every time I have tried to implement tree shaking properly in a JS codebase, it is not trivial to solve. If one configuration is not properly setup then the entire library gets inlined during compilation. Furthermore, libraries like lodash use a lot of inter dependencies so using something like `get` could bring in a ton of stuff that is technically used but totally unnecessary.