This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-14
Channels
- # asami (1)
- # babashka (50)
- # beginners (70)
- # bristol-clojurians (6)
- # calva (36)
- # chlorine-clover (1)
- # cider (4)
- # clj-kondo (3)
- # cljdoc (49)
- # cljsrn (5)
- # clojure (96)
- # clojure-australia (3)
- # clojure-dev (1)
- # clojure-europe (84)
- # clojure-nl (4)
- # clojure-spec (9)
- # clojure-uk (65)
- # clojurescript (31)
- # community-development (6)
- # conjure (17)
- # cursive (8)
- # datascript (5)
- # datomic (12)
- # duct (3)
- # emacs (18)
- # figwheel-main (2)
- # fulcro (7)
- # helix (1)
- # jobs (3)
- # luminus (7)
- # off-topic (77)
- # pathom (3)
- # portal (1)
- # rdf (4)
- # re-frame (1)
- # reitit (4)
- # remote-jobs (4)
- # reveal (15)
- # rum (1)
- # sci (38)
- # shadow-cljs (22)
- # spacemacs (1)
- # specter (6)
- # sql (1)
- # test-check (1)
- # tools-deps (60)
- # vim (12)
Hello! Did anyone try to use shadow-cljs from devcontainers? I found that it works much better than WSL but hot reloading is not working for some reason. Any ideas why could it be?
I haven't, but just in case you didn't know: shadow-cljs, npm, and clojure run perfectly fine directly on Windows. No need for either WSL or any kind of container
but by having container in the name I'm assuming its virtualized which might mean that file watching doesn't work
{:nrepl {:port 8777}
:source-paths ["src/cljs"]
:fs-watch {:polling true}
:builds {:app {:target :browser
:output-dir "resources/public/js/compiled"
:asset-path "/js/compiled"
:modules {:app {:init-fn mui.core/init}}
:autobuild true
:devtools {:http-root "resources/public"
:http-port 8280
:autobuild true
:preloads [devtools.preload]}}}
:devtools {:after-load mui.core/start}}
Is it correct?@U05224H0W Can I see somehow this config? https://github.com/thheller/shadow-cljs/blob/b05b8f41afd45564ef7b9831a07201d09a5c4a07/src/main/shadow/cljs/devtools/server/fs_watch_hawk.clj#L43
oh hmm right that might mean that :polling true
doesn't actually do anything since it is a hawk only option 😛
I found the solution https://github.com/wkf/hawk/issues/10#issuecomment-173656507 and tried it with Hawk. For now I'll try to force Hawk in the container
Yes, it's working! @U05224H0W, could I create a pull request?
for forcing the use of Hawk in config
I've made a change into the shadow.cljs.devtools.server.fs-watch
file
- (if (and (str/includes? os-name "Mac") (not (false? (:hawk config))))
+ (if (not (false? (:hawk config)))
and config
:fs-watch {:watcher :polling
:hawk true}
After these changes, hot reloading finally started to work!By default hawk is false so there is shouldn't be a problem
Thank you so much for your help! Should I create an issue instead? It still needs to be supported in the codebase since devcontainer is a Docker container and OS in it is Linux and it will fail (str/includes? os-name "Mac")
precondition.
It's just a docker container with needed runtime and vscode service.