Merge pull request #18 from daiyi/patch-1

Clarify installation
This commit is contained in:
Daniel Compton 2017-07-18 09:51:13 +12:00 committed by GitHub
commit f7f988ebb1
1 changed files with 20 additions and 9 deletions

View File

@ -14,16 +14,27 @@ re-frame has instrumentation to collect traces throughout various important poin
## Getting started
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]`.
```cljs
{:builds
[{:id "dev"
:source-paths ["src" "dev"]
:compiler {...
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
:preloads [day8.re-frame.trace.preload]}}]}
```
So when using leiningen, add the following to `project.clj`:
- `[day8.re-frame/trace "0.1.0"]` in `:profiles :dev :dependencies`
```cljs
{:profiles
{:dev
{:dependencies [day8.re-frame/trace "0.1.0"] }}
```
- `:closure-defines: "re_frame.trace.trace_enabled_QMARK_" true` and `:preloads [day8.re-frame.trace.preload]` in `:compiler`
```cljs
{:builds
[{:id "dev"
:source-paths ["src" "dev"]
:compiler {...
:closure-defines {"re_frame.trace.trace_enabled_QMARK_" true}
: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.