-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: dev
Are you sure you want to change the base?
Conversation
I think it would be nice to integrate a performance test suite to see, if changes like this improve performance. |
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 |
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. |
@krebbl and me also need to dig into, which functions we use. Maybe we just search for _.\w+\b :) |
seems legit, but i think you sometimes use 'underscore', but that's solvable :D |
'underscore', should only be the import name of the dependency. But, we'll find it. |
There is an 100% Underscore compatible build. |
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.