Fork me on GitHub

@wilkerlucio typically I'd say this is due to the charset of the page. <meta charset="UTF-8"> typically fixes it for the browser. not sure about chrome extension though.


@wilkerlucio there seems to a be a long history related to this. in short CLJS will emit console.log("\u25B6\u2764\u25C0"); which works fine without setting a charset. Closure will optimize and turn that into console.log("▶❤◀"); however which then fails to load properly without a specified charset. see


apparently the default charset is the problem here. if you set :compiler-options {:closure-output-charset "US-ASCII"} it will keep the same escaped sequence that CLJS emits and the problem goes away


wonder if you can set the default charset for chrome, seems weird that it doesn't load UTF-8 properly by default


oh right. chrome does the right thing for the extension. the browser seems to require a charset though


hmm. i’m playing around with a bootstrapped build, wondering about how one might get a watch build to send updates to the browser. Seems a two-part problem; first, figuring out how to get (require 'the-ns :reload) to work (currently I have to dissoc a namespace from :cljs.analyzer/namespaces before it will do anything), maybe modifying shadow.cljs.bootstrap.browser/load-namespaces to accept a :reload parameter, and second - any idea how a client could be notified when namespaces in a bootstrapped build are modified? i would guess one just wants a callback to be fired, maybe w/ a list of changed namespaces, as there is no way for shadow to know anything about what’s going on with compiler states in the browser


@thheller thanks! I'll try that out


@mhuebert you are talking about the bootstrap support build notifying the host build correct?


not sure how to do that given the complexity of self-host itself


sending a websocket message to the host build is easy enough


but getting it to the right place might be tough


I would think the host build would need to do the work of putting it in the right place


yeah but currently there is no way for you to "hook" into anything the devtools client is doing


its complex enough as it is so I don't want to introduce another layer that might cause problems


how does the self-host part deal with :reload?


it should be able to just load other content right?


yes. the only nit there is the first problem i mentioned above - i am not sure exactly where to fix it - that i have to dissoc the ns from the compiler-state before load-namespaces will reload it


but when i do that, it all works


the only thing i am missing is some way of knowing that a ns has changed


it would probably be best if you implemented your own shadow.cljs.bootstrap.browser. I implemented that as a proof of concept but what you are asking goes way beyond what I planned for it


I don’t think that part will be so hard on my side.


i am already running the watch build from a script via clj-run, maybe there is a way i can make a little hack to listen in for when shadow has recompiled things in my bootstrap build?


gotta get dinner, bbl


I do have plans for a generic API endpoint I want to build the UI on-top of. this would expose such data but thats pretty much in planning stages


did a few tests for graph queries using pathom but thats about it


since you'd probably need a websocket for subscription-ish things that is even further from existing


I guess you could build you own http server that you then connect a websocket to and notify whenever a compile finishes


$ shadow-cljs compile em-admin
shadow-cljs - config: /Users/grav/repo/eddie-michel/em-poc/shadow-cljs.edn  cli version: 2.3.23  node: v8.6.0
shadow-cljs - running: lein run -m shadow.cljs.devtools.cli --npm compile em-admin
Exception in thread "main" java.lang.RuntimeException: No such var: module-graph/validate-inputs, compiling:(shadow/build/cljs_closure.clj:931:3)
	at clojure.lang.Compiler.analyze(
What to do?


I’m using :lein true in my shadow-cljs.edn, and I’ve added [thheller/shadow-cljs "2.3.23"] to the deps in my project.clj


ah, needed to upgrade clojurescript dep to newest 1.10.238.


Hmm … cannot seem to get namespaces with dash (`-`) to work. For instance, a namespace, my-package.namespace I would assume maps to my_package.namespace, but that ends up being undefined. Works if I remove the dash from the namespace and use e.g. mypackage.namespace


@thheller so to know what to send the client, I could do something like this -

(def proc (watch))

 (def output-chan
   (let [c (chan)]
     (tap (:output-mult proc) c)

 (defn bootstrap-compiled-sources [{:keys [type build-config info]}]
   (when (and (= :build-complete type)
              (= :bootstrap (:target build-config)))
     (:compiled info)))

 (def bootstrap-loop
   (go-loop []
     (let [evt (<! output-chan)]
       (some-> (bootstrap-compiled-sources evt)