Hacker News new | ask | show | jobs
by Rapzid 1740 days ago
I've had a lot of success with Storybook as a development aid on a large legacy application where VueJS is slowly taking over.

Will use it for building components of any complexity and size under "screen" leaving just the "last mile" to work out in the legacy app. Have it configured so the API can be hit and/or pre-recorded API calls can be used.

It has made cross-browser testing and fixes(looking at you Safari) quite quick. Leaned on it for large CSS/SCSS refactors and style updates.

Could something like this be written from scratch? Sure, but why? It's a set of conventions already in place and documented. Setting it up was a breeze and creating a "story" can be just about as simple or complicated as you want.

1 comments

> Could something like this be written from scratch? Sure, but why?

There's lots of reasons: it is simple enough that it can be done in an afternoon. It is a great learning exercise, especially for junior devs. It has hard dependencies on React, Webpack, Babel, Reach Router, PostCSS that can cause you project to break if you're not careful, not to mention the bloat. If you use Vue, Typescript or other bundler you have a lot of redundancy now, and possibly some quirks due to incompatibilities between bundlers. Also there's UI/UX quirks. And it's harder to customise than a plain page.

I'm all for reusing other projects and saving time, but the automatic reflex we have of automatically adding dependencies without considering the downsides becomes very problematic in non-trivial projects.

> There's lots of reasons

Boy howdy. Of course, every NIH project that turns into a huge wasted time sink has a rationalization chock-a-block with reasons.

It depends. YMMV. etc.

The fact you tried to rudely and defensively turn my "consider the downsides" (that you actually asked for!) into "rationalization chock-a-block" tells me it doesn't really "depend" for you.

If you think I'm taking a side by merely pointing out something has downsides: you're projecting. Neither reusing nor building from scratch should be automatic decisions taken without consideration.