This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-26
Channels
- # announcements (7)
- # aws (1)
- # babashka (15)
- # beginners (144)
- # calva (8)
- # chlorine-clover (15)
- # clara (4)
- # clojure (65)
- # clojure-europe (131)
- # clojure-france (1)
- # clojure-nl (6)
- # clojure-nlp (3)
- # clojure-spec (10)
- # clojure-uk (52)
- # clojuredesign-podcast (2)
- # clojurescript (28)
- # cryogen (1)
- # datomic (17)
- # events (2)
- # figwheel-main (2)
- # fulcro (8)
- # hugsql (2)
- # jackdaw (4)
- # jobs (1)
- # leiningen (8)
- # lumo (1)
- # malli (4)
- # off-topic (23)
- # parinfer (3)
- # pathom (3)
- # pedestal (5)
- # re-frame (9)
- # reagent (26)
- # reitit (13)
- # reveal (25)
- # shadow-cljs (45)
- # spacemacs (7)
- # sql (7)
- # tools-deps (40)
- # vrac (2)
- # xtdb (22)
@vlaaad Something changed between 1.0.130 and 1.0.137 that now causes a stack overflow exception when evaluating that auto-table view code
java.lang.StackOverflowError: nil
in clojure.lang.RT.get (RT.java:761)
in clojure.core/fn--6114/fn--6115 (core.clj:3666)
in clojure.lang.MultiFn.invoke (MultiFn.java:233)
in clojure.core/pr-on (core.clj:3676)
in clojure.core/pr-on (core.clj:3670)
in clojure.core/print-prefix-map/fn--7343 (core_print.clj:233)
in clojure.core/print-sequential (core_print.clj:61)
in clojure.core/print-prefix-map (core_print.clj:229)
in clojure.core/print-map (core_print.clj:238)
in clojure.core/fn--7372 (core_print.clj:266)
in clojure.core/fn--7372 (core_print.clj:263)
in clojure.lang.MultiFn.invoke (MultiFn.java:234)
in clojure.core/pr-on (core.clj:3676)
in clojure.core/pr-on (core.clj:3670)
in clojure.core/print-prefix-map/fn--7343 (core_print.clj:233)
...
Hmm, I checked it (https://github.com/vlaaad/reveal/blob/master/examples/e04_tap_to_table.clj) before releasing 1.0.137, and that worked fine for me, can you share a repro?
(let [last-tap (atom nil)]
(add-tap #(reset! last-tap %))
(rx/view-as-is
{:fx/type rx/observable-view
:ref last-tap
:fn (fn [x]
{:fx/type :v-box
:children
[{:fx/type rx/value-view
:v-box/vgrow :always
:value (assoc (meta x) :_obj x :_class (class x))}
(if (or (nil? x) (string? x) (not (seqable? x)))
{:fx/type rx/table-view
:items [x]
:v-box/vgrow :always
:columns [{:fn identity :header 'value}]}
(let [head (first x)]
{:fx/type rx/table-view
:items x
:v-box/vgrow :always
:columns (cond
(map? head) (for [k (keys head)] {:header k :fn #(get % k)})
(map-entry? head) [{:header 'key :fn key} {:header 'val :fn val}]
(indexed? head) (for [i (range (count head))] {:header i :fn #(nth % i)})
:else [{:header 'item :fn identity}])}))]})}))
I added the extra v-box for metadata and value.
rx/view-as-is
is identity
since 1.0.137, and that means it will print the contents of the atom, that might cause issues if you tap that atom
Can you try this maybe?
(let [last-tap (atom nil)]
(add-tap #(reset! last-tap %))
(rx/stream-as-is
(rx/as
{:fx/type rx/observable-view
:ref last-tap
:fn (fn [x]
{:fx/type :v-box
:children
[{:fx/type rx/value-view
:v-box/vgrow :always
:value (assoc (meta x) :_obj x :_class (class x))}
(if (or (nil? x) (string? x) (not (seqable? x)))
{:fx/type rx/table-view
:items [x]
:v-box/vgrow :always
:columns [{:fn identity :header 'value}]}
(let [head (first x)]
{:fx/type rx/table-view
:items x
:v-box/vgrow :always
:columns (cond
(map? head) (for [k (keys head)] {:header k :fn #(get % k)})
(map-entry? head) [{:header 'key :fn key} {:header 'val :fn val}]
(indexed? head) (for [i (range (count head))] {:header i :fn #(nth % i)})
:else [{:header 'item :fn identity}])}))]})}
(rx/raw-string "tap-to-table-view" {:fill :object}))))
That doesn't render anything that can be right-click -> view'd
I'm not seeing how to make that render a view...
Ah, I was still using 1.0.130 and that wasn't view
able but in 1.0.137 it is!
Switched back to 1.0.137 and that seems to work as expected now. Thanks @vlaaad!
I'm going to be doing some RDD talks to a couple of online Clojure groups so Reveal will be featured there 🙂
I'll show building a small web app in the REPL and one of the things I'll show is browsing the app in Reveal side-by-side with my editor.
I browse online docs that way too, using Reveal...
Sure. The date/time will get posted to #events once they are scheduled and I'll probably post links to the recording here for Reveal users 🙂