Fork me on GitHub
#shadow-cljs
<
2023-11-26
>
ribelo09:11:37

has anyone managed to get the new version of storybook working with shadow-cljs?

ribelo09:11:08

we want to write stories in JavaScript, so we're trying to use ESM as the target for stories and generally, it seems to be working

ribelo09:11:40

however, if not use

:js-options {:js-provider :import}
react seems to be imported multiple times, which causes the hooks not to work

ribelo09:11:34

but If we use it, there is a problem with goog.dom and we receive an error: the property "DOM" is not extensible or something like this

thheller09:11:41

feel free to make a repro showing the exact problems. I really cannot guess from vague descriptions. I have not looked at storybook in many years, so no clue what might have changed

ribelo09:11:32

sure, I understand, I'll make a repo, but maybe someone else who has encountered a similar issue and resolved it in a seemingly magical way will reach out..

Mateusz Mazurczak15:11:56

A little bit unrelated, but you may also take a look to portfolio, it's clojure made storybook like tooling

👍 1
stephenmhopper19:11:00

I'm working on migrating an existing CLJS project to use shadow-cljs. It looks like the user guide hasn't been updated for 15 months. Why?

mkvlr19:11:57

why should it have being updated? What are you missing?

stephenmhopper19:11:25

I'm new to shadow-cljs, so I'm not sure. But the top of the guide has this: Thomas Heller and Tony KayVersion 1.0,Jan 10, 2018 and the bottom has this:

Version 1.0
Last updated 2022-08-05 09:27:21 CEST 
Everything else indicates that the project is actively being maintained though, I'm just curious why the docs allegedly haven't been updated for 15 months.

thheller20:11:39

it all still applies, no changes made that would require rewriting anything

👍 1
nikolavojicic09:11:51

Welcome to Clojure 😄

😂 3
wevrem21:11:40

I saved a single file in my project, and got this:

[:app] Compiling ...
[:app] Build completed. (351 files, 7 compiled, 0 warnings, 0.36s)
[:app] Compiling ...
[:app] Build completed. (351 files, 7 compiled, 0 warnings, 0.38s)
[:app] Compiling ...
[:app] Build completed. (351 files, 7 compiled, 0 warnings, 0.51s)
[:app] Compiling ...
[:app] Build completed. (351 files, 58 compiled, 0 warnings, 3.12s)
Is this typical? I think I understand why 7 files were compiled, initially, but not sure why they were re-compiled 2 more times, and then there was this monster compile of 58 files. 6 or so seconds later I’m able to safely interact with the front-end, where by “safely” I mean it won’t suddenly reset on me after an unexpected compile.

thheller06:11:49

this is usually an indication that something is touching source files after you yourself make changes

thheller06:11:58

are you on macos by chance? this seems to happen if you the project files are getting synced to icloud for example.

thheller06:11:40

could also be your editor, running things on save, e.g. linters

thheller06:11:53

could also be some other processing watching the source files and doing stuff on save

thheller06:11:08

the cause usually is outside of shadow-cljs, so look there first

wevrem14:11:15

I’ll see what I can figure out. The only thing you mentioned that applies in this case is icloud.

wevrem14:11:47

I moved the project file outside the purview of iCloud and it seems to behave. I went and read that discussion and it seemed to be exactly the same thing I was experiencing, and the same solution as what I tried (moving outside iCloud). I think I’ll keep my project outside of iCloud for the time being and see how things go.