Skip to content

Metadata not generated correctly for Typescript components #3017

@AnnMarieW

Description

@AnnMarieW

With TypeScript components, the metadata.json file is not generated correctly in cases where there is a union with a boolean.

For example,

persistence?: boolean | string | number;

The metadata.json file only includes the string and number but not the boolean.

 "persistence": {
        "description": "Used to allow user interactions in this component to be persisted when\nthe component - or the page - is refreshed. If `persisted` is truthy and\nhasn't changed from its previous value, a `value` that the user has\nchanged while using the app will keep that change, as long as\nthe new `value` also matches what was given originally.\nUsed in conjunction with `persistence_type`.",
        "required": false,
        "type": {
          "name": "union",
          "value": [
            {
              "name": "string",
              "raw": "string"
            },
            {
              "name": "number",
              "raw": "number"
            }
          ],
          "raw": "string | number | boolean"
        }
      },


The docstrings are not generated correctly:

image

Also, setting the persistence=True on the component generates this warning in the console:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2considered for next cyclebugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions