Woocommerce-admin: Component Library

Created on 10 May 2018  Â·  5Comments  Â·  Source: woocommerce/woocommerce-admin

One feature I enjoy in calypso is the ability to browse blocks from devdocs. Should we consider building our own component library with documentation/examples as we build out components for the Dashboard and Analytics?

This could serve as internal documentation for us, and eventually be a fantastic resource for 3PD who want to use design patterns from Dash/Analytics in their own extensions.

question

All 5 comments

I started to explore using storybook but ran into the same kind of issues as @psealock seems to be having with jest in #24 – it doesn't know how to handle the gutenberg dependency. Maybe the solution for jest would let us use storybook? Or we could go the calypso way and have a separate wp-admin page that is only rendered in a "dev" environment, automatically built from components.

it doesn't know how to handle the gutenberg dependency. Maybe the solution for jest would let us use storybook?

I have a solution coming up. I just need to iron out some issues and will present a proof of concept which allows construction of window.wp and a mapping for imports of those properties. Maybe that will help.

Unassigned myself since this is pending discussion between gutenberg and calypso, I think about one styleguide everyone can use

@timmyc Should we revisit this as there are now more resources?

It has shipped! When you have

define( 'WP_DEBUG', true );
define( 'SCRIPT_DEBUG', true );

in wp-config, you will see a link to the devdocs.

Was this page helpful?
0 / 5 - 0 ratings