Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: declarations and parent objects for props are not populated with TypeScript >= v5.1.3 #483

Open
Francois-Esquire opened this issue Jul 14, 2023 · 1 comment

Comments

@Francois-Esquire
Copy link

The declarations and parent properties on the docgen property object appear to be missing (thus not filtered by the default method) in later versions of typescript (after v5.0.4). For example, a docgen property object when working as expected:

{
  defaultValue: null,
  description: '',
  name: 'key',
  parent: {
    fileName: '<root>/node_modules/@types/react/index.d.ts',
    name: 'Attributes'
  },
  declarations: [
    {
      fileName: '<root>/node_modules/@types/react/index.d.ts',
      name: 'Attributes'
    }
  ],
  required: false,
  type: { name: 'Key | null | undefined' }
}

compared to:

{
  defaultValue: null,
  description: '',
  name: 'key',
  parent: undefined,
  declarations: [],
  required: false,
  type: { name: 'Key | null | undefined' }
}

After some exploration, (this part of the source code) where the declarations are populated for each property do not seem to be working after v5.1.3. The thread appears to lead to typescript itself (ts.Symbol) has changed.

See previous issue.

@genepaul
Copy link

I just want to add that I'm seeing this situation in a project on TypeScript 4.9.5, so I don't know if this is necessarily related to TypeScript version (at least not the major version update). In my investigations, I came to believe that this might be related to the tsconfig that is used when running the parser - perhaps which types are considered to be "in the program" will affect whether those types are correctly populated? I'm stabbing in the dark here because my knowledge of the TS compiler is limited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants