

Show HN: LoadJS – A tiny async loader for modern browsers - andres
https://github.com/muicss/loadjs?a=1

======
Theyeard
Very nice! It reminds me of these two loader experiments: [https://curiosity-
driven.org/amd-loader-with-promises](https://curiosity-driven.org/amd-loader-
with-promises) [https://curiosity-driven.org/minimal-
loader](https://curiosity-driven.org/minimal-loader)

But for production builds I highly recommend Almond:
[https://github.com/jrburke/almond](https://github.com/jrburke/almond)

~~~
snarkyturtle
There's also
[https://github.com/systemjs/systemjs](https://github.com/systemjs/systemjs)
which aims to implement the ES6 Module Loader.

------
hyperhopper
This seems like just a reimplementation of AMD, a baby RequireJS

~~~
laurencerowe
I find myself using scriptjs (on which this is based) to download browserify
bundles for libraries which we don't want on every page load and also to load
external API libraries which we want to fetch directly from their publisher
(e.g. Mozilla Persona.)

It looks like webpack solves the first problem
([http://webpack.github.io/docs/code-
splitting.html](http://webpack.github.io/docs/code-splitting.html)) but for
external unmanaged libraries they recommend scriptjs.

~~~
andres
I'd been using $script for quite a while until I noticed that it was executing
callbacks even when the dependency didn't load. After looking at the source
code, I realized that it's because it was designed to work with legacy
browsers that don't have onerror callbacks. Since I'm only focused on modern
browsers and $script isn't maintained anymore, I wrote LoadJS to add
success/fail callback support.

------
bricss
[https://github.com/bricss/dope](https://github.com/bricss/dope)

