code: function upgrade(template) {
    var info = templates.get(template) ||
        set(templates, template, transform(template));
    return {
      template: template,
      updates: fixUpdates.call(this, info.updates),
      chunks: info.chunks
    };
  }
docs: but the first time, it needs to be setup. From now on, only update(tempalte) will be called unless this context won't be used for other renderings.