shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
Max 2021-04-03T17:07:18.333400Z

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!

thheller 2021-04-03T19:08:14.334200Z

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

1
thheller 2021-04-03T19:10:51.334500Z

something like this

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

thheller 2021-04-03T19:11:00.334800Z

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

thheller 2021-04-03T19:11:14.335100Z

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

Schpaa 2021-04-03T21:25:19.336800Z

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

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

Schpaa 2021-04-03T21:27:47.337100Z

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

thheller 2021-04-04T07:59:35.339200Z

because EDN does not support regexp

thheller 2021-04-04T08:01:00.339400Z

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

thheller 2021-04-04T08:01:31.339600Z

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

Schpaa 2021-04-04T10:05:59.340Z

Got it, thanks!

thheller 2021-04-04T10:09:16.340200Z

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

2021-04-04T22:22:52.345Z

@schpaencoder 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.

Azzurite 2021-04-03T22:05:54.338Z

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)

Azzurite 2021-04-03T22:11:17.338600Z

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