Metadata not generated correctly for Typescript components
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
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:
Also, setting the persistence=True on the component generates this warning in the console:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how metadata.json is generated for TypeScript component props, using the persistence?: boolean | string | number example to reproduce the issue. Done means the generated union retains boolean, the component docstrings reflect it, and setting persistence=True no longer produces the reported warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100