Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata not generated correctly for Typescript components #3017

Open
AnnMarieW opened this issue Sep 29, 2024 · 1 comment
Open

Metadata not generated correctly for Typescript components #3017

AnnMarieW opened this issue Sep 29, 2024 · 1 comment
Labels
bug something broken P2 needed for current cycle

Comments

@AnnMarieW
Copy link
Collaborator

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

@gvwilson gvwilson changed the title [BUG] Metadata not generated correctly for Typescript components Metadata not generated correctly for Typescript components Oct 1, 2024
@gvwilson gvwilson added bug something broken P2 needed for current cycle labels Oct 1, 2024
@gvwilson
Copy link
Contributor

gvwilson commented Oct 1, 2024

@T4rk1n is this something you'd know how to fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P2 needed for current cycle
Projects
None yet
Development

No branches or pull requests

2 participants