Don't shy away from YAML

After working locally for a while, I realized that working directly in YAML isn’t that hard. The hard part was trying to infer the spec from examples, since this isn’t really documented. I had to look at a lot of my older apps developed in the designer to understand. Once I understood the structure, I actually preferred to define my UI components in YAML even when working locally.

I think the Anvil team should document and version the YAML spec for forms (if the spec changes).

Tangentially related to this is a tweak to the YAML spec that I would really like: don’t put multiple properties on the same line. For example:

components_by_slot:
  content:
  - name: heading_estimator
    type: form:dep_m3:_Components.Heading
    properties: {text: "Project Estimator", style: headline, scale: medium, align: center}

could easily be:

components_by_slot:
  content:
  - name: heading_estimator
    type: form:dep_m3:_Components.Heading
    properties:
      text: "Project Estimator"
      style: headline
      scale: medium
      align: center

This makes commit diffs a lot easier to read.

We’re all Pythonistas who are used to carefully managing whitespace anyway :slight_smile: .

6 Likes