Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devcards not updating when changed. #162

Open
olymk2 opened this issue Nov 13, 2019 · 1 comment
Open

devcards not updating when changed. #162

olymk2 opened this issue Nov 13, 2019 · 1 comment

Comments

@olymk2
Copy link

olymk2 commented Nov 13, 2019

So I have setup devcards and I can access localhost:9500/cards.html and everything renders.

how ever I am not getting the live reloading, when i edit the stat card changing the number the figwheel logo shows in the corner and shows it detected a reload, how ever the card does not update with out a browser refresh.

not sure what I have done wrong any points on how to figure out where things are going wrong or pointers on how to diagnose this ?

project.clj

(defproject website "0.1.0-SNAPSHOT"
  :uberjar-name "website.jar"
  :target-path "target/%s"
  :source-paths ["src"]
  ;:ring {:handler server-rendering.handler/app}
  :plugins [[lein-tools-deps "0.4.5"] [lein-ring "0.12.5"]]
  :middleware [lein-tools-deps.plugin/resolve-dependencies-with-deps-edn]
  :lein-tools-deps/config {:config-files [:install :user :project]})

figwheel-main.edn

{
 :target-dir "resources"
 :watch-dirs ["src"]
 :css-dirs ["resources/public/css"]
}

dev.cljs.edn

^{:extra-main-files {:devcards {:main cards.core}}
}
{:output-to "resources/public/cljs-out/dev-main.js"
 :optimizations :none
 :pretty-print true
 :source-map true
 :devcards true
 :main website.core}

I have this included in the html file.

<script src="/cljs-out/dev-main-devcards.js" type="text/javascript"></script>

and this is the code in my cards namespace.

(ns cards.core
  (:require
   [devcards.core :as dc]
   [reagent.core :as reagent]
   [website.components :as c]
   [website.core])
   (:require-macros
   [devcards.core :refer [defcard-rg]]))

(devcards.core/start-devcard-ui!)

(defcard-rg stat-circle
  "Profile component"
  (c/stat "25"))
@olymk2
Copy link
Author

olymk2 commented Nov 13, 2019

hopefully this will help some one else, I think this was the cause.
^{:extra-main-files {:devcards {:main cards.core}}
I changed it to
^{:extra-main-files {:dev {:main cards.core}}
the key must have to match youur current build, in my case I was building dev and extra-main-files key was set to devcards, updating to match the build seemed to fix auto reloading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant