Fork me on GitHub

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!


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


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


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


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


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.


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


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


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


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.


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


but I had other plans with the JS engine initially


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


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.


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 😛


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


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


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


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


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.


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


there is a --verbose flag mentioned in the documentation


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


thanks guys

💯 2