Fork me on GitHub
#shadow-cljs
<
2018-11-02
>
vehas07:11:14

hi, guy, thanks for the fantastic tool,where is the location that I can set binaryaga/devtool confighttps://github.com/binaryage/cljs-devtools/blob/master/docs/configuration.md#configuration-via-compiler-optionsfor project.clj they use :external-config { :devtools/config { :features-to-install [:formatters :hints] :fn-symbol "F" :print-config-overrides true}}

thheller07:11:38

@vehas :compiler-options {:external-config {:devtools/config ...}}} should do it

vehas08:11:44

@thheller thanks, it's work. should put it somewhere in doc, I try to search for : external-config and can not get any explanation

thheller09:11:00

well its not a thing in CLJS itself. it was basically invented by cljs-devtools I think

hlolli13:11:52

was there any lein ancient-ish plugin for shadow-cljs for deps?

ClashTheBunny13:11:28

You can use yarn update-interactive to update your javascript dependencies.

ClashTheBunny13:11:13

You can also use depot with deps.edn or lein-ancient with project.clj, depending on how you encode your dependencies.

ClashTheBunny13:11:55

But I think we're all waiting for you to make it for shadow! 🙂

hlolli13:11:53

I use ncu all the time for package.json, the clojure deps tend to update way slower than npm 🙂 well, I could do it, at minimum I hope I planted seeds 😛

hlolli13:11:39

better solution if this wasn't a plugin but a part of shadow-cljs itself

thheller14:11:45

there is nothing like that available for shadow-cljs currently no

lsnape17:11:15

Hi, I have a shadow flush build hook that generates static html and css files and writes them to a public directory. I would like the Clojure functions that render the static files to be reloaded on file change, so that implementation changes are picked up and I see the updated html/css on my page. Is there a convenient way to do this in shadow?

lsnape17:11:14

Presumably I can do this using the reloaded workflow within clj-run, and calling watch and server within this task? Maybe there's another way?

tony.kay17:11:50

@thheller I’m getting a strange error that I don’t understand related to macro output. I’ve expanded the macro and when I put that in the file it is fine, but when I use the macro I get an exception in core, but the stack trace doesn’t get me anywhere.

IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword
        clojure.lang.RT.seqFrom (RT.java:550)
        clojure.lang.RT.seq (RT.java:530)
        clojure.core/seq--5124 (core.clj:137)
        clojure.core.protocols/seq-reduce (protocols.clj:24)
        clojure.core.protocols/fn--7829 (protocols.clj:75)
        clojure.core.protocols/fn--7829 (protocols.clj:75)
        clojure.core.protocols/fn--7781/G--7776--7794 (protocols.clj:13)
        clojure.core/reduce (core.clj:6748)

tony.kay18:11:37

any hints on how I can get more info from the compiler about what it is working on/seeing?

lilactown18:11:51

:thinking_face: this looks like an error at macro-time

lilactown18:11:57

I’ve had better luck getting meaningful errors by evaluating the namespace the macro lives in in a CLJ REPL, then I have relying on shadow-cljs to report the correct error

tony.kay18:11:51

it macro expands perfectly in clj

tony.kay19:11:11

the lastest shadow-cljs shows a more complete stack trace, and that pointed out where the problem was

🎉 1
tony.kay19:11:26

Bizzarre…I found the problem, but I honestly don’t understand it

tony.kay19:11:59

but I don’t believe it is a shadow problem…the bigger stack trace has gotten me unstuck

lilactown19:11:07

what is the issue?

tony.kay19:11:45

I found it…my macro was emitting a cons, and the other macro was spec checking it to be a list?

tony.kay19:11:08

never would have found that without a better stack trace…

thheller20:11:50

@tony.kay yeah shortening stacktraces has been a mistake throughout

thheller20:11:04

@lsnape there is no built-in support for reloading non build-related CLJ code. I typically recommend developing that in a REPL and just using the usual load-file from the REPL to reload the code manually

souenzzo23:11:16

I want to configure 2 cljs builds: one with dev and src, with "base" deps + "devcards" dep one just with src, with "base" deps. How can I write it in shadow-cljs.edn?

lilactown23:11:53

@souenzzo you can only have one set of source-paths

souenzzo23:11:06

Can/should I create many shadow-cljs.edn files?

lilactown23:11:09

the way you would do it is in the module you create for your dev build, you'll require the base and devcards namespaces

lilactown23:11:35

in the entrypoint of the module for just the app, you'll require just the base

lilactown23:11:45

when you compile the code for a given build, shadow-cljs only includes the code that you refer to via :require in your namespaces