This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-31
Channels
- # admin-announcements (1)
- # beginners (16)
- # boot (25)
- # braid-chat (7)
- # cider (4)
- # cljsfiddle (6)
- # cljsrn (1)
- # clojure (256)
- # clojure-austin (4)
- # clojure-ireland (1)
- # clojure-poland (15)
- # clojure-russia (80)
- # clojure-uk (2)
- # clojurescript (30)
- # core-async (14)
- # core-typed (3)
- # cursive (35)
- # datomic (1)
- # editors (28)
- # hoplon (32)
- # immutant (1)
- # jobs (8)
- # jobs-discuss (1)
- # juxt (6)
- # leiningen (8)
- # liberator (7)
- # off-topic (16)
- # om (69)
- # onyx (38)
- # re-frame (10)
- # spacemacs (1)
- # untangled (117)
Hello guys! How Do I set automatic reload to only certain pages in dev task?
At first, I was enjoying that every page reloads after I save, but now that I have more pages, it gets slower. I really am working on one at a time (plus two components pages like views.cljs.hl
and forms.cljs.hl
) so I don't need to reload everything after I save...
Thanks in advance!
And by the way, thank you for your help on prior problems. Your support gives me confidence to run hoplon in production!
@leontalbot: I have the following function running :on-jsload
in boot-reload
:
(defn refresh []
(. js/hoplon.app_pages._index_DOT_html render))
Thanks for the answer. Where do you put (defn refresh...)? If I put it in boot.build file, I get
clojure.lang.ExceptionInfo: No such namespace: js
@leontalbot: i think he meant to put that code in a .cljs
file and then pass the ns/function name to the :on-jsload
param of the reload task
Thanks @alandipert . I now find no error. But every pages seems still to be reloading when I do a change.
Compiling Hoplon pages...
• vpc_hoplon/index.cljs.hl
Adding :require adzerk.boot-reload to index.html.cljs.edn...
Compiling ClojureScript...
• coworking.html.js
• evenements-vieux-limoilou.html.js
• index.html.js
• parcs-beauport.html.js
• quartierouvert.html.js
Elapsed time: 12,136 sec
I meant, all the clojurescript is recompiling, can this be avoided?
to speed up reload time?
you could try splitting the build into separate parts depending on what you're currently working on
@dm3 no, these are all independant pages
in your experience does saving cause to reload all the cljs from the pages?
ok...
yeah I heard we should avoid multi pages and have client side routing
that's what you do?
@leontalbot: another option is a sift
task in there before hoplon
you could use it to filter out the pages you're not working on before compilation
cool! would you mind sharing an example (code)?
@leontalbot: can you paste your dev task? i can try to modify it
using my Slack IDE ™️
like this?
@leontalbot: sorry got busy w/ work stuff, i'll take a stab at this later
it may be to complex to just use the sift
task, but the idea i wanted to pursue is a deftask that filters out all the .cljs.hl
from the fileset except those specified
using boot.core/by-ext and boot.core/rm
Thanks @alandipert for looking at it when you have time 😄 I am not familiar with boot tasks... Should we just hack hoplon
task to be able to do
(hoplon :hl-files-subset #{"index.cljs.hl"})
? or there is a way to compose it with a custom task?you tell!