Skip to content

Commit

Permalink
Prevent stale ref to viewers
Browse files Browse the repository at this point in the history
  • Loading branch information
djblue committed Sep 21, 2024
1 parent e0a44a7 commit c5b7f7a
Show file tree
Hide file tree
Showing 34 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion examples/plotly-viewer/src/portal/ui/viewer/plotly.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(def viewer
{#_#_:predicate (partial sp/valid? ::plotly)
:predicate (constantly true)
:component plotly-viewer
:component #'plotly-viewer
:name :portal.viewer/plotly})

;; (comment
Expand Down
2 changes: 1 addition & 1 deletion src/portal/ui/inspector.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -1216,5 +1216,5 @@

(def viewer
{:predicate (constantly true)
:component inspector
:component #'inspector
:name :portal.viewer/inspector})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/bin.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@

(def viewer
{:predicate ins/bin?
:component inspect-bin
:component #'inspect-bin
:name :portal.viewer/bin
:doc "View binary data as a hexdump."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/bytes.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@
(def viewer
{:predicate number?
:name :portal.viewer/size-bytes
:component inspect-bytes
:component #'inspect-bytes
:doc "Interpret number as amount of bytes."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/cljdoc.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,5 @@

(def viewer
{:predicate cljdoc?
:component inspect-cljdoc
:component #'inspect-cljdoc
:name :portal.viewer/cljdoc})
4 changes: 2 additions & 2 deletions src/portal/ui/viewer/code.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@

(def viewer
{:predicate string?
:component inspect-code
:component #'inspect-code
:name :portal.viewer/code})

(def pr-str-viewer
{:predicate (constantly true)
:component inspect-pr-str
:component #'inspect-pr-str
:name :portal.viewer/pr-str})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/color.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@

(def viewer
{:predicate color?
:component inspect-color
:component #'inspect-color
:name :portal.viewer/color
:doc "View hex / rgb / rgba colors"})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/csv.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

(def viewer
{:predicate csv?
:component inspect-csv
:component #'inspect-csv
:name :portal.viewer/csv
:doc "Parse a string as a CSV and use the table viewer by default."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/date_time.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,5 @@

(def viewer
{:predicate parse
:component inspect-date-time
:component #'inspect-date-time
:name :portal.viewer/date-time})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/deref.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@

(def viewer
{:predicate atom?
:component inspect-deref
:component #'inspect-deref
:name :portal.viewer/deref})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/diff.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@

(def viewer
{:predicate can-view?
:component inspect-diff
:component #'inspect-diff
:name :portal.viewer/diff
:doc "Diff a collection of values successively starting with the first two."})

Expand Down
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/diff_text.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@

(def viewer
{:predicate diff-text?
:component inspect-text-diff
:component #'inspect-text-diff
:name :portal.viewer/diff-text
:doc "Diff two strings."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/edn.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

(def viewer
{:predicate edn?
:component inspect-edn
:component #'inspect-edn
:name :portal.viewer/edn
:doc "Parse a string as EDN. Will render error if parsing fails."})
6 changes: 3 additions & 3 deletions src/portal/ui/viewer/exception.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -300,16 +300,16 @@

(def viewer
{:predicate exception?
:component inspect-exception
:component #'inspect-exception
:name :portal.viewer/ex
:doc "Viewer for datafied exceptions."})

(def trace-viewer
{:predicate trace?
:component inspect-stack-trace
:component #'inspect-stack-trace
:name :portal.viewer/stack-trace})

(def sub-trace-viewer
{:predicate trace?
:component inspect-sub-trace
:component #'inspect-sub-trace
:name :portal.viewer/sub-trace})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/hiccup.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,6 @@

(def viewer
{:predicate hiccup?
:component inspect-hiccup
:component #'inspect-hiccup
:name :portal.viewer/hiccup
:doc "Render a hiccup value as html via reagent."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/html.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

(def viewer
{:predicate string?
:component inspect-html
:component #'inspect-html
:name :portal.viewer/html})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/http.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,6 @@

(def viewer
{:predicate get-component
:component inspect-http
:component #'inspect-http
:name :portal.viewer/http
:doc "Highlight HTTP method and status code for http request and response."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/image.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@

(def viewer
{:predicate ins/bin?
:component inspect-image
:component #'inspect-image
:name :portal.viewer/image
:doc "View a binary value as an image."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/json.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

(def viewer
{:predicate json?
:component inspect-json
:component #'inspect-json
:name :portal.viewer/json
:doc "Parse a string as JSON. Will render error if parsing fails."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/jwt.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@

(def viewer
{:predicate string?
:component inspect-jwt
:component #'inspect-jwt
:name :portal.viewer/jwt
:doc "Parse a string as a JWT. Will render error if parsing fails."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/log.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,6 @@

(def viewer
{:predicate log?
:component inspect-log
:component #'inspect-log
:name :portal.viewer/log
:doc "Useful for conveying a value in a specific context (what/where/when)."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/markdown.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,6 @@

(def viewer
{:predicate string?
:component inspect-markdown
:component #'inspect-markdown
:name :portal.viewer/markdown
:doc "Parse string as markdown and view as html."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/pprint.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@

(def viewer
{:predicate (constantly true)
:component pprint-data
:component #'pprint-data
:name :portal.viewer/pprint
:doc "View value printed via clojure.pprint/pprint."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/prepl.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,6 @@

(def viewer
{:predicate io?
:component inspect-prepl
:component #'inspect-prepl
:name :portal.viewer/prepl
:doc "View interlacing of stdout, stderr and tap values. Useful for build output."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/relative_time.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@

(def viewer
{:predicate date-time/parse
:component inspect-relative
:component #'inspect-relative
:name :portal.viewer/relative-time
:doc "View value relative to the current time."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/source_location.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@

(def viewer
{:predicate source-location?
:component inspect-source
:component #'inspect-source
:name :portal.viewer/source-location
:doc "View a map as a source location, provides goto definition on click."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/spec.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,6 @@

(def viewer
{:predicate can-view?
:component inspect-spec
:component #'inspect-spec
:name :portal.viewer/spec
:doc "A viewer for data produced via clojure.spec.alpha/explain-data"})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/table.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,6 @@

(def viewer
{:predicate table-view?
:component inspect-table
:component #'inspect-table
:name :portal.viewer/table
:doc "View value as a table. Supports sticky headers and keyboard navigation."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/test_report.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,6 @@

(def viewer
{:predicate get-component
:component inspect-test
:component #'inspect-test
:name :portal.viewer/test-report
:doc "View clojure.test report output."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/text.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@

(def viewer
{:predicate string?
:component inspect-text
:component #'inspect-text
:name :portal.viewer/text
:doc "View string as a text file."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/transit.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

(def viewer
{:predicate transit?
:component inspect-transit
:component #'inspect-transit
:name :portal.viewer/transit
:doc "Parse a string as transit. Will render error if parsing fails."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/tree.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,6 @@

(def viewer
{:predicate ins/coll?
:component inspect-tree
:component #'inspect-tree
:name :portal.viewer/tree
:doc "For viewing highly nested values, such as hiccup."})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/vega.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,5 @@

(def viewer
{:predicate (partial s/valid? ::vega)
:component vega-viewer
:component #'vega-viewer
:name :portal.viewer/vega})
2 changes: 1 addition & 1 deletion src/portal/ui/viewer/vega_lite.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@

(def viewer
{:predicate (partial s/valid? ::vega-lite)
:component vega-lite-viewer
:component #'vega-lite-viewer
:name :portal.viewer/vega-lite})

0 comments on commit c5b7f7a

Please sign in to comment.