-
Notifications
You must be signed in to change notification settings - Fork 644
Deprecation: async‐fragment
Taylor Hunt edited this page Aug 2, 2019
·
3 revisions
The <async-fragment>
tag and its friends are deprecated in favor of the <await>
tag.
The effect of the new tags is the same as their deprecated equivalents.
<async-fragment data-provider=input.someData var="someVar" />
Instead, use the <@then>
attribute tag with a parameter to rename the variable:
<await(input.someData)>
<@then|someVar|></@then>
</await>
<async-fragments />
…becomes the client-reorder
attribute on <await>
:
<await client-reorder />
<async-fragment-placeholder>Loading…</async-fragment-placeholder>
…becomes the <@placeholder>
attribute tag as a child of <await>
:
<await>
<@placeholder>Loading…</@placeholder>
</await>
<async-fragment-error>Request errored</async-fragment-error>
Promise rejections now display content with <@catch>
attribute tags:
<await>
<@catch>Request errored</@catch>
</await>
<async-fragment-timeout>Request timed out</async-fragment-timeout>
Timeout messages are now a special case of catching promise rejections, using <@catch>
and a timeout
attribute:
<await timeout=5000>
<@catch|err|>
<if(err.name === "TimeoutError")>Request timed out</if>
</@catch>
</await>
To automatically fix deprecated marko syntax, try the marko migrate
command from the CLI.