Skip to content

switch to Array.from rather than spread operator#27

Merged
iabmayank merged 1 commit intoIABTechLab:masterfrom
jameshartig:array-from
Sep 6, 2023
Merged

switch to Array.from rather than spread operator#27
iabmayank merged 1 commit intoIABTechLab:masterfrom
jameshartig:array-from

Conversation

@jameshartig
Copy link
Copy Markdown
Contributor

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

Similarly with TypeScript: microsoft/TypeScript#8856 (Fixed in microsoft/TypeScript#31166).

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

@iabmayank iabmayank merged commit 2c75bde into IABTechLab:master Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants