This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-03-26
Channels
- # announcements (1)
- # autochrome-github (1)
- # babashka (9)
- # beginners (112)
- # bristol-clojurians (2)
- # calva (26)
- # cider (10)
- # clj-kondo (31)
- # cljs-dev (40)
- # clojure (114)
- # clojure-austin (1)
- # clojure-dev (112)
- # clojure-europe (22)
- # clojure-germany (5)
- # clojure-italy (1)
- # clojure-nl (2)
- # clojure-norway (1)
- # clojure-spec (10)
- # clojure-uk (96)
- # clojurescript (39)
- # core-logic (5)
- # datomic (40)
- # fulcro (34)
- # graphql (17)
- # jobs (3)
- # kaocha (4)
- # leiningen (10)
- # luminus (1)
- # malli (3)
- # meander (44)
- # midje (2)
- # off-topic (40)
- # pathom (5)
- # re-frame (8)
- # reitit (8)
- # ring (3)
- # ring-swagger (4)
- # shadow-cljs (83)
- # spacemacs (96)
- # tools-deps (16)
- # vim (4)
- # xtdb (15)
- # yada (20)
react-datepicker - I am trying to use this component in my cljs with reagent. Could someone give me some hit regarding how to use it: Here is the code I have . I see the picker, but when I select the date, the input is not getting populated with the value. I am sure I am missing something..
(let [control-value (reagent/atom {})]
[:> DatePicker {
:selected (:start-date control-value)
:on-change #(doall
(println (str "xxxxxxxx->" %))
(reset! control-value {:start-date %})
)
}])
This is the react code from the React Datepicker site:
() => {
const [startDate, setStartDate] = useState(new Date());
return (
<DatePicker
selected={startDate}
onChange={date => setStartDate(date)} />
);
};
Any hint is much appreciated. Thanks>
Thank you. There is no error now. I can see the date value too on the log. But it is not getting populated on the editbox. Moreover, I see the following warning: Reactive deref not supported in lazy seq, it should be wrapped in doall:
ran into a weird advanced compilation problem, a multimethod name is mangled as XR and it doesn't work in chrome but works in other browsers
chrome has an XR name in the global scope (some augmented reality stuff, it seems) so the
"undefined" === typeof XR
works differentlyDo you use the latest CLJS version? IIRC that particular name was added to the name of exceptions in GCC somewhat recently.
Even if CLJS by itself didn't upgrade GCC to the required version. I think shadow-cljs has the fix (because it uses a newer GCC version).
otherwise I think I can add an extern that lies about having an XR so no names will be munged to have that
Maybe this compiler option will help... :output-wrapper Wrap the Javascript output to avoid clobbering globals. There are four possible value types....
I don't think wrapping helps this case as globals are visible inside the function wrapper
still scary that things are added to global scope that break... I'm guessing there are closure apps (and others) that haven't been updated in 11 months
you can use window.XR
I think, unless that XR multimethod is available globally as well
btw, it's not the first time I see this issue posted here
window.XR
+ output wrapper should help
the script failed to load in chrome, because it checks if XR is undefined and it is not in chrome
We have a webapp which uses SSE. Sometimes people open up multiple instances of the app in various tabs which often fails the SSE connection to malfunction (because of too many concurrent requests to the same server from the browser). I'm looking into a way how to get one shared SSE connection for multiple tabs. It looks like there is something called SharedWebworker, but this is already deprecated in Webkit. Any other ideas/solutions?
I guess so. It was nice that we got SSE basically for free in yada, websockets was a bit more painful
SSE is also better in the client with things like last event id and automatic reconnection. Be aware you'll need to do those yourself.
I would like to poke some (.log js/console
into someone else's function.
I seem to remember that I can do something like
• take a def of the current function in its current namespace
• create new defn which does what I want, in my namespace
• call (set! 'old-ns/old-fn new-debugging-fn)
but I get the err
34 | (set! 'xf/dispatch dispatch-dec)
-------^------------------------------------------------------------------------
Error in phase :compilation
set! target must be a field or a symbol naming a var
what am I doing wrong here?oh I think
(set! xf/dispatch dispatch-dec)
is working:face_palm:alter-var-root works
ser=> (alter-var-root #'concat (fn [orig] (fn [& args] (prn "hi") (apply orig args))))
#object[user$eval158$fn__159$fn__160 0xc3177d5 "user$eval158$fn__159$fn__160@c3177d5"]
user=> (concat [1] [2])
"hi"
(1 2)
set!
did work for me though
So this is really cool.
it can be very helpful, I'd recommend you only alter the root for debug purposes though
Great tool to have in the debugging tool kit