Storybook

Oh yeah, another important development since February is that I started writing tests for everything: Jest for my JS libraries, and Storybook for my React components. I'd forgotten how much fun Storybook can be - I used it on my very first professional project after GA, and then it was in a coding challenge I did a few months back. And now my favorite part of writing a new component is writing the stories. I still have to learn a lot more about it - there are a whole bunch of features I haven't even tried yet. But the Knobs are great - you can create these little widgets to alter the properties of your component right before your eyes: change the size of an image, or the size of all the images, or load a different gallery, or whatever. Anything that's bound to a property in your component can instead be bound to a widget, and then changed on the spot. Even if it's something that will never need to change in your app.

The only downside is that, since it's a testing tool, it doesn't get included in your production build. Which means I spend a lot of time fiddling with something that no one else will ever see. Oh, I'm sure there's a way to deploy Storybook somewhere; only, then I'd just get super obsessive about making that perfect in every way. As it is, it's a fun toy to play with, while still technically doing useful work.

Comments

Popular posts from this blog

Basically done! (at least on full-screen. except for some issues.)

Getting back to it, again

Mobile Issues