api-notebook
api-notebook copied to clipboard
Embed File Size
I'd like to get a better understanding about the weight of our embed code and how comfortable we are with it.
It looks like scripts/embed.js loads https://api-notebook.herokuapp.com/scripts/api-notebook.js.
embed.js is 40kb, api-notebook.js is 1.8mb. gzipped, api-notebook.js is 390kb. It looks to be only partially minified.
For comparison, JSFiddle looks like it loads ~ 1MB worth of JS (gzipped to ~500kb)
Questions:
- What is our target weight?
- Can we reduce our footprint?
- Can we show a loader for users downloading the script, or do any progressive enhancement?
- Should we worry about this now or later?
I'd like to have new users land on a demonstration notebook (i.e. they see a link on twitter to APINotebook.com and land on a notebook that both explains how notebooks works and is a notebook they can play with). Is the load time an acceptable experience for those new users?
/cc @blakeembrey @usarid
Good discussion! Blake, how do you feel about all the stuff that's in there -- do you think it could go on a diet (is is there lots of stuff there we don't actually need), or is it all really needed?
@usarid I think some stuff could be shrunk (it's all needed), but about 50% of the size is just for the RAML at the moment. I should be able to shrink some redundant requires out of the code (hopefully).
@blakeembrey would you mind doing a brief breakdown in this ticket of what files (wether they are in the repo or brought from external sources) are contributing to the filesize?
@blakeembrey added minification to api-notebook.js, which brought the file down to 800kb and makes it (a little) less worrisome.
Blake, is it possible to gzip the assets as well? And can you provide the breakdown Mr. @eastridge asked about?
/Note: moving this ticket to "next" milestone as it is not as important as the other tickets in "current"