@thheller have you made any progress with :target :esm
and watch
? is there anything I could help with in that direction?
watch works fine but I assume you mean hot-reload? that is runtime dependent and not implemented for deno
basically what is need is an equivalent to this https://github.com/thheller/shadow-cljs/blob/f7a360d52dfae654ff17d7a5335943beabaf163c/src/main/shadow/cljs/devtools/client/node.cljs
just using deno not node specific stuff
if you want to work on that you can do so by setting :target :custom :devools {:client-ns the.ns-you-work-on}}
in your build config
its not documented much but happy to answer questions. it is fairly low level code but pretty straightforward.
Having some troubles with using clojure.data.csv in a macro. Been following the approach in this guide: https://code.thheller.com/blog/shadow-cljs/2019/10/12/clojurescript-macros.html
I have a load.clj
:
(ns load
(:require [clojure.data.csv :as csv]
[<http://clojure.java.io|clojure.java.io> :as io]))
(defmacro timeline
[]
(with-open [reader (io/reader (io/resource "timeline.csv"))]
(doall (csv/read-csv reader :separator \;))))
and a load.cljs
:
(ns load
(:require-macros [load]))
but when I try to require and then use it from my user.cljs
, e.g.,
(ns user
(:require [load :as load]))
(def timeline-data
(load/timeline))
I get an error which seems to be related to the amount of lines in the csv file (433)However, if I wrap replace the use of the macro with (macroexpand '(load/timeline))
then it works. I’m sure I’m just doing some n00b macro error here.
be mindful of what that macro is returning. right now it is returning a sequence ala ([1 2 3] [3 4 5])
so it will be executed as such when compiling, ending up as an actual function call. swap the doall
with a vec
and it should be ok
ahhhh. I knew it was something silly like that. Thanks! And thank you for the guide too.