Skip to content

Commit

Permalink
tweaked inspect decoding so it does not treat tempids specially (they…
Browse files Browse the repository at this point in the history
… are transit encoded)
  • Loading branch information
awkay committed Oct 4, 2020
1 parent b05b401 commit 3f1e250
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion shells/chrome/manifest.edn
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{:manifest_version 2
:name "Fulcro Inspect"
:version "3.0.0"
:version "3.0.1"
:description "Fulcro is a development framework that uses React and CLJS. This extension adds ability to track Fulcro DB, transactions and network"

:icons {"16" "icon-16.png"
Expand Down
16 changes: 4 additions & 12 deletions src/client/fulcro/inspect/helpers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
[fulcro.client.primitives :as fp]
[fulcro.client.mutations :as mutations]
[fulcro.inspect.lib.local-storage :as storage]
[cognitect.transit :as transit]
[fulcro.tempid :as tempid]))
[cognitect.transit :as transit]))

(defn- om-ident? [x]
(and (vector? x)
Expand Down Expand Up @@ -240,19 +239,12 @@
(assoc-in [:params :fulcro.inspect.core/app-uuid] (ref-app-uuid ref))))

(defn pr-str-with-reader [^clj x]
(cond
(transit/tagged-value? x)
#_=> (str "#" (.-tag x) " " (.-rep x))
:else (try
(str x)
(catch :default e
"UNSUPPORTED VALUE"))))
(if (transit/tagged-value? x)
(str "#" (.-tag x) " " (.-rep x))
"UNSUPPORTED VALUE"))

(extend-protocol IPrintWithWriter
transit.types/TaggedValue
(-pr-writer [x writer _]
(write-all writer (pr-str-with-reader x)))
tempid/TempId
(-pr-writer [x writer _]
(write-all writer (pr-str-with-reader x))))

Expand Down
10 changes: 3 additions & 7 deletions src/electron/fulcro/inspect/electron/background/server.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,9 @@
[taoensso.timbre :as log]))

(defn pr-str-with-reader [^clj x]
(cond
(transit/tagged-value? x)
#_=> (str "#" (.-tag x) " " (.-rep x))
:else (try
(str x)
(catch :default e
"UNSUPPORTED VALUE"))))
(if (transit/tagged-value? x)
(str "#" (.-tag x) " " (.-rep x))
"UNSUPPORTED VALUE"))

(extend-protocol IPrintWithWriter
transit.types/TaggedValue
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5126,6 +5126,11 @@ tough-cookie@~2.5.0:
psl "^1.1.28"
punycode "^2.1.1"

transit-js@^0.8.867:
version "0.8.867"
resolved "https://registry.yarnpkg.com/transit-js/-/transit-js-0.8.867.tgz#86ad3f1c33bfd1ebafaadd87911e4361cced2b4f"
integrity sha512-rOwB4K0z/WZ+E2bV42iN9UV3mvGzmwSv/IpMOKdnFpawPAZT0d1L7f91Y+tZQF7lXSDGk+oln4XyIQXo+pyTGA==

trim-newlines@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/trim-newlines/-/trim-newlines-1.0.0.tgz#5887966bb582a4503a41eb524f7d35011815a613"
Expand Down

0 comments on commit 3f1e250

Please sign in to comment.