Fork me on GitHub
#shadow-cljs
<
2021-06-28
>
russell01:06:05

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!

awb9904:06:43

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

thheller05:06:34

@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?

thheller05:06:04

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

thheller05:06:03

@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)?

👍 2
Pavel Klavík17:06:10

Makes sense. We are serving the resource directory (containing compiled output from Shadow-cljs) using the standard ring.middleware.resource via ring.middleware.defaults. Can this be blocking the file resource?

thheller18:06:24

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

Pavel Klavík21:07:48

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

awb9906:06:34

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

thheller06:06:52

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

thheller06:06:10

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

awb9906:06:10

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.

thheller07:06:33

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"]

thheller07:06:06

but I had other plans with the JS engine initially

thheller07:06:34

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

awb9905:06:03

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.

thheller05:06:44

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 😛

awb9905:06:00

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

thheller05:06:56

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

thheller05:06:34

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

thheller05:06:56

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

awb9905:06:11

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

Gleb Posobin14:06:50

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.

murtaza5215:06:37

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

lispers-anonymous15:06:21

there is a --verbose flag mentioned in the documentation

thheller18:06:26

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

murtaza5207:06:07

thanks guys

💯 2