Fork me on GitHub

@bhauman it would be handy if a post build hook could be a fn. Just about to read the source to figure out if that's basically already valid and I need to turn off config validation.


My use-case is that I'm using a locally scoped fn inside of an integrant component so I have access to a promise I created, which I use to make sure I only start one webpack watcher.


I have a workaround for now, so no rush


Hacky workaround is to use with-local-vars to bind it it into a clojure.lang.Var

πŸ‘ 4

I'm trying to understand figwheel-main. I've got to a stage where I have a simple layout

β”œβ”€β”€ deps.edn
β”œβ”€β”€ deps.edn~
β”œβ”€β”€ foo-dash.cljs.edn
β”œβ”€β”€ resources
β”‚Β Β  └── public
β”‚Β Β      β”œβ”€β”€ css
β”‚Β Β      β”‚Β Β  └── style.css
β”‚Β Β      └── index.html
β”œβ”€β”€ src
β”‚Β Β  └── foo_dash
β”‚Β Β      └── core.cljs
my foo-dash.cljs.edn looks like this:
^{:css-dirs ["resources/public/css"]}                                                                   
{:main foo_dash.core}    
My deps.edn
{:deps {com.bhauman/figwheel-main {:mvn/version "0.2.5"}
        com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
        reagent {:mvn/version "1.0.0-alpha2"}}
 :paths ["src" "target" "resources"]}
I run:
$ clojure -m figwheel.main
I get the main figwheel webpage and a repl. Nice, that works. But when I do:
$ clojure -m figwheel.main --build foo-dash --repl
I see my index.html, but no repl... What am I doing wrong here that I never get a REPL?
2020-05-18 23:13:37.941:INFO::main: Logging initialized @3499ms to org.eclipse.jetty.util.log.StdErrLog
[Figwheel] Compiling build foo-dash to "target/public/cljs-out/foo-dash-main.js"
[Figwheel] Successfully compiled build foo-dash to "target/public/cljs-out/foo-dash-main.js" in 0.537 seconds.
[Figwheel] Watching paths: ("src") to compile build - foo-dash
[Figwheel] Starting Server at 
[Figwheel] Starting REPL
Prompt will show when REPL connects to evaluation environment (i.e. a REPL hosting webpage)
Figwheel Main Controls:
          (figwheel.main/stop-builds id ...)  ;; stops Figwheel autobuilder for ids
          (figwheel.main/start-builds id ...) ;; starts autobuilder focused on ids
          (figwheel.main/reset)               ;; stops, cleans, reloads config, and starts autobuilder
          (figwheel.main/build-once id ...)   ;; builds source one time
          (figwheel.main/clean id ...)        ;; deletes compiled cljs target files
          (figwheel.main/status)              ;; displays current state of system
Figwheel REPL Controls:
          (figwheel.repl/conns)               ;; displays the current connections
          (figwheel.repl/focus session-name)  ;; choose which session name to focus on
In the cljs.user ns, controls can be called without ns ie. (conns) instead of (figwheel.repl/conns)
    Docs: (doc function-name-here)
    Exit: :cljs/quit
 Results: Stored in vars *1, *2, *3, *e holds last exception object
[Rebel readline] Type :repl/help for online help info
Opening URL 
Then it just sits there, no repl...


@qmstuart does a browser pop open?


it does, and it disp;lays my Hello, World! with red text from my css


and if you reload the browser no change?


I think I'm obviously misunderstanding how the .edn files are used


I think you are doing ok actually


look in the web inspector console of the browsers devtools


Loading failed for the <script> with source "".
Why it would be looking for a file from the tutorial I went through?


ah, i bet i've copied the index.htnml


and not chnaged it


yeah if you get rid of the index.html entirely it should work


how should i be naming things? I've noticed I put _ and - in my folder names, which is confusing me.


should i avoid - and _ ?


that’s a clojure thing


or just treat it how I do in Clojure when using dashes and underscores with namespaces


oh, so its just the same?


did you see what I said about getting rid of the index.html entirely?


figwheel will make one for you


and it provides a div on the page with an β€œapp” id that you can write to


thats to help you bootstrap


once things get rolling you can create your own html page with a reference to your main.js


but if you use the figwheel index page first its easy to copy it and modify it


great, thanks!


i'm pretty new to front end stuff