schiehll / react-alert

alerts for React
MIT License
607 stars 98 forks source link

Replace shortid to nanoid #45

Closed ai closed 7 years ago

ai commented 7 years ago

Hi. Thanks for an awesome project. I found the way how to make it a little better. By replacing unique ID generator from shortid to nanoid.

  1. shortid is not maintained anymore (and issue tracker has many important issues). I tried to took maintenance, but found that I can’t fix shortid with keeping API.
  2. nanoid is just 179 bytes. shortid is 2 times bigger (about 0.5 KB).
  3. nanoid is 10x times faster than shortid.

@schiehll I kept old ID size, everything will be the same for the user.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling b64db09316dfefaa2e02b83f4096e6ab4aa6d7df on ai:nanoid into 2989572e280cc0d7c441c306ba82100c78835cac on schiehll:master.

dennybiasiolli commented 7 years ago

Looks good to me, @schiehll what do you think?

schiehll commented 7 years ago

That looks awesome! Thank you @ai! I will be releasing a new version with the changes later today.