This brings Storybook into the repo as a more feature-full environment for testing our form features and individual components. You can see it in action at on Heroku.
The setup was honestly kind of painful. Some notable pain points:
I first tried the Storybook web components framework to see if we could use the <sfgov-form> component as the foundation for testing. Unfortunately, a lot of things were missing and I couldn't even get the controls or actions addons working.
I wanted to use the official formio/react package, but I couldn't figure out (in Storybook's wacky webpack setup) how to bundle it and our theme in such a way that they share the same Formio reference. Instead, I built a new Form (React) component that uses state and effect hooks extensively, and it seems to work well; but it feels like a hack.
@JimBrodbeck Could you review this while I'm out? I'd love your thoughts on a couple of things:
Are you able to npm install and then run Storybook with npm run storybook?
This brings Storybook into the repo as a more feature-full environment for testing our form features and individual components. You can see it in action at on Heroku.
The setup was honestly kind of painful. Some notable pain points:
<sfgov-form>
component as the foundation for testing. Unfortunately, a lot of things were missing and I couldn't even get the controls or actions addons working.Formio
reference. Instead, I built a new Form (React) component that uses state and effect hooks extensively, and it seems to work well; but it feels like a hack.@JimBrodbeck Could you review this while I'm out? I'd love your thoughts on a couple of things:
npm install
and then run Storybook withnpm run storybook
?