[MAINTENANCE] Improve react-docgen usage
alexcjohnson opened this issue · comments
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 builtreact-docgen
with dash, or havedash-generate-components
runnpm i
inside Dash, since component authors would not generally have built Dash itself. - At least update
extract-meta.js
(anddash-generate-components
if necessary) to supportreact-docgen
7.x (but maintaining support for 5.x for compatibility with existing components). Not ideal, since components have no direct dependency onreact-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.