Fork me on GitHub

@alandipert, @mynomoto: ha! slack's gc issues locked up my machine last night, and i had no way to tell which program had focus while i was trying to save off my work.


didn't realize i had done this until i reopened it just now.


good to know we have a vi emoji


@thedavidmeister i think you want (hoplon :bust-cache true)


@alandipert, @micha : was going through the javelin source this am, maybe the converging/diverging lens patterns could be called concave/convex lenses? 🙂


i think that metaphor's helpful for reasoning about them too.


I am having a problem with boot-reload working. I if I change something in my index.cljs.hl file, everything reloads and renders properly in the browser on save. But if I change something in a namespace required by the index.cljs.hl, and save, all I get in the browser is a flash of the cljs HUD icon, but no messages in the console, and no updated rendering of the changed values. The updated values in the referenced namespace will render again if I change and save index.html again as above. This was the behavior I experienced working in (vanilla) Hoplon a while back. So I just started keeping everything in one big file. But when I started using UI, falues and functions called through the namespace stared working in the reactive/reloadable way, and I was able to split up my code into files/folders Now this has suddenly stopped working for me in UI too, totally breaking my workflow and stopping me in my tracks 😞 I've tried to get a simple test case working. Started with Hoplon template. Page would render initailly, but reload failed with a bunch of java concurrency "file is in use by another process.." type errors in the stack trace. Moved (serve) task to boot-http (serve :reload :true), and reload started working, on index.cljs.hl, but not on required namespace, as described above. Added Hoplon UI and (window (elem)) structure. Same deal: Index rendering and reloading dynamically, but not called namespaced values or fns.


I am on windows, and have been trying to troubleshoot on that side. Been through a bunch of restarts etc. but the fact that it was working leads me to believe it is not necessarily a windows issue.


Am I missing something simple about how to configure boot-reload to render all the files to the browser, not just one file out of context?


testing deps

[adzerk/boot-cljs          "1.7.48-5"]
      ; [adzerk/boot-reload        "0.5.1"]
      [adzerk/boot-reload        "0.4.13"]
      [hoplon/hoplon             "6.0.0-alpha17"]
      [org.clojure/clojure       "1.8.0"]
      [org.clojure/clojurescript "1.9.494"]
      [pandeiro/boot-http        "0.7.6"]
      [org.clojure/tools.nrepl "0.2.12"]
      [hoplon/ui "0.2.1-SNAPSHOT"]


Heres my terminal output

$ boot dev
Starting reload server on 
Writing adzerk/boot_reload/init3477.cljs to connect to ...

Starting file watcher (CTRL-C to quit)...

Writing HTML files...
ò index.html
Adding :require adzerk.boot-reload.init3477 to index.html.cljs.edn...
Compiling ClojureScript...
ò index.html.js
2017-03-28 18:25:47.998:INFO::clojure-agent-send-off-pool-0: Logging initialized @53049ms
2017-03-28 18:25:48.118:INFO:oejs.Server:clojure-agent-send-off-pool-0: jetty-9.2.10.v20150310
2017-03-28 18:25:48.172:INFO:oejs.ServerConnector:clojure-agent-send-off-pool-0: Started ServerConnector@51389308{HTTP/1.1}{}
2017-03-28 18:25:48.174:INFO:oejs.Server:clojure-agent-send-off-pool-0: Started @53226ms
Started Jetty on 
Elapsed time: 32.656 sec

Writing HTML files...
ò index.html
Adding :require adzerk.boot-reload.init3477 to index.html.cljs.edn...
Compiling ClojureScript...
ò index.html.js
Elapsed time: 1.321 sec

Compiling ClojureScript...
ò index.html.js
Elapsed time: 1.413 sec
Notice that the first reload (on saving index.cljs.hl) has the line Adding :require adzerk.boot-reload.init3477 to index.html.cljs.edn... Whereas the second reload (on saving namespace file) does not.


in my console I don't see any normal errors. But if I turn on verbose, I get a bunch of these on inital pageload.

[Violation] Parser was blocked due to document.write(<script>)
index.html.js:4 [Violation] Avoid using document.write().
index.html.js:5 [Violation] Avoid using document.write().
base.js:1172 [Violation] Avoid using document.write().
2base.js:1172 [Violation] Parser was blocked due to document.write(<script>)
base.js:1172 [Violation] Avoid using document.write().


Here's a test repo if anyone wants to confirm behavior on local machine


update: I reverted Hoplon UI back to this commit and the Reload behavior is working again, even in the namespace files 🙂 I guess the desired behavior (for me) was lost when the elem and window forms were refactored from macros to functions..?


But I still don't understand why this is not the default behavior in Hoplon without UI? How do you guys do work in in sub .cljs.hl files and have the results live-update in the browser. Am I missing something? Does everyone use .cljs files (do they work better in this case?)