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

typescript/react-apollo: Generate docblocks for hooks #2572

Merged
merged 4 commits into from
Sep 17, 2019
Merged

typescript/react-apollo: Generate docblocks for hooks #2572

merged 4 commits into from
Sep 17, 2019

Conversation

CarloPalinckx
Copy link
Contributor

@CarloPalinckx CarloPalinckx commented Sep 16, 2019

This PR:

  • Adds docblock generation to the react-apollo plugin.
  • Adds jest-docblock (from their official repo) dependency to parse docblocks in tests.
  • A test to cover the new functionality.

Few things I would like to receive some feedback on:

  • Should we also be looking into docblocks for HOC and Component API's?
  • What exactly would we want to put in the docblocks, since the generated code is only used by typescript/flow users, I wonder how much benefit annotations like typedef have.

resolves #2558

@CarloPalinckx CarloPalinckx changed the title Generate docblocks for hooks typescript/react-apollo: Generate docblocks for hooks Sep 16, 2019
@CarloPalinckx CarloPalinckx mentioned this pull request Sep 16, 2019
@dotansimha
Copy link
Owner

That's awesome! Thank you @CarloPalinckx !

@dotansimha dotansimha merged commit a5cb221 into dotansimha:master Sep 17, 2019
@levrik
Copy link
Contributor

levrik commented Oct 7, 2019

Why is this feature not toggleable? We're checking in our generated files and this generated a huge amount of noise. Also we're not seeing any value in that for us.

@n1ru4l
Copy link
Collaborator

n1ru4l commented Oct 7, 2019

@levrik Pretty sure a pulll request for this will be accepted! It should be pretty easy too!

@CarloPalinckx
Copy link
Contributor Author

@levrik @n1ru4l I'll have a look 👍, default behaviour would be to add the comments? I understand that you could see it as noise but I think IDE integrations outweigh clutter in generated files.

@levrik
Copy link
Contributor

levrik commented Oct 9, 2019

@CarloPalinckx Actually for me these docs doesn't add that much value since I know Apollo and the autocompletion provided by the typings is enough. Maybe it could help new team members that don't know the tech stack.

@CarloPalinckx
Copy link
Contributor Author

@levrik a configuration option was added to disable the docblocks #2717

@levrik
Copy link
Contributor

levrik commented Oct 16, 2019

@CarloPalinckx awesome, thanks.

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

Successfully merging this pull request may close these issues.

JSDoc
4 participants