Skip to content
This repository has been archived by the owner on Mar 20, 2022. It is now read-only.

Include an implementation of isEqual and isObject #22

Closed
wants to merge 2 commits into from
Closed

Include an implementation of isEqual and isObject #22

wants to merge 2 commits into from

Conversation

sergelerator
Copy link

Minified version of lodash is 48.7 K, and the only functions needed in normalizr are isEqual and isObject. This patch removes that dependency.

normalizr.min.js size:

before: 8.7 K
after:  3.4 K

Please let me know what you think about this patch, any feedback is greatly appreciated 馃槃

Minified version of lodash is 48.7 K, and the only functions needed in
normalizr are `isEqual` and `isObject`. This patch removes that
dependency.

normalizr.min.js size:
before: 8.7 K
after:  3.4 K
@unindented
Copy link
Contributor

@serhat-xyz The code is loading only the functions that it needs (e.g. require('lodash/lang/isObject')). When functions are required that way, only the necessary parts of lodash are loaded, not the whole library, as long as you use something like browserify or webpack.

Also, all functions in lodash are published independently (https://www.npmjs.com/browse/keyword/lodash-modularized), so if I were you I'd require lodash.isequal and lodash.isobject instead of including your custom implementations.

@gaearon
Copy link
Contributor

gaearon commented Oct 12, 2015

I would like to avoid maintaining these functions as part of normalizr.
Rather, I'd wait for Lodash 4 and do something similar to reduxjs/redux#611.

@gaearon gaearon closed this Oct 12, 2015
@sergelerator
Copy link
Author

Thanks for the feedback, I learned some stuff with this :)

@lock
Copy link

lock bot commented May 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot added the Outdated label May 7, 2018
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants