From 3f1e2509c45712c15b7f3a2c64f878e412485286 Mon Sep 17 00:00:00 2001 From: Tony Kay Date: Sun, 4 Oct 2020 11:12:21 -0700 Subject: [PATCH] tweaked inspect decoding so it does not treat tempids specially (they are transit encoded) --- shells/chrome/manifest.edn | 2 +- src/client/fulcro/inspect/helpers.cljs | 16 ++++------------ .../inspect/electron/background/server.cljs | 10 +++------- yarn.lock | 5 +++++ 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/shells/chrome/manifest.edn b/shells/chrome/manifest.edn index 85aac5d..8b6c495 100644 --- a/shells/chrome/manifest.edn +++ b/shells/chrome/manifest.edn @@ -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" diff --git a/src/client/fulcro/inspect/helpers.cljs b/src/client/fulcro/inspect/helpers.cljs index aada202..8cee45b 100644 --- a/src/client/fulcro/inspect/helpers.cljs +++ b/src/client/fulcro/inspect/helpers.cljs @@ -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) @@ -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)))) diff --git a/src/electron/fulcro/inspect/electron/background/server.cljs b/src/electron/fulcro/inspect/electron/background/server.cljs index 79cf756..1b82032 100644 --- a/src/electron/fulcro/inspect/electron/background/server.cljs +++ b/src/electron/fulcro/inspect/electron/background/server.cljs @@ -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 diff --git a/yarn.lock b/yarn.lock index 9b229fa..fd512fc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"