Fork me on GitHub
#clojurescript
<
2018-01-26
>
zalky00:01:11

Hi, does anyone know if it is possible to get the clojurescript compiler to use leading forward slashes in it's generated script tags? So document.write('<script src="js/main.out/goog/base.js"></script>'); => document.write('<script src="/js/main.out/goog/base.js"></script>');?

zalky00:01:34

I'm trying to work through some edge cases with client-side routing, and this would appear to be a potentially simple solution to those problems.

rauh06:01:26

@zalky Just set :asset-path

zalky06:01:14

@rauh, wow. Much obliged.

rauh06:01:26

@zalky Btw, did you not get a warning in the console? The script that's generated by CLJS compiler should print a warning suggesting to set :asset-path.

zalky06:01:50

@rauh: I had :asset-path set, I just didn't have the forward slash.

rauh06:01:10

@zalky I mean, if goog/base fails to load, there should be a console.warn about 2-3 lines below that 404 that you get with a suggestion to change :asset-path. We have code for that.

zalky06:01:27

@rauh: Ah, yeah I see it now, the warning is there, it was just swamped by a bunch of 404s, so I missed it. Thanks again for the pointer.

rauh06:01:39

Oh ok, maybe it should be an alert("..") 🙂

zalky06:01:28

A tried and true UX 😛

tomaas09:01:47

hi, $('thead th:nth-child(1)') how can I rewrite this in plain js/clojurescript?

thheller09:01:51

@tomaas without jquery (array-seq (js/document.querySelectorAll "thead th:nth-child(1)"))

thheller09:01:34

array-seq makes it a bit easier to work with via the usual clojure fns like map or doseq

thheller09:01:13

js/document.querySelector also works if you only expect one result

drcode12:01:48

Hi, we've released a new Clojure/Clojurescript web framework today called qlkit: https://medium.com/@conrad_9565/lets-build-a-ui-with-qlkit-and-graph-queries-79b7b118ddac It's based on graph queries and inspired by Om Next

drcode12:01:24

also stop by #qlkit

jamitter17:01:57

Has anyone worked with the cljsjs paho mqtt library?

ag19:01:27

has anyone ever build a lib in cljs to be consumed from vanilla .js?. webpack and whatnot?