dash component generation doesn't work for hyphenated props
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 24.4k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 13
Description
When generating new components using the dash typescript boilerplate, there is an issue with props containing a hyphen. E.g., if I try to generate bindings for a component, which has the "aria-expanded" prop, the generated Python class has "area-expanded" in its parameters, which throws an invalid syntax error, since python variables can't have hyphens.
def __init__(self, children=None, value=Component.REQUIRED, aria-expanded=Component.UNDEFINED, **kwargs):
self._prop_names = ['children', 'id', 'about', 'accessKey', 'aria-expanded', ]
SyntaxError: invalid syntax
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 in the Dash TypeScript boilerplate code that generates Python bindings, using the reported aria-expanded prop as a reproduction case. Trace how hyphenated prop names become Python constructor parameters and verify that the generated class remains valid Python while retaining the original prop name in its property list.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100