r/Clojure • • 28d ago

Is anyone still using devcards? What do you use for building components in isolation today?

Devcards seems quiet these days. I've seen Portfolio mentioned as a successor.

So, for building UI components in isolation today:

  • Is anyone still using devcards?
  • Portfolio, or something else?
  • Or do you just build components in the app itself, with hot reload?

I work in re-frame and Fulcro, if that changes the answer.

20 Upvotes

4 comments sorted by

10

u/stoating 28d ago

I’m a big fan of portfolio personally. I’m not a frontend expert, but portfolio makes it easy for me to see a bunch of different states of the ui elements either alone or in combination with other elements. Maybe other libraries offer the same thing, but it hits the spot for how I like to do my work.

2

u/cjmurrr 28d ago edited 27d ago

Portfolio seems a more natural fit for Replicant than for Fulcro or re-frame. I already have a lot of Playwright (PW) tests.

In my mind the functions of Portfolio/devcards and UI testing intermingle quite a bit - in fact even doing demonstration videos is in the same stream: I can ask my AI to create PW tests then turn them into step-thrus (my own small library, coming soon: it runs a Playwright test one step at a time, with captions, for someone to watch) and then videos (replacing the step with a pause, because in a video a watcher can't step with the spacebar). So I might just stick with this way of isolating what happens when changing specific parts of front-end state, which I think of as what Portfolio/devcards does.

7

u/Obvious_Variety_1828 28d ago

I use portfolio too (and replicant)

7

u/bostonaholic 28d ago

Portfolio (from cjohansen) is where most folks seem to have landed. Whatever tool you pick, the bigger win is keeping views as plain functions of data: subscribe in a thin wrapper and pass maps to the presentational component. Then a card is just that component called with a literal map, and you don't need app-db or hot reload to see every state.