As websites become more sophisticated, the amount of JavaScript source code keeps increasing. By itself, this is not a problem. However, with the amount of code loaded by large websites such as Facebook's chat, it is now common to witness page loads during which both the loading and the parsing of JS code can take several seconds each – this is assuming a fast connection, and taking into account that the code is both compressed and optimized for loading and parsing speed.
There is no reason to believe that the size of JS code will decrease or will even stop increasing, nor that every large webdev team has the means to profile loading and parsing speed of all their code.
This repo offers a (WIP) reference implementation for BinJs, a vendor-neutral JavaScript format designed to optimize parsing speed and, when possible, loading speed.
The BinJs format is not designed to be read or written by developers. Rather, we expect that the toolchain, both server-side and browser-side, will generate (respectively parse) BinJs files, letting BinJs files be used transparently for communication between the browser and the server.
- Install dependencies (you will need
npm)
npm install babel-core
npm install babylon
npm install mktemp