Fork me on GitHub
#hoplon
<
2017-03-28
>
jumblerg16:03:47

@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.

jumblerg16:03:03

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

jumblerg16:03:02

good to know we have a vi emoji

alandipert16:03:52

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

jumblerg16:03:13

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

jumblerg16:03:55

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

chromalchemy22:03:05

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.

chromalchemy22:03:26

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.

chromalchemy22:03:15

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?

chromalchemy22:03:42

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"]

chromalchemy22:03:19

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}{0.0.0.0:8000}
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.

chromalchemy22:03:43

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().

chromalchemy22:03:42

Here's a test repo if anyone wants to confirm behavior on local machine https://github.com/ryolyo/hoplon-reload-test

chromalchemy23:03:09

update: I reverted Hoplon UI back to this commit https://github.com/hoplon/ui/commit/cddc83fe0893f9e198e7715ec7fc773deaa95dcb 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..?

chromalchemy23:03:21

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?)