Closed karneaud closed 8 years ago
Could you provide more information on what problem you're having? You're expecting it to reload when namespaced Clojure files are changed, right?
Could you also provide a sample project that replicates the issue?
here is my project I'm trying to understand your documentation but it seems so vague in its statements..
I'll take a look. What parts are vague?
how the auto-reload and refresh are used and works....does it only do clj? cljs? can you define multiple paths? where does it get its path from? as defined in the project.clj?
Well, :auto-reload?
"automatically reload modified source files", while auto-refresh?
"automatically refresh the browser when source or resource files are modified".
So :auto-reload?
only works with Clojure files. It reloads files on the server. :auto-refresh?
looks for any changes to source or resource files. Typically this means any file in src
and resources
.
I've checked out your project. The reason it's not working is because your js/main.js
file is throwing an error. This appears to be stopping the refresh script from running. If you remove your script tag, then the auto-refresh behavior starts working again.
Incidentally, since you're using ClojureScript, have you considered using Figwheel?
@weavejester been trying to use fig wheel but it is nothing meeintg my needs as I need to watch more than just clj files and seems to render the :auto-reload and :auto-refresh triggers useless. I'm new to the clojure language and wanted to fiddle around with the basics before i get committed with frameworks
if I remove the script tag then how will my code work?
Well, ideally you should fix your script. Your script is throwing an error, and this is stopping the :auto-refresh?
behavior from working.
@weavejester just did.....still no refresh OR reload with both options set to true. Is it that I need to specify paths in the ring options? because I specify them only in the project root config.
Tried editing the file src/clj/templates/footer.clj....not sure what I'm doing wrong at this point
It's your ClojureScript that's causing the problem. It looks like it's throwing an error in your repl-connect
function.
However, I believe the ultimate cause of your refresh issues is because both your script and the Ring-Refresh library are attempting to set the onload
property of the window. Effectively your script is overriding the refresh script.
The Ring-Refresh script should be more robust, ideally, but you can work around this problem by using addEventListener
instead:
(.addEventListener js/window "load" #(do (em/wait-for-load (init)) (repl-connect)))
Thanks man! that really did the trick....can't believe that it was this causing the issue all along!
Have been trying to automate my ring server without success the following is a snippet my project.clj
server side
what could be the problem? I saw that there were similar issues ....were these bug fixed?