shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
russell 2021-06-28T01:48:05.299300Z

Is there a good way to start the shadow-cljs server with configuration specified programmatically? i.e. with a function which returns data of the same shape as shadow-cljs.edn, without such a file being consulted? Context is that I want to manipulate the relative filesystem paths (the node_modules and the outputs) to interoperate with a build process, while keeping the "normal" paths for use from the repl. So various other things such as middlewares or alternative paths to load the config from, would also help me out. thanks!

awb99 2021-06-28T04:41:43.299900Z

stupid question: shadow-cljs has many graal dependencies. why is this so?

thheller 2021-06-28T05:55:34.301800Z

@russell I don't understand what you are trying to do. everything is built around shadow-cljs.edn so many things expect it. things will still function without it but you'll lose features. do you have an example config you'd like to generate compared to a normal one?

thheller 2021-06-28T05:56:04.302400Z

@hoertlehner jdk15 removed the nashorn js engine. the graal-js engine is used instead now.

thheller 2021-06-28T05:58:03.303800Z

@pavel.klavik chrome never touches your filesystem directly. it'll load the file over http so it is more likely to be that server. pretty much impossible to be chrome. if its anything it is an OS level issue. so either multiple processes trying to write to the filesystem, or that FS otherwise locking or so. or maybe two separate builds writing to the same :output-dir (at the same time again)?

👍 1
thheller 2021-06-29T18:58:24.323900Z

it might. not sure. does the issue appear when that server is not running?

2021-07-01T21:04:48.377600Z

Not sure, haven't happened since the last time. I will do further debugging when I discover it again. Thanks for tips.

awb99 2021-06-28T06:27:34.304500Z

thanks @thheller this is for node deployments? or for what is it used?

thheller 2021-06-28T06:35:52.305200Z

not for node no. one tiny script uses it to compare npm versions since I couldn't find an implementation in java/clojure

thheller 2021-06-28T06:36:10.305700Z

I'll very likely completely remove that at some point though. just can't be bothered to implement it myself.

awb99 2021-06-29T06:21:10.318300Z

crazy that there are no semver tools for clojure. To bring a huge tail of graal dependencies just to check semver is indeed crazy. But on the other hand I do like the log entries about npm versions.

thheller 2021-06-29T07:00:33.321200Z

well "huge tail of graal" is a bit extreme? I do not consider this "huge"?

[org.graalvm.js/js-scriptengine "21.1.0"]
 [org.graalvm.js/js "21.1.0"]
   [com.ibm.icu/icu4j "68.2"]
   [org.graalvm.regex/regex "21.1.0"]
   [org.graalvm.sdk/graal-sdk "21.1.0"]
   [org.graalvm.truffle/truffle-api "21.1.0"]

thheller 2021-06-29T07:01:06.321400Z

but I had other plans with the JS engine initially

thheller 2021-06-29T07:01:34.321600Z

but I'll probably stick with node, so ultimately the graal stuff might be going away. just didn't have time to work on it yet

awb99 2021-06-30T05:12:03.336200Z

this dependencies bring a lot of other dependencies. but it is not oly that, it is also the fact that graal stuff is not very stable in terms of the library ecosystems, so when clojure world has coflicts, then it is related to the graal libraries.

thheller 2021-06-30T05:18:44.336400Z

I always suggest keeping CLJS dependencies separate from CLJ for that reason. I never had a single problem with dependencies that way. If you choose to combine them it is your problem dealing with the conflicts 😛

awb99 2021-06-30T05:23:00.340200Z

yes, but I am delivering shadow as part of my project, because my users need to be able to compile stuff on the fly.

thheller 2021-06-30T05:25:56.341200Z

I said this many times before. shadow-cljs is NOT designed to be embedded in other systems and should NOT be used as such. it is designed as a standalone tool, so embedded concerns don't have a high priority right now

thheller 2021-06-30T05:29:34.341600Z

but I'm not much a fan of the graal stuff either, just had to do it quickly to stay compatible with jdk15+ without loosing features

thheller 2021-06-30T05:29:56.341800Z

but I'm ok with loosing this particular feature at some point. or rebuilding it on top of node

awb99 2021-06-30T05:59:11.342Z

I switched to deps.edn away from lein for thst reason. now with deps.edn it works pretty stable.

Gleb Posobin 2021-06-28T14:04:50.311500Z

Is there a way to make the "compilation failed" notice not take up the whole screen? I am working on an extension and when I make a mistake in the content script, every tab shows this notice and it blocks off all the contents on the pages.

murtaza52 2021-06-28T15:35:37.312400Z

hi, is there a verbose option when starting a build with shadow-cljs ?

murtaza52 2021-06-30T07:10:07.342200Z

thanks guys

💯 1
lispers-anonymous 2021-06-28T15:37:21.312500Z

there is a --verbose flag mentioned in the documentation

thheller 2021-06-28T18:45:26.312700Z

The web UI is verbose by default, otherwise shadow-cljs watch app --verbose