Skip to content
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

Remove usage of lodash #33

Closed
Daniel15 opened this issue Jan 24, 2016 · 6 comments
Closed

Remove usage of lodash #33

Daniel15 opened this issue Jan 24, 2016 · 6 comments

Comments

@Daniel15
Copy link

Lodash is only used a few times, and all the usages seem to be pretty simple use cases that could be replaced with native functions like Array.prototype.reduce and Array.prototype.forEach. There's no point adding the weight of the entire lodash library :)

@AlexGilleran
Copy link
Owner

Is the weight of it that much of a problem? Keep in mind that the libraries included in JSX Control Statements don't actually get included in your app, so this will only affect the initial npm install.

@Daniel15
Copy link
Author

Someone was requesting instructions on how to use it with babel-standalone, which is a standalone build of Babel for use in non-Node.js environments (including browsers, but also projects like ReactJS.NET and ruby-babel-transpiler). If they wanted to use it in a client-side script for whatever reason (eg. a REPL, or site like JSBin/JSFiddle), it would require bundling lodash too, adding unnecessary weight 😃

IMO lodash isn't as useful as it once was, now that arrays have a bunch of functional methods on them, and using Object.keys + the array methods tends to solve a lot of the use-cases for objects.

@AlexGilleran
Copy link
Owner

Ah yeah that makes sense, will look into it :).

texttechne added a commit that referenced this issue Jan 26, 2016
@texttechne
Copy link
Collaborator

Fixed in master.

Used lodash methods:

  • forEach / forEachRight
  • reduce / reduceRight
  • template

Only challenge was to replace the last method. Should be included in release 3.1.0.

@Daniel15
Copy link
Author

Nice! :)

@AlexGilleran
Copy link
Owner

Done in v3.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants