However, jQuery is quite heavy, bloated with methods that would probably never used by a website, and this is not quite the npm way. Say if I want to iterate over objects, why would I use
jQuery.each but not
lodash.each? I can even load different versions of
lodash methods in one app without
requireing the whole lodash src files.
Therefore, I’m asking: Does it make sense to split this module into smaller ones so that developers can cherry pick the methods they are going to use? In fact, jQuery src is already modulised so it wouldn’t be hard to publish each small piece to npm (just need a build tool to convert them). Packages like cheerio is doing some similar things and jQuery could potentially share some small modules with it in some way. Angular.js could just use the ones they need instead of building jqlite themselves.
Just like lodash, jQuery can also develop some build tool to build different versions for different purposes.