shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
zimablue 2021-05-17T08:06:07.322200Z

Hi, I'm using shadow-cljs version 2.12.7 with config like this :node {:target :node-library :compiler-options {:infer-externs :auto} :devtools {:repl-timeout 100000}

zimablue 2021-05-17T08:06:27.322600Z

and getting timeout errors still, the timeout seems to be ignored

thheller 2021-05-17T08:07:50.322800Z

what timeouts are you talking about?

thheller 2021-05-17T08:09:28.323300Z

:repl-timeout only controls how long shadow will wait for an result of a repl evaluation

zimablue 2021-05-17T08:11:36.323700Z

ah, It's a timeout when I'm in node-repl and I run an import statement

zimablue 2021-05-17T08:11:40.324Z

it's intermittent

zimablue 2021-05-17T08:11:48.324200Z

sorry by import I mean require

thheller 2021-05-17T08:12:53.324800Z

I'm totally in the dark here. I don't have a clue what you are talking about. Please be more specific.

zimablue 2021-05-17T08:13:04.325100Z

I'm sorry

zimablue 2021-05-17T08:13:14.325400Z

I run the command "shadow-cljs node-repl node"

zimablue 2021-05-17T08:13:23.325800Z

then I am in a repl, which works fine

thheller 2021-05-17T08:13:37.326500Z

ok, first mistake. node-repl is standalone, it is NOT controlled by any build config

zimablue 2021-05-17T08:13:41.326600Z

but some statements cause a timeout, which then stops the repl from working any more

zimablue 2021-05-17T08:13:44.326800Z

ah

zimablue 2021-05-17T08:14:22.327500Z

so how can I create a node repl using shadow-cljs which I can configure the timeouts for?

thheller 2021-05-17T08:15:22.328600Z

first explain why configuring a timeout is necessary. 30sec default is plenty and should NEVER be encountered in a node repl. Unless you compile a millions lines of CLJS via the require or so

zimablue 2021-05-17T08:18:07.330400Z

I don't know why it's necessary, sorry. I just know that it's timing out. I can try to work that out

zimablue 2021-05-17T08:18:44.331500Z

just by binary searching the imports to work out which one is heaviest? but it's slightly tough to debug because it only happens 50% of the time

thheller 2021-05-17T08:18:56.331800Z

I'm asking WHAT you are doing? Why do you think increasing the timeout is necessary?

thheller 2021-05-17T08:19:15.332600Z

I have seen no code or anything so I'm guessing ...

zimablue 2021-05-17T08:20:18.333800Z

I'm hacking on datahike, a clojurescript library, and encountering timeout errors. Because it's intermittent and something to do with compiling, working out the precise origin seemed like it would be tough so my first instinct was just to increase the timeout

thheller 2021-05-17T08:22:54.334400Z

note that getting a timeout does NOT stop the action from actually running

thheller 2021-05-17T08:23:42.335300Z

it'll just cause the REPL to no longer wait and give you another prompt

thheller 2021-05-17T08:24:30.335700Z

but yeah you are not providing enough information to offer any kind of suggestion

thheller 2021-05-17T08:24:50.336200Z

a REPL for your actual build you get via shadow-cljs cljs-repl node (assuming :node is the build id)

thheller 2021-05-17T08:25:20.336700Z

that will then also respect your timeout settings, just need to manage the node process yourself then

zimablue 2021-05-17T08:29:24.338Z

thank you, sorry for the poor information, I think that you have helped me

mauricio.szabo 2021-05-17T21:36:21.339600Z

Hi, @thheller. Once, you told me of a parameter that allows me to debug the compilation process of Shadow-CLJS. What's the parameter? The reason is that my hot-reload is taking a looong time, and I want to be able to se what's happening.

thheller 2021-05-18T07:29:38.003700Z

hot-reload or compilation? you can get more details for the compilation parts via shadow-cljs watch app --verbose

thheller 2021-05-18T07:29:45.003900Z

hot-reload itself doesn't have options

mauricio.szabo 2021-05-18T13:38:28.005800Z

All right, I'll try --verbose and see if it helps

mauricio.szabo 2021-05-17T23:17:36.001100Z

Also, is there a way to not remove deftest and friends in compilation process? I know I can use another target, but I'm doing some weird things and I want to control how to run specific tests so I'm using a target :node-script 😄

mauricio.szabo 2021-05-17T23:24:04.001500Z

(Nevermind the last question: I can use :load-tests true on :compiler-options)