dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
frank 2016-02-16T17:55:04.000002Z

hmm

frank 2016-02-16T17:55:22.000003Z

figwheel doesn't seem to like the macro I've used to set up devtools

frank 2016-02-16T17:57:36.000005Z

(e.g. using environ to determine that I'm in dev and that devtools should be set up)

2016-02-16T17:59:26.000006Z

I’m sorry, I don’t remember the context

frank 2016-02-16T18:00:36.000007Z

will elaborate in a sec

frank 2016-02-16T18:09:02.000008Z

so I have this:

(defmacro require-devtools! []
  (when (:devtools env)
    ;; TODO: Replace this with a ClojureScript require function
    '(js/goog.require "frontend.devtools")))

frank 2016-02-16T18:09:26.000009Z

and this:

(ns frontend.devtools
  (:require [devtools.core :as devtools]))

; this enables additional features, :custom-formatters is enabled by default
(defn setup! []
  (devtools/enable-feature! :sanity-hints :dirac)
  (devtools/install!))

(setup!)

frank 2016-02-16T18:10:32.000010Z

and my devtools profile looks like this:

{:repl-options {:port 8230
                                       :nrepl-middleware [dirac.nrepl.middleware/dirac-repl]
                                       :init (do
                                               (require 'dirac.agent)
                                               (dirac.agent/boot!))}
                        :env {:devtools "true"}
                        :cljsbuild {:builds {:dev {:source-paths ["devtools"]}}}
                        :dependencies [[binaryage/devtools "0.5.2"]
                                       [binaryage/dirac "0.1.3"]]}

frank 2016-02-16T18:11:45.000011Z

running lein with-profile +devtools figwheel doesn't seem to work, while lein with-profile +devtools cljsbuild once did

2016-02-16T18:12:40.000012Z

ah, I think this is a known issue of figwheel, it does not understand profiles in project.clj

2016-02-16T18:13:06.000013Z

figwheel simply reads project.clj using read-string and does not perform profile merging

2016-02-16T18:13:14.000014Z

AFAIK

2016-02-16T18:14:50.000015Z

just did a quick google search:

2016-02-16T18:14:57.000018Z

"An important note about configuration: The (start-figwheel!) call will automatically pull your configuration from the project.clj BUT ... no leiningen profile merging will occur (this is because we are reading the config raw from the project.clj file)."

2016-02-16T18:19:54.000019Z

@frank: but maybe I’m wrong, I just looked at my other projects and I successfully use figwheel with profiles there

2016-02-16T18:21:08.000020Z

even cljs-devtools-sample uses it: https://github.com/binaryage/cljs-devtools-sample/blob/master/project.clj

2016-02-16T18:21:30.000022Z

so your problem will be likely elsewhere, can you share full project.clj?

2016-02-16T18:44:10.000025Z

looks good to me

frank 2016-02-16T23:24:31.000026Z

perhaps this is an issue with environ instead of lein profiles

frank 2016-02-16T23:24:46.000027Z

since it looks like other aspects of the lein profile are being respected in figwheel