Fork me on GitHub
#dirac
<
2016-02-16
>
frank17:02:22

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

frank17:02:36

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

darwin17:02:26

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

frank18:02:36

will elaborate in a sec

frank18:02:02

so I have this:

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

frank18:02:26

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!)

frank18:02:32

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"]]}

frank18:02:45

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

darwin18:02:40

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

darwin18:02:06

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

darwin18:02:50

just did a quick google search:

darwin18:02:57

"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)."

darwin18:02:54

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

darwin18:02:30

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

darwin18:02:10

looks good to me

frank23:02:31

perhaps this is an issue with environ instead of lein profiles

frank23:02:46

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