lockandload (Yet another AMD-loader)

255 views
Skip to first unread message

Stephen R. van den Berg

unread,
Sep 18, 2018, 10:29:06 AM9/18/18
to amd-implement
Something I wrote back in 2014, but didn't get a chance to opensource until recently:


Quoting from the "Why" section of the docs:

After reviewing the javascript-loader landscape, looking for a loader that satisfies the following criteria:

  • Small enough to be inlined (to avoid paying an extra request-tax to get the loader onboard).
  • Inlined config file (get rid of a request).
  • Config file in pure javascript (no parsing overhead).
  • Let the browser do the actual loading (browsers are smart these days) of files.
  • Connect all asynchronously loaded modules together.
  • Support for single page apps that include legacy code that uses sprinkled $(function(){...})constructs, yet I insist on loading jQuery late and asynchronously to speed things up.

I came to the conclusion that (apparently?) none of the existing loaders fit the bill. So I wrote lockandload back in 2014 and used it in various internal projects, but decided to open-source it now in case others find it useful. As always, when open-sourcing something, actually writing documentation takes most of the time. The documentation can always be improved. Suggestions are welcome!

Reply all
Reply to author
Forward
0 new messages