Akay Akay - 5 months ago 43
Javascript Question

What is a "Javascript Bootloader"?

I have seen this mainly in the source of Facebook

What is exactly a bootloader in javascript? What is its use and purpose?


Generally speaking, the bootloader is a (relatively) small amount of code responsible for establishing the environment that all subsequent code requires to run, as such it is also the the first code to be executed. It's usually restricted to OSes, but makes sense for FB too.

In the case of Facebook, the bootloader will do things like loading additional JS files and other resources that the library needs in addition to the single public <script /> the developer included in the document.