question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

refactor documentation to remove react-desc

See original GitHub issue

We can have issues in our documentation due to react-desc trying to combine propTypes with documentation and not always working well on either side. For example, we cannot reference propTypes from react-desc in other components due to how they are decorated. And, we need the ability to provide richer example syntaxes that don’t work with the more simplified propType derived approach.

A suggestion is to have two files per component: propTypes.js and doc.js. The former would just have the propTypes and could be reference from other components. The latter would change the current documentation by removing the programatic prop definitions and instead support a richer syntaxExamples per each property, similar to what we do in grommet-site. The README.md files per component would be generated from doc.js with better syntax examples that aligned with grommet-site.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ericsoderberghpcommented, Jun 16, 2021

Two years later …

  • I think we should remove react-desc entirely.
  • I think we should out the propTypes in a separate file, that makes the typescript typings and prop types consistent. I suggest this because I think there is enough complexity in some of the components typings that adding them into the component file would make it a bit unwieldy.
  • I think all of the documentation should be in moved to the grommet-site repository. This will allow more customization of how complex types are described but just describing them in markup, rather than building a more complex JSON structure just to then have to convert that to markup later.
  • I think we should update grommet-site to show properties with different types where there are different descriptions and examples for each type, rather than trying to merge those into a single description.
  • I think we should simplify the README files to just contain a link to the appropriate documentation page.
0reactions
ericsoderberghpcommented, Jun 21, 2021

Superceded by #5353

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tracking removal of react-desc · Issue #5353 - GitHub
react-desc should be removed from grommet and the documentation for each component should be contained in the grommet-site repo.
Read more >
Safe Delete refactoring | ReSharper Documentation - JetBrains
Right-click and choose Refactor | Safe Delete from the context menu. Choose ReSharper | Refactor | Safe Delete… from the main menu.
Read more >
The Complete Engineer's Guide to Code Refactoring - Stepsize
In this guide, you'll learn all about refactoring source code: the benefits, ... Simply put, refactoring is a way of removing or decreasing ......
Read more >
Refactoring source code in Visual Studio Code
Visual Studio Code supports refactoring operations (refactorings) such as Extract Method and Extract Variable to improve your code base from within your ...
Read more >
Refactoring model elements - MagicDraw 18.5
MagicDraw 18.5 Documentation ... Configure the extract refactoring by changing ExtractSource and ExtractTarget. Invoke the refactoring with ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found