Deprecation: imperative render calls - marko-js/marko GitHub Wiki
Directly rendering by passing around the out
variable within a template is deprecated in favor of the <${dynamic}>
syntax for dynamic tagnames.
Manual rendering can create code that is hard to follow and impossible for Marko to optimize.
Here are some examples of how you can migrate existing code to use dynamic tagnames and dynamic attributes:
-
input.renderBody(out) …becomes: <${input}/>
-
input.renderThing(out) …becomes: <${input.renderThing}/>
-
input.renderBody(out, attrs) …becomes: <${input} ...attrs/>
-
renderBody(out) …becomes: <${renderBody}/>
-
input.template.render({ a: "b" }, out) …becomes: <${input.template} a="b"/>
-
input.template.renderer({ a: "b" }, out) …becomes: <${input.template} a="b"/>
-
input.barRenderer({ a: "b" }, out) …becomes: <${{ render: input.barRenderer }} a="b"/>