Fork me on GitHub

@bhauman First attempt at Cursive documentation is PR’ed - if I have the time tomorrow I will try and tackle the combined project, let me know if you want anything changed (or feel free to change it yourself as desired). I’m planning to also get some screenshots and maybe a gif of the steps if I can figure out a nice way to do it.


Hey! I'm having issues using ^{:watch-dirs ..} when using extra-paths in my alias. Somehow first compilation fails and I get goog.require could not find: .. errors. Nothing specific in the REPL. Is there a way to access more logs to troubleshoot this?


Also figwheel log file is not generated.


Oh actually figured I have to put the whole paths in watch-dirs, not just the specific path I am interested with.


When I compile a production build with these settings:

:foreign-libs [{:file "../foo/bar.js",
                 :provides ["react"
                 :global-exports {react React
                                  react-dom ReactDOM
                                  create-react-class createReactClass}}]
a funny thing happens: it creates a directory foo/ in the cwd and copies the files there


My expectation is that the compiler uses ../foo/bar.js. Is this because I'm using a file that is outside the cwd?


Not sure if it's figwheel or the cljs compiler that's doing that. The funny thing is that this doesn't seem to happen with dev builds


@pesterhazy yeah figwheel doesn’t do anything with these opts they just get apssed to the compiler, so you are looking at the compilers behavior


Hey there, is it possible to use figwheel-main to hot reload server code? If not, any suggestions how I might go about that?


@jstaab AIUI that's not figwheel's job (it's about ClojureScript). So figwheel is orthogonal to server-side reloading, and you can use the same techniques you'd use otherwise for reloading server code in a JVM that also runs Figwheel


Ok, thanks — I have more questions on how to do that in general, but I'll move this to the appropriate channel simple_smile. Any suggestions on where to take the discussion?


Does integrant do hot code reloading?


I guess maybe integrant/repl with something like hawk for watching files?


Integrant may be a good starting point yes


One thing to consider is whether you really want a file-watching based dev cycle


Usually with Clojure is super easy to just connect to the running repl and re-evaluate the current buffer


The advantage is that you get compile errors etc. right there in your Emacs buffer (or Atom or ....)


The final step then is to restart the web server, which is sometimes required (e.g. when you change the routes)


You can do that from repl too, or have some kind of hook that executes after reloading the buffer


Is there an example out there I could take a look at? I've never quite grokked the whole "live in the repl" lifestyle with lisps.


It’s an excellent intro to the repl


And to clarify, file-watch based vs reload buffer from editor is just a matter of resources? or control of when/if something gets reloaded?


@jstaab I've got integrant working nicely with figwheel-main - not auto-reload, but on each change it's easy to refresh with a command in the repl. is a good video introduction for Integrant is a good video for repl based development


I'll check those out, thanks


@jstaab I've not experimented with it, but figwheel-main also has an option for reloading Clojure files - No idea how it would work for what you are looking for, though


I'm actually using shadow-cljs for my client-side stuff; I was only looking at figwheel-main because it was the word in my head associated with "hot reloading"


But maybe switching to figwheel would give me a more coherent setup


If you're looking for server side, I think figwheel vs. shadow-cljs is probably the wrong place to spend time on - they are both pretty much concerned with the client side. I've been really happy with Integrant for the server side aspect but there are definitely other options (mount, component, etc).


Ok, Integrant is pretty nice, I think I'm almost to a working solution. And it seems like if I want to go file-watch mode, it should be easy to bolt onto the user.clj namespace


Thanks for the help!

👍 4