latin-language-toolkit/arethusa — pull request #373 by LFDM (2014-08-31 18:02:01+00:00)
Title: MAJOR CHANGE: Load plugins and their plugins dynamically

Take a look at `app/index.html` and `app/js/arethusa.js` - everything plugin related is just gone.

The `plugins` service now takes care of loading plugins dynamically - only plugins that are specified in the current conf file are loaded - all other requests are just gone.

`plugins` uses the `dependencyLoader` for this, which is a wrapper around [$ocLazyLoad](https://github.com/ocombe/ocLazyLoad).

When plugins need external dependencies, they can do so by specifying their `this.externalDependencies` variable. An array-based and an object-ba sed syntax is supported, for an example of the former check `review.js`, for the latter `depTree.js`.

Plugins don't need to be included in this main repository anymore. If they specify `this.location`, they can be retrieved from everywhere.

All other external dependencies needed by the `core` are minified to a single file `arethusa_packages.min.js`. It's rather huge - 250+ kb - but it's just a single request and as users will be caching this, it will further speed up load time.

The Gruntfile saw a huge overhaul to support all of this. Templates are now bundled with their minified module/plugin file, which should make testing easier - and is absolutely needed to make these changes possible.

Subsequent PRs will add tests for `plugins`, as well as play with adding and removing plugins on runtime.

We will soon start to document Arethusa - this will play a huge role there.

All this has been done without require.js, which would add a lot of complexity. We might never need it - this PR therefore closes #18.

#325 receives a huge boost as well... We'll be there soon.