Skip to content

Iterate polyfills instead of calling each individually#5

Merged
keithamus merged 3 commits intomainfrom
iterate-polyfills
Feb 15, 2022
Merged

Iterate polyfills instead of calling each individually#5
keithamus merged 3 commits intomainfrom
iterate-polyfills

Conversation

@dgreif
Copy link
Copy Markdown
Contributor

@dgreif dgreif commented Feb 15, 2022

While reviewing #4, I noticed we are repeating these function calls for each polyfill. If we put all the polyfills in an array and iterate, we can achieve the same goal with a lot less code. It also helps avoid accidentally adding a new polyfill to one of these functions while missing one of the others

This takes the lib/index.js from 2,855 bytes to 2,311 bytes. Roughly .5kB before minification/gzip isn't a ton, but it's something 😄

@dgreif dgreif requested a review from keithamus February 15, 2022 03:32
@dgreif dgreif requested a review from a team as a code owner February 15, 2022 03:32
@keithamus keithamus merged commit 60d896d into main Feb 15, 2022
@keithamus keithamus deleted the iterate-polyfills branch February 15, 2022 08:22
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.

2 participants