Fork me on GitHub
#shadow-cljs
<
2018-11-26
>
souenzzo02:11:57

I'm using shadow-cljs with this settings but: - I get No app connected. in Fulcro Inspect tab on console - after-load dont call cljs.user/on-jsload after load https://github.com/souenzzo/my-next-stack/blob/feature/shadow-cljs-wip/shadow-cljs.edn

thheller09:11:28

@souenzzo why are you source files all over the place? kinda hard to tell whats going on

😂 4
souenzzo11:11:17

I always use project like this. is it a bad pattern?

thheller09:11:33

how did you start the app?

thheller09:11:16

I'm guessing that you started the shadow-cljs server instance without having the webdev profile active?

thheller09:11:51

cljs/user.cljs then instead uses the default which doesn't have the after-load hook

souenzzo12:11:40

I'm using webdev profile user.cljs is loaded on browser and when I call cljs.user.on_jsload() on js console it works as expected....

miridius10:11:54

Hi @thheller I'm getting a strange error during optimizations java.lang.NoSuchMethodError: com.google.javascript.jscomp.AbstractCompiler.getInputsInOrder()Ljava/lang/Iterable when releasing (even if optimization is just set to :whitespace), I've tried using --debug and -v but couldn't find any clues.

thheller10:11:27

that happens when an incompatible closure-compiler version is used

thheller10:11:49

check lein deps :tree

thheller10:11:02

you'll probably see a complaint about closure-compiler-unshaded

thheller10:11:47

can just add [com.google.javascript/closure-compiler-unshaded "v20180910"] to your :dependencies

thheller10:11:59

that should take care of it but you may need to bump it manually in the future

thheller10:11:05

since closure updates about once a month

heyarne10:11:24

hmm... i'm receiving some warnings that with the latest shadow-cljs 2.7 that i don't receive with the latest 2.6. what does that mean? why does it resolve things differently?

thheller10:11:22

@arne-clojurians it doesn't resolve things differently. it just checks some extra things it didn't previously check.

thheller10:11:40

the bug was always there just nobody noticed

heyarne11:11:24

ah cool. good to know!

souenzzo12:11:40

I'm using webdev profile user.cljs is loaded on browser and when I call cljs.user.on_jsload() on js console it works as expected....

achikin14:11:50

I want to disable println for release code like this (set! *print-fn* (fn [& _])). What is the best way to achieve this in shadow-cljs? In lein-cljsbuild I've included different paths to :source-paths which contained cljs files with build-specific commands.

achikin15:11:03

@thheller can I have different :source-paths for release and dev or is there any other way to inject different code for dev/release?

thheller15:11:58

you can just do (when-not ^boolean js/goog.DEBUG (set! *print-fn* (fn [& _])))

👍 4
thheller15:11:25

that'll only silence the prints in release

👍 4
achikin14:11:11

I also have a question regarding build report https://shadow-cljs.github.io/docs/UsersGuide.html#_build_report . Will it build AND generate a report or it will only generate a report on an existing build?

thheller15:11:00

@achikin not sure I understand the question. it will compile everything to generate the report but it will not do a full build. if that makes sense 😛

achikin15:11:37

That makes a lot of sense, thank you 🙂

achikin15:11:53

I want to generate the report as a part of a CI pipeline.

thheller15:11:38

yeah its a separate step from release as it modifies the build to ensure it can generate all the info it needs

thheller15:11:51

it requires source maps for example which release builds don't have enabled by default

thheller15:11:05

@souenzzo oops I forgot that all cljs.* files are not checked for reload metadata because I assumed they would never have any

👍 4
thheller15:11:30

so it doesn't ever check cljs.user. probably best to just pick another name

rschmukler18:11:20

Hey all! Does shadow-cljs provide any way to access assets sometimes packaged with NPM (eg. CSS files)? If not, does anyone have any advice beyond requiring the stylesheet directly via a link tag to the node_modules?

lilactown18:11:08

you should probably move the CSS out of node_modules, though

thheller19:11:52

@rschmukler not currently no. I use the node-sass cli and just a main.scss which directly @import "node_modules/foo/bar.scss";

thheller19:11:01

or just copy them all manually

rschmukler19:11:30

Alright, thanks for the quick responses! I just ended up vendoring the file directly and included it via a link element. We're using garden or I'd probably do the import route via sass