Re:Show HN: In-view.js – Get notified when DOM elements ente...
by jdd on Sunday August 28, 2016 @01:56AM
(#12375471)
No worries, lodash/debounce can be reduced further with babel+webpack plugins.
Assuming the current setup of babel+webpack the difference between your naive version is just ~0.5 kB.
Re:Show HN: In-view.js – Get notified when DOM elements ente...
by nathancahill on Sunday August 28, 2016 @11:35AM
(#12376912)
Which still doubles the size of the library: ~0.6kb to ~1.1kb. So while it's just half a kilobyte, do that over and over, with nested dependencies and it really adds up.
Minified (1.49kb) and gzipped (677b).
Whether lodash functions should be used instead of naive functions is up for debate. My opinion is if the lodash functions are 5x the size of the entire library, it's probably best to not include it, or to include it as a build option (if the user's project already includes lodash for example).