Put debug panel behind closure define

This commit is contained in:
Daniel Compton 2018-01-18 15:05:15 +13:00
parent 15f35571f4
commit 6b4bf37a21
3 changed files with 7 additions and 2 deletions

View File

@ -37,6 +37,8 @@ You need both the re-frame-trace project _and_ a test project to develop it agai
:cljsbuild {:builds {:client {:source-paths ["checkouts/re-frame-trace/src"]}}}
```
- re-frame-trace has a debug panel useful when developing it. You can enable it by adding the :closure-define `"day8.re_frame.trace.debug_QMARK_" true` to your compiler settings.
- Now run your test project however you usually run it, and re-frame-trace should be in there. \o/

View File

@ -24,6 +24,7 @@
[mranderson047.re-frame.v0v10v2.re-frame.core :as rf]
[mranderson047.reagent.v0v6v0.reagent.core :as r]))
(goog-define debug? false)
;; from https://github.com/reagent-project/reagent/blob/3fd0f1b1d8f43dbf169d136f0f905030d7e093bd/src/reagent/impl/component.cljs#L274
(defn fiber-component-path [fiber]
@ -232,7 +233,8 @@
(defn inject-devtools! []
(styles/inject-trace-styles js/document)
(r/render [devtools-outer events/traces {:panel-type :inline}] (panel-div)))
(r/render [devtools-outer events/traces {:panel-type :inline
:debug? debug?}] (panel-div)))
(defn init-db! []
(trace.db/init-db))

View File

@ -136,7 +136,8 @@
;(tab-button :views "Views")
(tab-button :traces "Trace")
(tab-button :timing "Timing")
(tab-button :debug "Debug")]]]])
(when (:debug? opts)
(tab-button :debug "Debug"))]]]])
[rc/line :color "#EEEEEE"]
(when (and external-window? @unloading?)
[:h1.host-closed "Host window has closed. Reopen external window to continue tracing."])