Nyalab / caniuse-api

request the caniuse data to check browsers compatibilities
MIT License
356 stars 27 forks source link

Update lodash.uniq? #31

Closed ChALkeR closed 9 years ago

ChALkeR commented 9 years ago

Current lodash.uniq version is 3.1.0 now, it has fewer deps and one fourth the size.

Nyalab commented 9 years ago

thanks, i will not make a release but this will be in the next one 57d36542563c722ec9dd524b8d62c8231164f80d

ChALkeR commented 9 years ago

Thanks. The same probably could be done for lodash.memoize, but it's much smaller.

ooflorent commented 9 years ago

You could also add lodash as dependency and use lodash/array/uniq and lodash/function/memoize.

koistya commented 9 years ago

I'm getting this error:

Error: Cannot find module 'lodash._basebind'
    at Function.Module._resolveFilename (module.js:332:15)
    at Function.Module._load (module.js:282:25)
    at Module.require (module.js:361:17)
    at require (module.js:380:17)
    at Object.<anonymous> (node_modules\cssnext\node_modules\caniuse-api\node_modules\lodash.uniq\node_modules\lodash.createcallback\node_modules\lodash._basecreatecallback\node_modules\lodash.bind\node_modules\lodash._createwrapper\index.js:9:16)
    at Module._compile (module.js:426:26)
    at Module._extensions..js (module.js:444:10)
    at Object.require.extensions.(anonymous function) [as .js] (node_modules\babel\node_modules\babel-core\lib\babel\api\register\node.js:171:7)
    at Module.load (module.js:351:32)
    at Function.Module._load (module.js:306:12)
koistya commented 9 years ago

@Nyalab @MoOx why don't you use the original lodash package?

$ npm install lodash --save
import unique from 'lodash/array/unique';
MoOx commented 9 years ago

@koistya you probably have a local issue. Please try cleaning your local npm cache & reinstall. Using the entire lodash module just to use 1 or 2 methods seems overkill ^^

ChALkeR commented 9 years ago

@MoOx Well, actually you currently depend upon 37 unique and 58 total lodash.* modules, counting the nested deps ☺. Total lodash module size is 868 KiB (2.07 MiB on disk). Your lodash.* deps size is 687 KiB (1.24 MiB on disk).

The above measurements are valid for the currently released version. After a new version is packaged with an updated lodash.uniq version, things will be a little better: 19 unique and 22 total lodash.* modules, 271 KiB (460 KiB on disk).

If you update lodash.memoize to the current version (and package your updated module, of course), there would be 17 unique and 20 total lodash.* deps, 251 KiB (420 KiB on disk).

ChALkeR commented 9 years ago

@koistya Just FYI, lodash.uniq 3.1.0 didn't get into any released version of caniuse-api yet.

koistya commented 9 years ago

Please try cleaning your local npm cache & reinstall. Using the entire lodash module just to use 1 or 2 methods seems overkill ^^

Cleaning the local npm cache and making clean install doesn't solve this issue (cssnext/cssnext#151) but PR #33 does.

koistya commented 9 years ago

@ChALkeR right, it seems like when you install caniuse-api it goes with lodash.uniq 2.4.1 :cry:

MoOx commented 9 years ago

Released as 1.3.2