Fork me on GitHub
Oliver George01:05:09

Not sure what the cause of your error is. I'm surprised if it crashes if you follow the tutorial carefully.

Oliver George01:05:24

But I can tell you why, after the error, it ends in an odd state

Oliver George01:05:42

Essentially the RN strategy is to unmount your app if you don't catch the error.

Oliver George01:05:55

Krell doesn't do that for you, you can write a little app wrapper and do that yourself.

Oliver George01:05:18

(Or my quick assessment of your problem is wrong... I'm shooting from the hip)

Oliver George01:05:10

@adamtait starting fresh with clojurescript and react native at the same time is bold.

Oliver George01:05:23

Krell is still pre-alpha really.

Oliver George01:05:39

Good to avoid re-natal in my opinion. That's getting long in the tooth.

Oliver George01:05:51

Krell should be a great solution. Not far from having all it needs.

Oliver George01:05:07

Shadow CLJS is another option which I just haven't used but is popular.


Thanks @olivergeorge. I hadn’t thought about adding an exception handler; both your notes and code were very helpful.


I was able to solve the problem by updating deps.edn to reference the most recent io.vouch/krell sha, rather than the sha included in the wiki tutorial.

io.vouch/krell {:git/url ""
                  :sha "00b46eaf9e973d62444d09e2dee43b6bb7b3c318"}
The exception stack trace failed at but eventually led me to, which it looked to have been updated recently. Hope this is helpful, in case anyone else runs into the same issue.

Oliver George05:05:21

Well done. Yeah, I'm running the latest sha too.


I'll point to the latest sha, thanks


As discussed yesterday, I got a decent amount of the way to connecting Emacs-Cider-nREPL-Krell, but not the whole way.


I can start up nrepl with clj -Sdeps '{:deps {nrepl {:mvn/version "0.6.0"} refactor-nrepl {:mvn/version "2.4.0"} cider/cider-nrepl {:mvn/version "0.22.0-beta8"}}}' -m nrepl.cmdline --middleware '["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"]' (mostly just copied from cider-jack-in)


I’ll share what I’ve done, but still not 100% either

👍 4

Then I can connect to the simulator with: (require '[cider.piggieback] '[krell.repl]) and (cider.piggieback/cljs-repl (krell.repl/repl-env :port 5001 :watch-dirs ["src"] :connect-timeout 30000 :output-dir "target"))


What I definitely am not able to do is trigger a compile (the equivalent of the -c option for krell/cljs.main)


This is wrong, but this is where I got up to, and then didn’t bother poking further: eval this in Emacs: (setq cider-custom-cljs-repl-init-form "(do (require 'cljs.main) (require 'krell.repl) (cider.piggieback/cljs-repl (cljs.main/-main \"-re\" \"krell.repl\" \"-co\" \"build.edn\" \"-c\" \"-r\")))") M-x cider-jack-in-cljs When the REPL starts, it prompts you for the REPL type, at which point I choose custom and then for the device number. Then the REPL is mangled, as in you still see user> and you keep constantly seeing Stdin: prompt in the minibuffer which passes the values to cljs.user=> prompt. Obviously, this is not working correctly, but I don’t really have the time to figure it out. So maybe somebody can look at this, and go ewww, and create the correct setup and share it here 🙂


(Edited the above ☝️ as you need to specify custom REPL type at the prompt).


Yeah, I hit that, and I assume that’s because the cljs.main REPL env uses stdin for input, so that’s why I ended up where I did with the krell.repl/repl-env.


@joshmiller sounds like you got it working? I don't know what you mean by -c


that's not a REPL feature


Krell hot-reload now recompiles direct dependents, can be configured to recompile all dependents

👍 4

@dnolen I mean that I can’t kick off a compile when starting up the REPL, so need to do it in a second step. But maybe the hot-reload step can handle that for me.


right Krell doesn't do that, it's not like Figwheel and I'm unlikely to add anything like it


Krell is just a simple REPL - you can compile things in the usual way - that's it - no extras stuff besides hot loading


also you don't need two steps


same as ClojureScript


clj -m krell.main -co build.edn -c -r


that compiles then starts a REPL


(I was interpreting your comment as being able to start a build once the REPL is up)


Right, but I’m starting nREPL instead of krell.main, so the -c opt isn’t being passed along to cljs.main. I was trying to find a way to do that all in one go.


I don't think you need nREPL to do this


what you're missing is a simple Krell fn to start a build


So before I piggieback on krell.repl/repl-env I should have something to kick the build off, at the Krell level?


an easy one I'll try to add it tomorrow

👍 12

Awesome, thanks


I think that compile fn will need to accept the compile-opts being passed to cljs.main as well (what’s in build.edn in a basic Krell app); if I’m wrong and that should be provided elsewhere, let me know.

Oliver George23:05:59

I think there's a bug in loading repl-options from an EDN file but I might be doing something wrong.

Oliver George23:05:44

[email protected] krell-repros % cat repl-options.edn 
{:recompile :all}
[email protected] krell-repros % clj -m krell.main -ro repl-options.edn -co build.edn -v -c -r
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See  for further details.
java.lang.IllegalArgumentException: No value supplied for key: [:recompile :all]
	at clojure.lang.PersistentHashMap.create(
	at krell.repl$repl_env.invokeStatic(repl.clj:445)
	at krell.repl$repl_env.doInvoke(repl.clj:445)