Skip to content

Commit

Permalink
fixed docs on element picker install. Fixed data viewer to not flicke…
Browse files Browse the repository at this point in the history
…r. Reduced debounce time on db refreshes
  • Loading branch information
awkay committed Sep 27, 2020
1 parent 4d51ab4 commit b05b401
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 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 "1.0.21"
:version "3.0.0"
: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
2 changes: 1 addition & 1 deletion shells/electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fulcro-inspect-electron",
"version": "3.0.0-1",
"version": "3.0.0-3",
"description": "Electron Version of Fulcro Inspect",
"homepage": "https://github.com/fulcrologic/fulcro-inspect",
"main": "js/background/main.js",
Expand Down
2 changes: 1 addition & 1 deletion src/chrome/fulcro/inspect/chrome/devtool/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@

(def fill-last-entry!
"Request the full state for the currently-selected application"
(debounce -fill-last-entry! 500))
(debounce -fill-last-entry! 250))

(defn update-client-db [{:fulcro.inspect.core/keys [app-uuid]
:fulcro.inspect.client/keys [state-id]}]
Expand Down
2 changes: 1 addition & 1 deletion src/electron/fulcro/inspect/electron/renderer/main.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@

(def fill-last-entry!
"Request the full state for the currently-selected application"
(debounce -fill-last-entry! 500))
(debounce -fill-last-entry! 250))

(defn update-client-db [{:fulcro.inspect.core/keys [app-uuid]
:fulcro.inspect.client/keys [state-id]}]
Expand Down
22 changes: 12 additions & 10 deletions src/ui/fulcro/inspect/ui/data_viewer.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -350,19 +350,24 @@
[:&:hover
[:div {:text-decoration "underline"}]]]]}
(let [{:keys [id]} content
app-uuid (h/current-app-uuid (fp/component->state-map this))
last-step (hist/closest-populated-history-step this id)
data (cond-> (hist/state-map-for-id this app-uuid id)
(vector? path) (get-in path))
stale? (not= (:id last-step) id)]
app-uuid (h/current-app-uuid (fp/component->state-map this))
last-step (hist/closest-populated-history-step this id)
desired-state (when-not raw? (hist/state-map-for-id this app-uuid id))
stale? (not= (:id last-step) id)
[actual-revision base-data] (cond
desired-state [id desired-state]
allow-stale? [(:id last-step) (:value last-step)]
:else [id {}])
data (cond-> base-data
(vector? path) (get-in path))]
(dom/div :.container
(when-not (or path raw?)
(dom/h4 {:style {:marginTop "2px"
:marginBottom "2px"}}
(cond
(not stale?) (str "Revision " id)
(and stale? (not allow-stale?)) (str "Revision " id " has not been fetched from the application.")
:else (str "Stale Revision " (:id last-step)))))
:else (str "Stale Revision " actual-revision " (waiting on revision " id ")"))))
(if (and stale? (not allow-stale?) (not raw?))
(when-not path
(dom/button {:onClick #(fp/transact! this `[(hist/remote-fetch-history-step ~{:id id})])} "Fetch Now"))
Expand All @@ -381,10 +386,7 @@
:css css
:path []
:path-action path-action}
(cond
data data
raw? content
:else (:value last-step)))))))
(if raw? content data))))))

(defn all-subvecs [v]
(:result
Expand Down
6 changes: 4 additions & 2 deletions src/ui/fulcro/inspect/ui/data_watcher.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
(pr-str watch-path)))
(if expanded?
(f.data-viewer/data-viewer data-viewer
{::f.data-viewer/path watch-path
{:allow-stale? true
::f.data-viewer/path watch-path
::f.data-viewer/path-action path-action
::f.data-viewer/on-expand-change on-expand-change})))))

Expand Down Expand Up @@ -141,7 +142,8 @@
watches
(range))
(f.data-viewer/data-viewer root-data
{::f.data-viewer/search search
{:allow-stale? true
::f.data-viewer/search search
::f.data-viewer/path-action
#(fp/transact! this [`(add-data-watch {:path ~%})])}))))

Expand Down
2 changes: 1 addition & 1 deletion src/ui/fulcro/inspect/ui/element.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
(dom/p {:style {:fontFamily "Courier"}}
(dom/pre {}
":devtools {:preloads [; your websocket or normal preload here, then:\n"
" com.fulcrologic.fulcro.inspect.element-picker]}"))
" com.fulcrologic.fulcro.inspect.dom-picker-preload]}"))
(dom/p "in your shadow-cljs.edn build to install the necessary support.")))))))

(def panel (fp/factory Panel))

0 comments on commit b05b401

Please sign in to comment.