plotly / plotly/dash

Improve react-docgen usage

Open
#2,731 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Right now, component libraries need to include react-docgen specified as a devdep, and it's stuck on the 5.x series even though react-docgen itself is up to 7.x, because it's actually used by extract-meta.js in this repo, via the dash-generate-components command. Can we either:

  • Use a version of react-docgen provided by Dash - if we did this we would either need to include a built react-docgen with dash, or have dash-generate-components run npm i inside Dash, since component authors would not generally have built Dash itself.
  • At least update extract-meta.js (and dash-generate-components if necessary) to support react-docgen 7.x (but maintaining support for 5.x for compatibility with existing components). Not ideal, since components have no direct dependency on react-docgen, but at least component authors could keep their dependencies up to date.

Also note: It looks like Typescript component generation pulls in Typescript from the component's node_modules, and this should not change. Typescript projects are built with a specific Typescript version so should be parsed with that same version. This means we'll need to keep extract-meta.js working with any changes that might be introduced in Typescript, but that seems unavoidable (and so far hasn't been an issue 🙏)

@T4rk1n curious your thoughts.

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 by reading extract-meta.js and the dash-generate-components command to trace how react-docgen and the component's Typescript are resolved. Compare the proposed Dash-provided dependency approach with compatibility for react-docgen 5.x and 7.x. Done means the dependency arrangement is decided and component generation supports the required react-docgen versions without changing the component-local Typescript behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, typescript
Domain
build-system, frontend, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.