zendeskgarden / react-components

:seedling: garden React components
https://zendeskgarden.github.io/react-components/
Apache License 2.0
1.1k stars 89 forks source link

Promote Best Practices on examples #457

Closed scamelo closed 5 years ago

scamelo commented 5 years ago

Motivation

This is an amazing project, and moving everyday in a better direction. The idea behind this issue (opened to discussion) is to maybe define some concrete patterns to be used in the code examples (ie: avoid inline functions, etc).

Reality

After copying some examples usually you need to perform repetitive changes to accommodate some portions of it in order to have a more performant way of rending the components and match some functional and class component best practices.

Goals

Final thoughts

Keep Rockin!

austingreendev commented 5 years ago

👋 Hi @scamelo, thanks for opening this issue.

We totally agree with this. Right now our documentation is generated by react-styleguidist. They are using buble and a few other tools to generate the examples that you see. This requires a unique way of handling state and how we import other components. We also write these examples in markdown files which means our default linting and common automations (like jsx-a11y) can't be ran.

We are looking at new doc solutions which will allow us to write these examples in the same way (and quality) as the components.

louisscruz commented 5 years ago

(For context: Santiago and I had discussed improving our documentation for Lotus, and I think this was geared toward that. Moved this issue over to Lotus.)