mozilla/fireplace — pull request #48 by mattbasta (2013-03-02 04:49:13+00:00)
Title: [DO NOT MERGE] Call for comments on builder2

Take a look at the new builder (called "generator" for now...will be renamed once the old one is completely ripped out).

Status:
- Completed homepage
- Completed app detail page
- Neither ratings nor search started
- No support for models/caching (yet)

Features:
- No more sub-templates for content generated with the builder (use `{% defer (url=...) %}` and forget that you ever had so many HTML files)
- Automagic request coalescing
- `{% placeholder %}` puts a nice loading block before the content loads in. If you don't provide one, builder2 will put a div with `class="loading"` in there for you.
- `{% empty %}` (thanks @dspasovski) will be triggered if you get a listing back with no elements (`[]`).
- `{% except %}` will be triggered if the API request fails.
- This will work in spaceheater once that lands

Notes:
- We no longer use `nunjucks_precompile` because we need to shim in our custom tags extension for the compilation step. The new compiler is `compile_templates.js` in the root.
- `builder.start()` on the builder object now accepts a second parameter for passing in arguments (like the slug). See `app.js` for an example.
- `builder.start()` returns the deferred object for the page.
- `builder.done()` accepts a function that will be executed before the page is finished rendering.
- It's magically delicious