Fork me on GitHub
#chlorine
<
2020-09-15
>
henrik08:09:47

I’m not exactly sure where to start with this one: errors when saving .cljc files. This happens regardless of which file this is, when evaluation is set to prefer-clj or clj. When set to full refresh, the error is

java.io.FileNotFoundException: "Could not locate clojure/tools/namespace/repl__init.class, clojure/tools/namespace/repl.clj or clojure/tools/namespace/repl.cljc on classpath."
When set to simple, the error is
java.lang.IllegalArgumentException: "No value supplied for key: true"
It appears to happen when there are #?(:cljs in the requires part of the ns declaration. When those are removed, it seems to work.

henrik08:09:16

For example,

(:require
   [clojure.string :as string]
   [com.rpl.specter :as sp]
   #?(:cljs [goog.dom :refer [getElement]])
   #?(:cljs [goog.dom.Range :refer [createCaret]])))

mauricio.szabo14:09:42

Well, that's not expected. Let me see if I can reproduce it... The first problem is probably because you don't have clojure.tools.namespace on the classpath

henrik07:09:55

Is it generally recommended to have it on the classpath?

mauricio.szabo14:09:19

For Chlorine, if you want to use "full refresh" (on save or not), it is required. To be honest, I'm thinking about removing all refresh-related code: it's easier (and more configurable) to do it by custom configurations...

mauricio.szabo14:09:07

(also, you can disable "refresh namespaces on save", it's a config on the plug-in)

seancorfield17:09:30

(I generally recommend everyone turns off the refresh stuff 🙂 )

henrik07:09:59

Oh, OK! What’s your workflow for reloading the code? Just load-file?

seancorfield16:09:29

@U06B8J0AJ I evaluate every change as I make it -- usually with "evaluate top-level block" -- I don't even bother saving the files while I'm working and evaluating changes.

borkdude15:09:20

Same here . The REPL reloading stuff is a headache - I gave it a couple of tries, but quite happy with either eval-ing forms or the entire buffer.

borkdude15:09:05

For some things I don't bother with editor integration and I simply use (require '[...] :reload) or (require '[...] :reload-all), from a REPL. This is not my day to day setup, but it works effectively. The simplest tooling one can have