Fork me on GitHub
Tala Tarazi12:01:29

Hi, I'm trying to setup storybook to my re-frame template project. Can't make it really work, I get this error in storybook Couldn't find any stories in your Storybook. does anyone did this before in re-frame?


Just in case - I'm 95% sure it has nothing to do with re-frame. The Storybook tutorial states: > The story is a function that returns a rendered element (i.e., a component with a set of props) in a given state---exactly like a Functional Component. If that's always the case, then you definitely have to jump through some hoops to make Reagent components work with Storybook as by default they are class components and not functional ones.


And if that template you're using claims to have Storybook support built into it, I would create an issue in the template's issue tracker right away.


To be quite honest I dont think this has anything to do with re-frame either. I’d recommend checking the following links: •

David Vujic15:01:43

I have made an example project combining ClojureScript and Storybook that might help: Have a look at the shadow-cljs.edn - I recognize the error message you get and think it might be how ClojureScript and Webpack work together.

☝️ 2
David Vujic15:01:22

Haha, as soon as I hit ENTER, your message popped up too Arthur 😄

😆 1

@U018VMC8T0W Looks like we were writing it at the same time haha :-)

😆 1

Are there full, sane and up to date guides on js interop?


I have an interop call like this (.toISODate (luxon/ and I’m trying to convert it to a shorter version.


How would you make it shorter? There are no extra symbols that you could even potentially remove.


Regarding "up to date guides" - pretty sure nothing has changed since forever, so pretty much any guide should be good.


I was thinking about some kind of threading


Yeah, threading will make it longer.


This should work, but it's of the same exact length: (.. luxon/DateTime now toIsoDate).


That’s the issue with the guides. I’ve opened the first link from google search clojurescript js interop and checked “Function invocation” section. It mentions the invocation like this (. js/document hasFocus) but not like this (js/document.hasFocus) So I wonder if there is a complete guide…


None that I have found that I imagine match what you’re looking for (because I remember wanting the same things as well when I started!). However, I did find that is more helpful than it would initially seem because the concepts carry over to ClojureScript.


This page is linked by the official CLJS website: It's only a cheatsheet so it doesn't go into the details, but a.b kind of access is there. Note that such kind of field access is "unofficial" (probably why it's usually not mentioned in all sorts of guides) but it's working and will continue to work.


Regarding Java interop - not all the concepts carry over unfortunately. In fact, when using interop to its fullest, in terms of differing lines of code there will be more differences than commonalities, just because of all #js and ^js. But depends on the project and the task at hand, of course.


This one is pretty good and thorough: but it also doesn't mention js/document.hasFocus as a possible way either I don't think


Thank you, @U9J50BY4C. At least it mentions the new constructor dot syntax like (def date (js/Date.))


@U050B88UR are there any official docs for the js interop?


I wrote up things about interop I didnt find sufficient docs for


That Jira link should now be since the URL format seems to have changed.

👍 1