Fork me on GitHub
#shadow-cljs
<
2021-04-03
>
Max17:04:18

Wow, just started playing around with the inspector and it’s great! Two small things it choked on: it can’t seem to inspect into reagent’s ratoms the same way it inspects normal atoms, and it doesn’t seem to be able to inspect items inside of LazySeqs. The latter can be easily worked around by just running (into [] $o) though, so not a huge deal. Awesome tool!

thheller19:04:14

@max.r.rothman yeah the support for lazy seqs is incomplete. you can extend support for reagent atoms by extending the datafy protocol

thanks3 3
thheller19:04:51

something like this

(extend-protocol p/Datafiable
  reagent.ratom/RAtom
  (datafy [r]
    (with-meta [(deref r)] (meta r))))

thheller19:04:00

with p being (:require [clojure.core.protocols :as p])

thheller19:04:14

can do it from a REPL or a ns you load via :preloads

Schpaa21:04:19

Why is this not legal in shadow-cljs.edn?

:git-inject    {:version-pattern #"^v\/(.*)$"
                 :ignore-dirty?   false}

Schpaa21:04:47

shadow says this is an Unsupported escape character: \/.

Azzurite22:04:54

doesn't seem like it has anything to do with shadow-cljs, you just can't (read: don't have to) escape a /? you probably meant to do \\ to escape a \ so you match \/ in the final regex (or you just want to remove the \ so you match a single /, if that's what you want)

Azzurite22:04:17

also seems like this is not a standard shadow-cljs feature but rather coming from https://github.com/day8/shadow-git-inject so it might be that you get better answers there

thheller07:04:35

because EDN does not support regexp

thheller08:04:00

don't know why they have it as an example but default clj/cljs EDN readers do not support regular expressions

thheller08:04:31

I guess I could maybe change it to use the regular CLJ parsers but as of now it is treated as EDN

Schpaa10:04:59

Got it, thanks!

thheller10:04:16

just use a string, it'll be converted. just requires a bit more escaping the \\

mikethompson22:04:52

@UBKAXK5QB That bug (and the documentation) in shadow-git-inject has been fixed. We have also moved re-frame-template to use this update. Thanks for report.