This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-13
Channels
- # adventofcode (35)
- # announcements (2)
- # arachne (1)
- # beginners (71)
- # chestnut (2)
- # cider (100)
- # cljdoc (17)
- # cljs-dev (17)
- # cljsjs (2)
- # cljsrn (2)
- # clojure (53)
- # clojure-austin (2)
- # clojure-europe (1)
- # clojure-finland (2)
- # clojure-italy (3)
- # clojure-nl (7)
- # clojure-russia (56)
- # clojure-spec (56)
- # clojure-uk (35)
- # clojurescript (58)
- # community-development (14)
- # core-async (9)
- # cursive (22)
- # data-science (5)
- # datomic (14)
- # duct (5)
- # emacs (2)
- # expound (4)
- # figwheel-main (6)
- # fulcro (23)
- # kaocha (8)
- # lumo (7)
- # off-topic (10)
- # pathom (6)
- # re-frame (17)
- # reitit (31)
- # ring (3)
- # rum (1)
- # shadow-cljs (45)
- # spacemacs (10)
- # sql (12)
- # testing (9)
- # tools-deps (130)
sure thing! 😄 the idea is that, when you change bits of your application, you need to completely re-render your application to make sure you clear out any references to the old values
The documentation is great, but there has been a lot for me to learn. I came from C++, Rust, and Erlang into Clojure back in July. I hadn’t touched the web, javascript, or Java in a really long time
I think it’s worth the effort so far. Quite an amazing ecosystem once you wrap your head around it
just for completeness: if, in the future, you want to make sure something doesn’t get reloaded, you can use defonce
instead of def
that way your application re-renders, but your state stays the same so you don’t have to click around a bunch to get back to where you were
Hi, I’m having trouble getting css-refresh to work in an electron app. I’m using the {:devtools {:watch-dir "<path>"}}
config but it’s not working. Anyone any tips?
I’ve found some more detail:
1) When I start the electron app, the css tag in index.html looks like this: <link rel="stylesheet" type="text/css" href="css/main.css">
2) Editing the css file at that point will trigger a refresh: shadow-cljs: load CSS css/main.css
.
3) The page refreshes and the css changes are reflected in the app. The dom is also modified, the css tag now looks like this: <link rel="stylesheet" type="text/css" href="css/main.css?r=0.8158209164608885">
4) New css file edits no longer trigger refreshes.
5) After manually editing the css tag using Chrome devtools to again look like it did at step 1 refreshing again works a single time.
Could this be a bug? What is the purpose of the ?r=<number?
that gets added to the css tag?
@thheller, thanks. So that part is supposed to stay 🙂. Do you have any pointers on how I could get css refresh going?
Devtools doesn’t complain at all, but it’s only reloading css once after starting the Electron app
In the console I also don’t see a message indicating that shadow-cljs is loading the css (except for that one time)
nope, only on the very first reload
Will do, thanks!
Hi @thheller I was trying to bootstrap cljs on node.js in a electron app, you suggested previously to look at browser.cljs in shadow to do that, but i have encountered an issue when i load the bootstrap files it gives error while loading the analysis cache. Can you please look at the code and see what am i doing wrong ? https://github.com/42Org/b42/blob/temp/src/app/main/bootstrap/node.cljs
(go (>! fchan data))
this should absolutely be avoided. just use (async/put! fchan data)
if all you care about is putting a value on a chan
@thheller Will try what you suggested. Also it would be great if you do look at it when you have time, i would highly appreciate that. Thanks is Advance.
is it possible to watch “release” mode instead of “dev” mode in shadow-cljs? I want to modify and test codes in a single js like an release build because of network limitation.
@hjfirst no that is not possible. set :devtools {:loader-mode :eval}
in your build config if you want to reduce the number of files loaded (still fairly large though)
https://clojureverse.org/t/improving-initial-load-time-for-browser-builds-during-development/2518
@metacritical I implemented the full node bootstrap myself. it required tweaking the node build targets a bit anyways. should now work fine in 2.7.33
.
example configs https://github.com/thheller/shadow-cljs/blob/5b01afa38dcccbc5b13bb8ff21d7179f028c5836/shadow-cljs.edn#L409-L427
example use https://github.com/thheller/shadow-cljs/blob/master/src/dev/demo/bootstrap_script.cljs