The current system for customizing behavior while in the Chrome App would be better off using templating. E.g. now we use hash parameters to determine if the html page is being run as a webview in a chrome app, and if so, what origins it should accept messages (from the App) from. It would be cleaner and more secure if these were hardcoded into the HTML through templating.
Compiled vs raw javascript needs templating to determine which to use. When we move to compiled JS in production servers, we still need to use raw JS when debugging.
Various paths are hard-coded when it would be much more robust and flexible to have these passed in using the templating, a la IPython. For example, default kernel URLs can be passed in via templates, allowing for local servers to set the default kernel url to be itself (rather than always 127.0.0.1:8844). This could be done in JavaScript too, but it's much easier to specify these via templates than have the JavaScript detect whether it is running in production or on a local server.
Templates are needed for a number of reasons: