ai / nanoid

A tiny (124 bytes), secure, URL-friendly, unique string ID generator for JavaScript
https://zelark.github.io/nano-id-cc/
MIT License
24.61k stars 790 forks source link

V3 brokes IE #336

Closed AvraamMavridis closed 2 years ago

AvraamMavridis commented 2 years ago

The way the V3 is exported prevents proper traspilation and because of the arrow functions the package is not working on IE11. Any plans to provide a es5 compatible build?

v3 output of webpack with es5 target (arrow functions still there):

Screenshot 2022-01-20 at 09 35 17

v2 output of webpack with es5 target (no arrow functions):

Screenshot 2022-01-20 at 09 50 45

ai commented 2 years ago

We have a notice in docs with a solution https://github.com/ai/nanoid#ie

We made this choice to make JS move forward without blocking from very old IE 11. If you need to support IE 11 you can use many tools to compile JS.