-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider dropping unnecessary Lodash dependency #19
Comments
Well… I only had a limited amount of lodash libs to start with: https://github.com/TinyWebEx/AddonTemplate/tree/master/src/common/modules/lodash The intend indeed was what you say, to minimize the code base and avoid having all that hidden costs you mentioned. They are manually picked/copied from the lodash lib. And while I agree that getting rid of it would be great, I guess the only reason I have it in there is for debounce/throttle. The other files are just dependencies of these two libs. And there are no replacements for that in ECMAScript as far as I know, so we cannot yet replace them, |
Hmm, it looks like a lot more than just debounce/throttle is used:
and it seems throttle is actually never used. That use of debouce in AutomaticSettings is also currently undocumented (TinyWebEx/AutomaticSettings#4), so I suspect it is not used in practice.
They should be able to be replaced with standard |
Okay interesting. Though note throttle etc. is used in the actual add-ons etc. And thanks for the "you might not need" website. Though that actually still argues:
And as you say, it's a tested implementation that does the same, essentially. |
I am not sure what you mean, as I searched the Awesome Emoji Picker, Unicodify and this template and could not find any uses of throttle.
Well, it would allow you to drop the unnecessary Lodash dependency and replace 11 JS files (and hundreds of lines of code) with just 12 lines. IMO, that would be a huge win for performance, maintainability and security. It would also further the goal of your organization of making extensions "tiny". |
Okay, and I also see it is being tested upstream there, so if we really hardly use it, then yeah… you've convinced me. Any PR to replace that lodash throttle with "you might not need" throttle are fine. (And removing all the other stuff hmm...) |
Also remove the doc section on lodash then: https://github.com/TinyWebEx/common#third-party-dependencies Also I'm moving this to TinyWebEx Common as it affects all extensions. |
Lodash should not be needed with modern JS. It also introduces a performance, maintenance and security cost on add-ons that use this template and your libraries. For these reasons, Firefox recently removed it from their codebase (see bug 1669968). Please consider doing the same for your libraries.
Also see this ESLint plugin: https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore
The text was updated successfully, but these errors were encountered: