This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-22
Channels
- # admin-announcements (29)
- # aws (2)
- # beginners (25)
- # boot (110)
- # business (15)
- # cider (39)
- # cljs-dev (3)
- # clojure (90)
- # clojure-czech (28)
- # clojure-hamburg (1)
- # clojure-japan (24)
- # clojure-poland (149)
- # clojure-russia (46)
- # clojure-sg (9)
- # clojure-uk (6)
- # clojure-ukraine (1)
- # clojurescript (105)
- # core-async (37)
- # cursive (9)
- # dato (7)
- # datomic (6)
- # emacs (10)
- # events (1)
- # hoplon (22)
- # jobs (4)
- # ldnclj (38)
- # leiningen (4)
- # off-topic (17)
- # om (173)
- # onyx (134)
- # re-frame (46)
- # reagent (35)
hi @alandipert, here’s how to reproduce a simple example to show reload not working for dependent namespaces:
then edit src/index.cljs.hl to look like:
(page “index.html”
(:require [some.other :refer [thing]]))
(html
(body
(thing)))
then run
boot dev
and after loading the page in a browser, change the some.other/thing to return (h1 “somethingelse”)
what i see is that boot recompiles everything, the little cljs bauble pops up in the bottom corner of the browser page to indicate that reload has happened, but the dom content on the page does not change
i noticed when i only make changes to the thing
defelem in the some.other
namespace, the js console reports that index.html.out/some/other.js
is reloaded, but the web page content does not change. it looks like what is happening is that the definition of the thing
elem is updated, but since the top level index.html.out/hoplon/app_pages/_index_DOT_html.js
where it is used is not updated, the dom content is not changed.
while this may make sense, this isn’t what i want - is there a way to have the top level page content be updated when dependencies change in other namespaces?
@esp1: you can use the with-page-load
macro to trigger some action when things are reloaded
i was looking at the on-jsload option on the boot-reload task, but i couldn’t figure out what entrypoint to use to reload the hoplon page. calling js directly works tho
you can use the local-storage
function (https://github.com/hoplon/hoplon/blob/master/src/hoplon/storage_atom.cljs#L40-L42) to preserve state between reloads
so like if you have a cell that holds some local stat like if you're filling out a form or drilling down in menus or something