IABTechLab / iabgpp-es

Apache License 2.0
25 stars 8 forks source link

switch to Array.from rather than spread operator #27

Closed jameshartig closed 1 year ago

jameshartig commented 1 year ago

The spread operator requires babel to include a lot of extra code: https://babeljs.io/docs/assumptions#iterableisarray

Similarly with TypeScript: https://github.com/microsoft/TypeScript/issues/8856 (Fixed in https://github.com/microsoft/TypeScript/pull/31166).

Array.from is simpler and reduces the amount of code generated when transpiling. This would save us 811 bytes after gzip.