inveniosoftware/invenio — pull request #1794 by greut (2014-06-09 13:55:28+00:00)
Title: WiP/PoC assets: require.js support

(was https://github.com/jirikuncar/invenio/pull/276)

### Rational

[Requirejs](http://requirejs.org/) enable modules in the browser and dependencies management (AMD). Meaning, you don't rely on global variables anymore and declare what you're using.

```javascript
require(function(require) {
var $ = require('jquery')
require('bootstrap/tooltip')

$('.mycomponent').tooltip('show')
});
```

In development mode, the modules are gonna be loaded asynchronously. In production, a bundle is made with everything required into one minified file.

### Changes

* Adding support of the `requirejs` filter provided by `webassets 0.10`.
* Using bootstrap3 javascript file from require.js (**breaks things**).
* Changing some JavaScript modules to by AMD formatted.

### Extra configuration

All the binaries are either installed globally or set in the configuration.

```python
# Should it apply the filter `requirejs` in debug mode.
REQUIREJS_RUN_IN_DEBUG = False
# Configuration file to be used when applying the filter.
REQUIREJS_CONFIG = u"js/build.js"
```

### Blockers

- [ ] webassets 0.10
- [ ] Flask-Assets 0.10
- [ ] wild `