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

Replace underscore with lodash #63

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Replace underscore with lodash #63

wants to merge 1 commit into from

Conversation

StephanHoyer
Copy link
Contributor

I used current version of lodash (2.4). For frontend i used the strict mode compliant version of lodash. It is also possible to use different versions of lodash for legacy and modern browsers. It is even possible to only use parts of lodash. This can possibly slim down you footprint, since you only use parts of underscore. therefor you must require only the function you want to use and not the whole library. This may be a little more work to do, because you have to review every require.

@StephanHoyer StephanHoyer mentioned this pull request Jan 5, 2014
@StephanHoyer
Copy link
Contributor Author

I think it would be nice to integrate a performance test suite to see, if changes like this improve performance.

@it-ony
Copy link
Member

it-ony commented Jan 6, 2014

For the nodejs environment, we can use the npm dependency lodash as replacement. For the client side replacement, I only see an advantage, if we use a custom build with only the necessary parts.

We should generate our custom lodash library with https://github.com/lodash/grunt-lodash and place it under js/lib/lodash.js

@StephanHoyer
Copy link
Contributor Author

yes, that's the way to go.

Lodash installs a binary, which can build custom version from the command line. But since your already using grunt, it's probably better to use it for the lodash build.

I don't really know, which parts of underscore/lodash your using, so I think I can't assist here.

@it-ony
Copy link
Member

it-ony commented Jan 6, 2014

@krebbl and me also need to dig into, which functions we use. Maybe we just search for _.\w+\b :)

@StephanHoyer
Copy link
Contributor Author

seems legit, but i think you sometimes use 'underscore', but that's solvable :D

@it-ony
Copy link
Member

it-ony commented Jan 6, 2014

'underscore', should only be the import name of the dependency. But, we'll find it.

@StephanHoyer
Copy link
Contributor Author

@tomByrer
Copy link

There is an 100% Underscore compatible build.
Also, Lo-Dash is much more actively maintained, better docs (IMHO), better browser compatibility, etc.
If you want to see some micro-benchmarks: https://www.google.com/search?hl=en&as_q=lodash+underscore

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

Successfully merging this pull request may close these issues.

3 participants