qimingweng/active-event-stack

Module size is too big

dsun29 opened this issue · 7 comments

The active-event-stack module accounts for 403Kb in my bundle.js generated by webpack. I only use it for the react-modal-dialog module. It is way too big.

Update: further research suggests that the big size is a result of using lodash.

Might be the immutablejs dependency

uniqueID is a pretty simple function, but it's including the entire lodash lib into builds. Could switch to https://www.npmjs.com/package/lodash.uniqueid or a custom function for generating ids: it's just this:

var idCounter = 0;
function uniqueId(prefix) {
      var id = ++idCounter;
      return toString(prefix) + id;
    }

I don't think react-modal-dialog uses immutable directly, so it would probably be a good candidate to remove since this module isn't accessed directly by user-written code that could risk mutation.

From playing with a fork, it looks like cutting out both immutable and lodash from this library would drastically reduce its size and thus also the size of react-modal-dialog without changing the functionality any. Let me know if a PR would be welcomed.

+1

I'm also interested in using this library but it's way too big.

Open to a PR on this otherwise probably get to it within the next month :/

Any activity here? Can we expect that PR will be merged?