This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-29
Channels
- # announcements (10)
- # aws (4)
- # babashka (42)
- # beginners (208)
- # bristol-clojurians (2)
- # calva (13)
- # chlorine-clover (52)
- # cider (5)
- # clara (22)
- # clj-kondo (2)
- # clojars (14)
- # clojure (107)
- # clojure-europe (24)
- # clojure-nl (4)
- # clojure-uk (6)
- # clojurescript (3)
- # conjure (20)
- # cursive (23)
- # datascript (2)
- # datomic (15)
- # figwheel-main (3)
- # fulcro (23)
- # jobs (3)
- # kaocha (5)
- # keechma (3)
- # local-first-clojure (1)
- # malli (13)
- # off-topic (16)
- # planck (6)
- # re-frame (8)
- # reagent (3)
- # reitit (1)
- # releases (1)
- # remote-jobs (1)
- # rum (1)
- # sci (37)
- # shadow-cljs (16)
- # tools-deps (158)
- # vim (3)
- # xtdb (8)
Well i'm stumped. I have a super simple component, optimizations make it not work. will try to slim it down to the bare essentials.
thank you my man, guess what. rum doesn't know what to do with :on-submit .... instead, example code for rum uses
#?(:cljs
(defn- textarea-keydown [callback]
(fn [e]
(if (and (== (.-keyCode e) 13) ;; enter
(not (.-shiftKey e))) ;; no shift
(do
(callback (.. e -target -value))
(set! (.. e -target -value) "")
(.preventDefault e))))))
to submit on a :textarea which it would appear solves my problem i think...good news: clojurescript is the greatest again.
543 kB 😃
Not sure if it is how I am running shadow or the cljs side. But I am getting undeclared var on macro’s when I run shadow-cljs watch app. But if I paint up a repl and connect to browser environment the macros seems to work fine.
I wrote this regarding macros https://code.thheller.com/blog/shadow-cljs/2019/10/12/clojurescript-macros.html
Don't see much in the docs about source maps other than the config option that defaults to true during development. I'm getting an exception and it's reporting line 600+ in a 200-line file. Curious if this means I have something mis-configured or it I'm not understanding when source-maps come into play. My assumption was that when an exception occurred, I could click on the link in the dev console and it would take me to the clojurescript file, not the compiled javascript file. That's not the case. Instead, when I click on the line in the exception, bitstamp.js:631
, it opens a new tab in Firefox and I get an alert that the line can't be found. I try typing in a line that I know exists and it still can't be found. In fact, the tab opens to view-source:
but it's an empty page. No code lines. Nothing.
Not sure what the expected behavior is because I've never known my environment to work any other way. But this feels wrong. It's a fairly barebones project.
{:dev-http {8008 ["classpath:public"]}
:nrepl {:port 9999
:middleware []}
:deps true
:builds
{:main {:target :browser
:output-dir "resources/public/js/main"
:asset-path "js/main"
:modules {:main {:entries [com.owoga.bitstamp]
:init-fn com.owoga.bitstamp/init}}
:devtools {:repl-init-ns cljs.user
:console-support false
:after-load com.owoga.bitstamp/refresh
:repl-pprint true}}}}
The file does exist and it does look like it has source map annotations.
➜ my-project tail resources/public/js/main/cljs-runtime/com.owoga.bitstamp.js
com.owoga.bitstamp.refresh = (function com$owoga$bitstamp$refresh(){
taoensso.timbre._log_BANG_.cljs$core$IFn$_invoke$arity$10(taoensso.timbre._STAR_config_STAR_,new cljs.core.Keyword(null,"info","info",-317069002),"com.owoga.bitstamp",null,330,new cljs.core.Keyword(null,"p","p",151049309),new cljs.core.Keyword(null,"auto","auto",-566279492),(new cljs.core.Delay((function (){
return new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, ["Re-rendering root."], null);
}),null)),null,1062859293);
return reagent.dom.render.cljs$core$IFn$_invoke$arity$2(new cljs.core.PersistentVector(null, 1, 5, cljs.core.PersistentVector.EMPTY_NODE, [com.owoga.bitstamp.order_book], null),document.getElementById("order-book"));
});
goog.exportSymbol('com.owoga.bitstamp.refresh', com.owoga.bitstamp.refresh);
//# sourceMappingURL=com.owoga.bitstamp.js.map
or maybe just :asset-path "/js/main"
. relative paths are problematic sometimes if you use any kind of push-state routing or so
Just confirmed it is loader-mode :script
that fixes it. Tried each individually and together. Get success with just loader-mode script.