plotly / plotly/dash

Misleading doc string generation in typescript components

Open
#2,255 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug P3
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

Hi, I am migrating dash-mantine-components to typescript. However, I have been facing some issues with the doc strings generation. The doc strings are not very accurate, in fact, for some prop types, doc string generation just fails.

Example 1
Have a look at how the doc string is generated for the radius prop.

ss1

ss2

The radius property will accept both strings and numbers but the doc string is misleading.

Example 2
For somewhat complex prop types such as value here, the prop generation just fails with the below error.

ss3

Error:

> dash_mantine_components@0.11.0a0 build:backends
> dash-generate-components ./src/ts/components dash_mantine_components -p package-info.json --r-prefix '' --jl-prefix '' --ignore \.test\.


ERROR: "__@iterator@2374" matches reserved word pattern: /^_.*$/

ERROR: "__@unscopables@2376" matches reserved word pattern: /^_.*$/
extract-meta failed

Error generating metadata in dash_mantine_components (status=1)
error: Recipe `build` failed on line 5 with exit code 1

Thanks
Snehil

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dash-generate-components command and its extract-meta step described in the issue. Reproduce the radius documentation mismatch and the value-generation failure using the linked dash-mantine-components examples. Done means complex TypeScript prop types generate successfully and the resulting doc strings accurately describe accepted values.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
documentation, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.