shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
2021-04-28T05:02:03.049700Z

Is there a quicker way to get a react-native app to try to reconnect to the shadow-cljs server after it lost that connection (for example wifi reconnect) than re-starting the app with react-native run-android ?

2021-04-28T06:28:13.053800Z

hi. is there a way to depend on a cljs library which depends on npm libs, but tell shadow to not include the npm source in the build? or to put it another way, put :exclusions on npm-deps ? I see the bit about cdn and resolve-global here: https://shadow-cljs.github.io/docs/UsersGuide.html#js-resolve-global which would be handy if I could do the exclusions

thheller 2021-04-28T06:35:58.054500Z

@henryw374 :js-options {:resolve {"npm-dep" false}} will "ignore" the dependency but fail if you actually attempt to use it in the code

thheller 2021-04-28T06:37:01.055600Z

:npm-deps {:install false} in the shadow-cljs.edn root will not attempt to install npm-deps from deps.cljs at all, there are no specific exclusions otherwise

2021-04-28T07:42:26.055700Z

Awesome! thanks @thheller

Aron 2021-04-28T17:36:48.057200Z

I have a weird error that does this https://imgur.com/a/AuzL5iy and I am not sure how I could go about finding out where it is coming from.

Aron 2021-04-28T17:36:52.057500Z

It's in development

thheller 2021-04-28T17:50:42.058100Z

@ashnur looks like trying to print a self-referential structure of some kind. an atom that contains itself or so

Aron 2021-04-28T17:52:04.058600Z

can I assume it has to be a prn? I don't use anything else that prints in my own code

thheller 2021-04-28T17:53:11.059200Z

could also be a str call, but more likely prn or pr-str yes

Aron 2021-04-28T17:54:26.059800Z

I have much much more str than prn 🙂 Thanks, I should be able to find it

Aron 2021-04-28T19:43:36.061500Z

Probably not prn, because I have them all commented out. It's particularly bad because I can't consistently reproduce it, it always appears when I least expect it. I am writing here because when it happens, the first sign is that shadow-cljs notification appears saying "reconnecting".

thheller 2021-04-28T19:45:51.063100Z

I don't have the slightest clue what you are actually doing so I can't really comment. only you know how your data is structured and where it is sent. might not be your code, might be some library you use that tries to send data as EDN

Aron 2021-04-28T19:46:45.064100Z

fair, I didn't expect miracles, only if you or others saw something similar then I might've been lucky : )

Aron 2021-04-28T19:47:23.064500Z

I am betting on some react issue

thheller 2021-04-28T19:48:30.064900Z

(def x (atom {:x nil})) -> (swap! x assoc :x x) ->

The result object failed to print. It is available via *1 if you want to interact with it.
The exception was:
RangeError: Maximum call stack size exceeded
:repl/print-error!

thheller 2021-04-28T19:49:02.065500Z

fairly simple to replicate the issue from the REPL, just gotta find it. might just be a missing deref somewhere

Aron 2021-04-28T19:50:16.066Z

I don't have any atoms :-S

thheller 2021-04-28T20:10:56.067Z

doesn't have to be an atom, just an example. ANY structure that can reference itself will have this issue

thheller 2021-04-28T20:11:28.067200Z

(def x #js {:x nil})
#'cljs.user/x
cljs.user=> x
#js {:x nil}
cljs.user=> (set! (.-x x) x)
The result object failed to print. It is available via *1 if you want to interact with it.
The exception was:
RangeError: Maximum call stack size exceeded
:repl/print-error!

Aron 2021-04-28T20:52:26.068400Z

Thanks for the elaboration on that, I am familiar with the js version of this (e.g. when json fails for circular references), with this knowledge I will be able to find it for sure.