Fork me on GitHub
#clojurescript
<
2020-03-13
>
MorongÖa06:03:02

Has anyone ever used storybook with clojurescript ?

souenzzo12:03:19

We use #figwheel cards and #workspaces

souenzzo12:03:51

(Cards was released before storybook)

lilactown15:03:28

yes I have. it's kind of a PITA, since storybook uses its own webpack config

lilactown15:03:02

I used shadow-cljs to build my CLJS code as a JS library, and then imported it into my storybook project

MorongÖa04:03:15

@U2J4FRT2T thank you for the suggestion.

MorongÖa04:03:51

@U4YGF4NGM it is worth it though? What are the pros and cons?

lilactown05:03:44

it was sort of complicated. also was a number of years ago

lilactown05:03:05

going to try it again soon, company I’m at also wants to use storybook with CLJS (maybe)

jjttjj14:03:12

does anyone happen to have a minimal example using cljs.analyzer/macroexpand-1 ? I can't seem to get this to work from a cljs-repl:

(a/macroexpand-1 (a/empty-env) `(when true 5))

Error: null
    at new cljs$core$ExceptionInfo (/js/cljs-runtime/cljs.core.js:37203:10)
    at Function.eval [as cljs$core$IFn$_invoke$arity$3] (/js/cljs-runtime/cljs.core.js:37264:9)

Roman Liutikov14:03:00

you can do normal (macroexpand-1 '(when true 5))

jjttjj14:03:02

is the tools.analyzer not meant to be used in this way? It's for a code walking macro and need to supply an external env (just trying to get the basic env working initially)

Edmund15:03:28

Hi all. Is there a reason why shadow-cljs can't find clj-http.client ? I've added it to shadow-cljs dependencies. I can use it in the repl but when I go shadow-cljs watch {my-build} I get "The required namespace "clj-http.client" is not available, it was required by "my/events.cljs". "clj_http/client.clj" was found on the classpath. Should this be a .cljs file?"

jjttjj15:03:28

@edmund691 clj-http is a clojure library and won't work from clojurescript. Maybe you could try https://github.com/r0man/cljs-http

Edmund15:03:59

@U064UGEUQ Thank you very much 😄

martinklepsch15:03:04

Does anyone know a tool that allows you to debug source mappings? I’m seeing some odd mappings in my error handling software and would like to verify if the source maps really point to the wrong spot.

thheller15:03:49

I've used https://sokra.github.io/source-map-visualization/#custom in the past but it has issues with bigger files

martinklepsch16:03:29

Interesting that there’s no CLI tools for this

martinklepsch16:03:36

Or doesn’t seem to be

thheller16:03:43

the npm source-map package also has some tools built-in I think

martinklepsch17:03:04

Interesting, your snippet on ClojureVerse looked like exactly what I was looking for but getting strange results from it

martinklepsch17:03:38

Or maybe I’m using a build from a different branch :thinking_face:

martinklepsch17:03:11

Actually, works perfectly!