Optimize code for compression. I've done some hand-tooled tricks with string aliases for onreadystatechange and readyState for better minification. It's slightly harder to read, but not much. I didn't go for the final bytes that would have made the underlying code too unreadable.
Update docs for release/build tool integration
Add npm 'version' lifecycle commands
Note: I'm not planning on doing a UMD wrapper ( #9 ), instead giving documentation of how to build with "the usual tools" to have a laser-light focus on tightly inlining this.
We're down to 525 bytes with Uglify! Also note that although Closure Compiler goes smaller at 519 bytes, the 6 bytes difference doesn't make it worth the cost of having Java in the publishing pipeline.
... after this we should be ready for rollout to Atlas and beyond!
$ npm run build
$ wc -c dist/little-loader.min.js
525 dist/little-loader.min.js
Fixes #10
onreadystatechange
andreadyState
for better minification. It's slightly harder to read, but not much. I didn't go for the final bytes that would have made the underlying code too unreadable.Note: I'm not planning on doing a UMD wrapper ( #9 ), instead giving documentation of how to build with "the usual tools" to have a laser-light focus on tightly inlining this.
We're down to
525
bytes with Uglify! Also note that although Closure Compiler goes smaller at519
bytes, the6
bytes difference doesn't make it worth the cost of having Java in the publishing pipeline.... after this we should be ready for rollout to Atlas and beyond!
/cc @exogen @baer @aisapatino @geekdave @Maciek416