Update README.md

This commit is contained in:
Dexter Gramfors 2017-04-13 20:15:49 +02:00 committed by GitHub
parent 008b4392b9
commit 9b9f727929
1 changed files with 3 additions and 3 deletions

View File

@ -16,16 +16,16 @@ re-frame has instrumentation to collect traces throughout various important poin
Compile your app with `:closure-defines: "re_frame.trace.trace_enabled_QMARK_" true` and `:preloads [day8.re-frame.trace.preload]`, e.g. Compile your app with `:closure-defines: "re_frame.trace.trace_enabled_QMARK_" true` and `:preloads [day8.re-frame.trace.preload]`, e.g.
```cljs ```cljs
{:builds {:builds
[{:id "dev" [{:id "dev"
:source-paths ["src" "dev"] :source-paths ["src" "dev"]
:compiler {... :compiler {...
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true} :closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
:preloads [day8.re-frame.trace.preload]}}]} :preloads [day8.re-frame.trace.preload]}}]}
``` ```
By default, re-frame tracing is compiled out, so it won't impose a performance cost in production. The trade-off here is that you need to explicitly enable it in development. By default, re-frame tracing is compiled out, so it won't impose a performance cost in production. The trade-off here is that you need to explicitly enable it in development.
The [preloads](https://github.com/clojure/clojurescript/wiki/Compiler-Options#preloads) option (`:preloads [day8.re-frame.trace.preload]`) has to be set in order to automatically monkeypatch Reagent to add appropriate lifecycle hooks. Yes this is gross, and yes we will try and make a PR to reagent to add proper hooks, once we know exactly what we need. The preload namespace also injects a div containing the devtools panel into the DOM. The [preloads](https://github.com/clojure/clojurescript/wiki/Compiler-Options#preloads) option (`:preloads [day8.re-frame.trace.preload]`) has to be set in order to automatically monkeypatch Reagent to add appropriate lifecycle hooks. Yes this is gross, and yes we will try and make a PR to reagent to add proper hooks, once we know exactly what we need. The preload namespace also injects a div containing the devtools panel into the DOM.