3 ms·
The more practical scalability problem is engineers won't understand the nuance between import from lodash and 'lodash/someFunction'. You then only need one eng
by 88913527 4y ago
The more practical scalability problem is engineers won't understand the nuance between import from lodash and 'lodash/someFunction'. You then only need one engineer to import 'lodash' and there goes your tree shaking. Front end is a mine field for junior engineers.
All of this crud builds up, and you end up with 25MB bundles and slow SPAs.
- BurningFrog 4y agoI would look at making a test/checker that fails the build for such imports. With that approach fallible humans carry less risk.
- korijn 4y agoIf you're that worried, why not add a CI check on the bundle size as a general smoke detector (useful for more than just lodash) and another check for plain lodash imports with a simple custom eslint rule.
- jacobr 4y agoBecause it’s easier to just not use lodash.