This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-02-26
Channels
- # aleph (2)
- # aws-lambda (18)
- # beginners (81)
- # boot (3)
- # cider (25)
- # cljs-dev (274)
- # cljsjs (10)
- # clojars (25)
- # clojure (65)
- # clojure-austin (1)
- # clojure-brasil (2)
- # clojure-dev (33)
- # clojure-dusseldorf (6)
- # clojure-gamedev (3)
- # clojure-italy (17)
- # clojure-poland (3)
- # clojure-russia (7)
- # clojure-spec (48)
- # clojure-uk (45)
- # clojured (1)
- # clojurescript (26)
- # core-logic (2)
- # data-science (4)
- # datascript (6)
- # datomic (58)
- # defnpodcast (2)
- # docker (1)
- # duct (14)
- # figwheel (2)
- # fulcro (130)
- # graphql (3)
- # leiningen (1)
- # liberator (15)
- # luminus (5)
- # nrepl (1)
- # numerical-computing (1)
- # off-topic (45)
- # onyx (15)
- # re-frame (9)
- # reagent (3)
- # ring (1)
- # shadow-cljs (91)
- # spacemacs (8)
- # sql (23)
- # unrepl (38)
- # videos (2)
- # vim (12)
Just getting started taking shadow-cljs for a test spin. Hot reload doesn't seem to be working, though the when I change the code it does recompile and show a warning on the HUD. Any thoughts on how to diagnose the issue? I'm guessing I just misconfigured something.
:browser
@dave.dixon I think you need to provide a function for :after-load
and :preloads [shadow.cljs.devtools.client.hud]
in :devtools
.
{:source-paths ["src"]
:dependencies []
:builds {:browser {:target :browser
:output-dir "target/browser"
:modules {:main {:entries [app.main]}}
:devtools {:after-load app.main/reload!
:preloads [shadow.cljs.devtools.client.hud]
:http-root "public"
:http-port 8080}}}}
I use this as minimal setup and it worksYep. that did it, thanks. Not sure why that should be, seems like it should hot reload regardless whether I specify an explicit :after-reload
, but whatever, it works.
Thanks. I managed to read everything but the "TIP" at the end of section 5.2.3 it seems. Maybe consider moving that to the beginning, because I read 5.2.2 as "shadow-cljs watch build-id" was all you needed to do to enable hot reload.
@dave.dixon hot-reload must be enabled by either a callback or :autoload true
.
@doglooksgood yes and no. depends on the kind of post-processing that is done
my step is create project with react-native init Hello
then cd Hello
, run shadow-cljs init
.
edit shadow-cljs.edn
to
...
:builds
{:app {:target :npm-module
:output-dir "js/"}}
And require js/hello.core.js
in App.js
.how can I specify where it connect to? I think JS runtime(on mobile) and shadow-cljs(on MBP) run on different IPs.
@thheller It works, expect one problem. since there's no document in react native, there will be a error for Can't find variable: document
. But after I dismiss this error, it works.
just thinking that the best way about this would be to completely bypass the react-native packager
https://github.com/callstack/haul seems to do it but I haven't looked into how
@thheller I think the hmr works as expectef without any problem, and the next two things are source map and repl. by tweak a little the repl works, there's no need to introduce additional tools.
well. source maps probably do not work because files are processed by the react packager
that will be a huge work to do. i think we can do now is just having a condition to ensure no error when there's no js/document
.
the point is that shadow.cljs.devtools.client.browser
is meant for the browser. react-native is not a browser.
I will not start adding some conditional hacks to make it work but then having to think about every potential future change because it might not work
I much rather write a shadow.cljs.devtools.client.react-native
version. that uses every capability react-native has.
I saw there's a path like hello/core.cljs
in source map, is that a relative path? in chrome, the src
is not include in souces
, there're node_modules
and js
(output dir). do you have any thought on this?
i mean my source path is src
, but in chrome Sources
section, there're only two folder: node_modules
and js
.
i think the path in source path may be wrong, in my case it is hello/core.cljs
, i think it shoud be ../src/hello/core.cljs
I want to introduce react-native + shadow-cljs to my workmates. I think this is a awesome solution. the re-natal is really complex, at least it looks complex.
never used re-natal but I think its the most commonly used tool for cljs+react-native
it does a lot of shim job, because you can't use figwheel with react-native in a trivial way.
Trying out shadow-cljs for the first time and really loving it over Boot's CLJS stuff. Running into a warning using re-frame-10x:
11:41:42 CLJS | ------ WARNING #1 --------------------------------------------------------------
11:41:42 CLJS | File: day8/re_frame_10x/view/parts.cljs:26:28
11:41:42 CLJS | --------------------------------------------------------------------------------
11:41:42 CLJS | 23 | :children [[:h1 "Events"]
11:41:42 CLJS | 24 | (render-registered re-frame.events/kind)
11:41:42 CLJS | 25 | [:h1 "Subscriptions"]
11:41:42 CLJS | 26 | (render-subs re-frame.subs/kind)
11:41:42 CLJS | ----------------------------------^---------------------------------------------
11:41:42 CLJS | Use of undeclared Var re-frame.subs/kind
Has anyone else ran into this? It doesn't make sense given re-frame is in my :dependencies
.nah shadow-cljs is just stricter than other tools and the file has no require for re-frame.subs
so it complains
https://github.com/Day8/re-frame-10x/blob/master/src/day8/re_frame_10x/view/parts.cljs
Is anyone using devcards with shadow-cljs? I can't get any of my cards to appear until I load the namespace in the REPL. I am requiring me devcards namespace and have set :devcards
to true in my :dev
:compiler-options
.
Eh, just realized all we were using devcards for was card styling to demo our components. I just rolled our own version instead.
I've used devcards successfully with shadow-cljs. I just created a separate build config for devcards, and a separate entrypoint namespace, and it worked pretty well.