Fork me on GitHub
#shadow-cljs
<
2018-04-22
>
Alex H06:04:16

@thheller whatever that did, it doesn't work anymore

Alex H06:04:02

onlyIn doesn't appear in externs.shadow.js anymore, and the generated code is mangled incorrectly, as before

shakdwipeea07:04:11

Hi guys, I am using https://github.com/jgdavey/boot-shadow-cljs to compile cljs in a boot task. The compilation is fine and the files are written but they are not being picked up by server. To expand, I am using a ring server with site-defaults which is able to serve other resources but not the js files generated in the task.| The build config https://github.com/jgdavey/boot-shadow-cljs/blob/master/src/com/joshuadavey/boot_shadow_cljs.clj#L88 produced in the task is

{:target :browser, :output-dir /home/akash/.boot/cache/tmp/home/akash/workspace/voidwalker/gw3/-fmvxaj/resources/public/js, :asset-path /js, :compiler-options {:optimizations :simple}, :modules {:app {:entries [voidwalker.source.app]}}, :id :app, :build-id :app, :cache-root /home/akash/.boot/cache/cache/project/home/akash/workspace/voidwalker/com.joshuadavey.boot-shadow-cljs/cache}
When accessing the file.. I get response map is nil. My shadow-cljs.edn
{:source-paths ["src/cljs"]

 :nrepl {:port 55000}
 :http {:port 9070
        :host "0.0.0.0"}


 :dependencies [[reagent "0.8.0-alpha2"]
                [reagi "0.10.1"]
                [funcool/bide "1.6.0"]
                [cljs-ajax "0.6.0"]
                [proto-repl "0.3.1"]
                [day8.re-frame/http-fx "0.1.3"]
                [hickory "0.7.1"]
                [re-frame "0.10.5"]
                [cider/cider-nrepl "0.17.0-SNAPSHOT"]
                [refactor-nrepl "2.4.0-SNAPSHOT"]]

 :builds {:app {:target :browser
                :output-dir "resources/public/js"
                :asset-path "/js"
                :compiler-options {:optimizations :simple}
                :modules
                {:app
                  {:entries [voidwalker.source.app]}}}}}
What should I look into?

shakdwipeea07:04:28

Got it ... the fix was to set output-dir to public/js since that is what is served. :man-facepalming:

thheller08:04:26

@alex340 sorry shouldn't write code when tired. should be fixed in master.

Alex H10:04:01

@thheller yep, that seemed to work

gnl22:04:22

When hot-reloading a namespace with shadow-cljs, vars which have been removed from the code remain defined (similar to sending the whole thing to the REPL). When hot-reloading with figwheel they are removed. Can I get that behaviour with shadow-cljs?

gnl22:04:40

For example if I have a test defined in a namespace with deftest and remove or rename it, the old version's still there and gets executed with (run-tests).

thheller20:04:19

this should be fixed as of [email protected]