This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-07
Channels
- # babashka (7)
- # beginners (218)
- # boot (1)
- # chlorine-clover (2)
- # cider (36)
- # cljsrn (8)
- # clojure (71)
- # clojure-dev (9)
- # clojure-europe (11)
- # clojure-france (1)
- # clojure-italy (5)
- # clojure-nl (5)
- # clojure-uk (24)
- # clojurescript (9)
- # conjure (16)
- # cursive (65)
- # datomic (76)
- # devcards (21)
- # emacs (1)
- # etaoin (1)
- # figwheel-main (47)
- # fulcro (37)
- # hyperfiddle (9)
- # java (2)
- # kaocha (1)
- # malli (11)
- # music (14)
- # observability (8)
- # off-topic (32)
- # re-frame (13)
- # reagent (2)
- # reitit (5)
- # ring (3)
- # shadow-cljs (40)
- # slack-help (17)
- # spacemacs (15)
- # tools-deps (5)
- # xtdb (16)
hi everyone! I'm running devcards as an extra-main using figwheel main. The entrypoint seems to be imported fine and devcard ui is showing, but none of my cards are being shown. Anyone have any clue what might be going wrong?
yes, I've done a require. It seems like the macro is not getting expanded into a card/is being removed
ok, figured it out. The figwheel extra-main-files gave me the impression that the map for an extra entry would get merged with the settings for the main entry. So I thought I could do this:
^{:watch-dirs ["src" "env/dev" "cards" "test"]
:auto-bundle :webpack
:final-output-to "resources/public/js/app.js"
:clean-outputs true
:extra-main-files
{:devcards {:main frontend.devcards-runner
:devcards true}}}
{:main frontend.main
:output-dir "resources/public/js/app"
:output-wrapper true}
which apparently you can't. If I specify the :devcards true
setting in the main map it works@adriaan.callaerts oh that’s tricky
Another thing that I noticed using it with figwheel main is that I kinda have to do something hacky to get it to play nice with the generated entrypoint. I wanted to achieve a similar effect as the auto-testing, in which the UI of the testing/devcards report overrides/replaces the dummy output of the extra-main html. To achieve that with devcards, I resorted to doing something like this:
(ns fleet-frontend.devcards-runner
(:require [devcards.core]
[devcards.system :refer [devcards-app-element-id get-element-by-id]]
[frontend.cards]))
(defonce init
(do
(enable-console-print!)
(println "Devcards are ON")
(set! (. (get-element-by-id "app-devcards") -id) devcards-app-element-id)
(devcards.core/start-devcard-ui!)))
yeah you are better off creating a landing html page that requires the devcards-runner.main.js
how does figwheel achieve that effect with the testing report? I'm guessing it overrides the goog-define for the root element id that's used there?
wouldn't the app element be called app-auto-testing?
so I'm guessing figwheel does some magic to "set" this https://github.com/bhauman/cljs-test-display/blob/master/src/cljs_test_display/core.cljs#L25 to use the alternative mount point, as opposed to devcard which has it hardcoded here https://github.com/bhauman/devcards/blob/master/src/devcards/system.cljs#L23