Fork me on GitHub
#re-frame
<
2019-10-18
>
pieterbreed06:10:06

Hi Guys, I'm trialling cljs for a internal tool at our company. I'm using re-frame & re-posh (datascript, re-frame style). Also using shadow-cljs if that makes a differenc. I have a situation where the app behaves incorrectly when compiled with advanced optimizations. Specifically, I tracked it down to a point where a co-fx handler (`:transact`, part of re-posh) does not run/take effect. Is this usual? Does it happen often that a cljs that "works" in a dev build mode does not work when advanced compilations are switched on? I de-tuned optimizations to simple and it seems to work, but I'm a little nervous about the stack all of a sudden. Some advice, insight, wisdom or opinions would be highly appreciated 🙂

gklijs07:10:07

It does happen, and sometimes they are tricky to fix. I had a similar thing using re-graph which was quickly fixed. It helps if you dive a little into the code. I think in the re-graph case it was the use of a key to call a method or something.

mccraigmccraig10:10:40

it happens @U2G3G2S6S ... usually because advanced compilation is munging some name you want to stay unmunged (because it’s an external dependency). have a read of the shadow manual externs section (12.2) for some things you can do to resolve the issue

pieterbreed11:10:42

wow - thank you guys for responding. I'll take a look and see if I can figure it out :thumbsup:

nfisher23:10:37

I’ve seen it happen with mixed libraries (eg js/cljs) not so much with pure cljs