This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-19
Channels
- # 100-days-of-code (5)
- # announcements (1)
- # aws (1)
- # beginners (112)
- # cider (135)
- # cljdoc (6)
- # clojure (111)
- # clojure-dev (8)
- # clojure-italy (3)
- # clojure-nl (5)
- # clojure-sweden (3)
- # clojure-uk (152)
- # clojurescript (101)
- # datascript (14)
- # datomic (61)
- # editors (1)
- # emacs (29)
- # events (7)
- # figwheel (3)
- # figwheel-main (15)
- # fulcro (18)
- # funcool (2)
- # graphql (1)
- # juxt (2)
- # off-topic (51)
- # om (1)
- # overtone (28)
- # perun (2)
- # reagent (1)
- # reitit (6)
- # ring-swagger (5)
- # shadow-cljs (112)
- # spacemacs (49)
- # tools-deps (10)
- # unrepl (11)
- # yada (10)
Hi! We're testing cljs with npm modules (through webpack) and ran into a small reloading woe yesterday. We have a large js codebase, so the js reloading story was marked as important++.
Like the nom tutorial, there's a src/js/index.js
and webpack generates /dist/index.bundle.js
Using just cljs.main, (and manually setting foreign libs) we were able to pass a -w src:list
to have index.bundle.js
watched by the compiler.
Using figwheel.main, (either setting things manually or using the extremely nice :npm
option ❤️), we couldn't find a straightforward way to have the bundle watched.
We expected those to be watched automatically, but when that didn't happen we tried setting up watch-dirs
. Figwheel complains that there are no cljs files on the bundle folder and doesn't start.
Our current workaround (no one is proud) is to add /dist/fake/core.cljs
file (with a fake namespace as well). The watch option is then forwarded to the cljs compiler, and the bundle is correctly watched.
Figwheel doesn't detect and reload the cljs ns's that depend on the changed foreign dependencies, but I'm not sure that's within its goals.
Are we missing something?