Fork me on GitHub
#shadow-cljs
<
2018-03-04
>
tianshu03:03:38

@chris_johnson following this can make it work with reload and repl

Chris Bidler16:03:47

Well, I followed the directions as closely as I could manage and I got this:

hlolli16:03:18

why would cljs.env/*compiler* return nil in the node-repl? required or not

thheller16:03:18

@hlolli this is not self-hosted. inside cljs cljs.env/*compiler* is NEVER initialized

hlolli16:03:11

yup, clear sign I'm trying to run code from lumo 🙂

thheller17:03:37

you can get to it inside a macro but I would not advise using it too much

thheller17:03:23

@chris_johnson oops I think I broke it with the last commit I added. that didn't use to be there

thheller17:03:34

you can set :devtools {:enabled false} if you want to play around but REPL won't work

thheller17:03:10

there are some things to consider for react-native which I haven't yet implemented

thheller17:03:34

pure :npm-module will work but not the REPL or built-in live reload

hlolli17:03:39

I was asking on #clojurescript about macro namespace reload, but I see now, that shadow-cljs node-repl has automatic macro namespace reload, very nice!

thheller17:03:13

that is actually accidental 😛

thheller17:03:36

usually shadow-cljs clj-repl (require 'that.ns :reload)

hlolli17:03:33

yeh, its nice, because I see that functions I wrote in lumo differ enormously in non-selfhosted node repl. So this macro namespace needs much cleaning, auto reload saveing me potentially some hours.

thheller17:03:40

since its clojure you can just work on it on a clojure repl

thheller17:03:55

but yeah that gets tricky when you want to use cljs.env

Chris Bidler17:03:24

@thheller hey no worries, I understand that it’s not meant to be a supported use case yet. I just have a dev lead whose hair is slowly heating to ignition temperature dealing with the friction of our current RN project setup, and another team in this same shop that is having a delightful experience with Shadow so far, so I thought I would spend some time investigating if I could borrow some awesome for my RN team.

Chris Bidler17:03:27

I’m honestly surprised that that turned out to be a bug and not just that I like, cleaned the project or restarted Metro but not hard enough or something like that

Chris Bidler17:03:12

“You said ‘rebuild dependency graph’ but I could tell your heart wasn’t in it, so I stopped partway through” — React Native toolchain, late 2017

thheller17:03:56

yeah just disable the :devtools for not and remove the import of shadow.cljs.devtools.*

thheller17:03:08

then it should work fine with the usual built-in RN stuff

thheller17:03:34

caching is hard 😉