Micro size optimizations
With these little optimizations, we save about 13% of the initial size (3544 b to 3087).
@bcolucci thanks, lots of good stuff here. Only thing is the shortcuts for the window methods (e.g. addEventListener) do actually decrease the minified file size, especially when they are used more than once. It's because then the file only has to have a reference to a method name like addEventListener, then the variable referencing it can be something like a = .... Other than that, I'll implement some of these changes, thanks!
Only thing is the shortcuts for the window methods (e.g.
addEventListener) do actually decrease the minified file size, especially when they are used more than once. It's because then the file only has to have a reference to a method name likeaddEventListener, then the variable referencing it can be something likea = ....
That depends on the features added to the library in the future. For now, this PR looks great!
Could also be great to merge the testing environment PR, so we will be able to test ;)
@jaredreich I've reduced the actual code. But yeah, of course, if you use more (in next release) these shortcuts it's better to have them declared as you said.