Skip to content

Considerations

We often think about breaking these up different, for example:

<div
data-api="/server.php"
data-role='autoform'
data-api-method="POST"
data-intent='{ "REFRESH": { "Server" : "Save" } }'
data-context='{ "_response_target": "#result"}'>

However, this slightly awkward form above allows:

  • Multiple intents per request: Thanks to
  • Multiple commands per intent
  • Multiple support payloads
  • Response is flexible enough either way
  • Still not that hard to learn compared to HTML, but makes things very very flexible for tooling. Simple enough for humans, flexible enough for tooling.

There is an open request for comments simplifying this syntax without losing that ability. Even purely being able to forward intents with null equivalent commands can be useful, for action sequencing. Additionally the server / intent provider is able to request interaction with additional screen elements, based on context.