This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-03
Channels
- # announcements (5)
- # aws (3)
- # babashka (52)
- # babashka-sci-dev (23)
- # beginners (51)
- # calva (191)
- # clj-commons (18)
- # clj-kondo (11)
- # cljdoc (39)
- # cljsrn (3)
- # clojure (24)
- # clojure-czech (3)
- # clojure-dev (2)
- # clojure-europe (15)
- # clojuredesign-podcast (2)
- # clojurescript (8)
- # conjure (2)
- # core-typed (151)
- # cursive (15)
- # data-science (3)
- # datalevin (4)
- # datomic (8)
- # figwheel-main (21)
- # fulcro (37)
- # gratitude (3)
- # honeysql (1)
- # hyperfiddle (2)
- # introduce-yourself (1)
- # malli (3)
- # membrane (54)
- # off-topic (21)
- # other-languages (4)
- # portal (18)
- # re-frame (12)
- # reagent (7)
- # releases (2)
- # sci (64)
- # scittle (1)
- # spacemacs (14)
- # sql (2)
- # vim (4)
- # xtdb (6)
I found a bug using my navigation functions; I bound in my emacs commands like:
(portal.web/eval-str "(portal.ui.commands/select-root portal.ui.state/state)")
now, I have two commands select-next
and select-prev
, and they work initially, but if I go very fast between them, at a certain point they will stop working. This is not the only time in which this happens, but is a reproducible behaviour for me. How could I debug this?In particular, this definition:
(defn eval-str [code]
(let [response (c/request {:op :portal.rpc/eval-str :code code})]
(if-not (:error response)
(:result response)
(throw (ex-info (:message response)
{:code code :cause (:result response)})))))
I see that if the response is an error, we throw it, but I never saw the error when using a cljs replhmm, I restarted my repl and I'm not able to reproduce the issue anymore (which, on one hand, makes me very happy 😂 )
Hi. Something strange: trying to submit random plots to Portal, I repeatedly get plots that all look like the first one. Calling this a few times
(-> [:portal.viewer/vega-lite
{:encoding
{:y {:field "y", :type "quantitative"},
:x {:field "x", :type "quantitative"}},
:mark {:type "circle", :size 500},
:data {:values
(vec
(for [i (range 9)]
{:x i :y (rand)}))}}]
(#(do (println %)
%))
(with-meta
{:portal.viewer/default
:portal.viewer/hiccup})
portal.api/submit)
gives me identical plots, while the printed values are different each time.;; in cljs
(hash 0.0) ;; => 0
(hash 0.5) ;; => 0
(hash 1.0) ;; => 1
(hash 1.5) ;; => 1
https://stackoverflow.com/questions/45637233/clojurescript-floats-hashed-as-ints :thinking_face:
For now, something like:
(-> [:<>
{:key (rand)}
[:portal.viewer/vega-lite
{:encoding
{:y {:field "y", :type "quantitative"},
:x {:field "x", :type "quantitative"}},
:mark {:type "circle", :size 500},
:data {:values
(vec
(for [i (range 9)]
{:x i :y (rand)}))}}]]
(with-meta
{:portal.viewer/default
:portal.viewer/hiccup})
portal.api/submit)
should fix it 👌Fascinating. Good idea to use the key. Thanks!!
Depending on values that are not equal having hash codes that are not equal sounds like a bug
Indeed it is, but the existing solution works well enough for now given implementation constraints. We can log it as an issue, and if enough people run into it, we can look into a long term solution 👌
Here is the issue: https://github.com/djblue/portal/issues/119 🙏