-
Notifications
You must be signed in to change notification settings - Fork 649
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:
-
input.renderBody(out)
➔<${input}/>
-
input.renderThing(out)
➔<${input.renderThing}/>
-
input.renderBody(out, attrs)
➔<${input} ...attrs/>
-
renderBody(out)
➔<${renderBody}/>
-
input.template.render({ a: "b" }, out)
➔<${input.template} a="b"/>
-
input.template.renderer({ a: "b" }, out)
➔<${input.template} a="b"/>
-
input.barRenderer({ a: "b" }, out)
➔<${{ render: input.barRenderer }} a="b"/>
To automatically fix deprecated marko syntax, try the marko migrate
command from the CLI.