Skip to content

Deprecation: imperative render calls

Dylan Piercey edited this page Dec 4, 2018 · 2 revisions

Directly rendering by passing around the out variable within a template has been deprecated in favor of using the <${dynamic}> tag. Manually rendering can create code that is hard to follow and impossible for Marko to optimize.

Here are some examples of how you can migrate your existing code to use the dynamic tag:

  1. input.renderBody(out)<${input}/>
  2. input.renderThing(out)<${input.renderThing}/>
  3. input.renderBody(out, attrs)<${input} ...attrs/>
  4. renderBody(out)<${renderBody}/>
  5. input.template.render({ a: "b" }, out)<${input.template} a="b"/>
  6. input.template.renderer({ a: "b" }, out)<${input.template} a="b"/>
  7. input.barRenderer({ a: "b" }, out)<${{ render: input.barRenderer }} a="b"/>