The Tags API marks a shift from Marko as a templating language with a bolted-on component API to a fully-fledged language that can describe state and

Introducing the Marko Tags API Preview

submited by
Style Pass
2021-07-28 17:00:05

The Tags API marks a shift from Marko as a templating language with a bolted-on component API to a fully-fledged language that can describe state and updates.

The last couple of years have seen build-around primitive take over the front-end ecosystem from React Hooks to Vue's Composition API. They've drastically improved developer experience by letting state be grouped by behavior rather than lifecycle. This makes it easy to compose behavior and extract it into separate reusable modules.

The Tags API brings this capability to Marko. You can build your own <let> that syncs its value with localStorage or your own <for> that is paginated. The possibilities are endless.

Having a language for state and updates means it can transcend the component model as we know it today. Other component libraries have introduced primitives, but still tie them to the concept of a component instance.

With the new Tags API, lifecycle and state management can be handled anywhere within your templates even when nested under <if> and <for>.

Leave a Comment