This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-08-09
Channels
- # announcements (4)
- # babashka (2)
- # beginners (8)
- # calva (2)
- # chlorine-clover (7)
- # cider (3)
- # clj-kondo (1)
- # cljs-dev (2)
- # clojure (21)
- # clojure-dev (2)
- # clojure-europe (5)
- # clojure-spec (17)
- # clojuredesign-podcast (7)
- # clojurescript (8)
- # conjure (4)
- # cursive (3)
- # datomic (1)
- # defnpodcast (5)
- # esprit (51)
- # fulcro (7)
- # jobs (1)
- # luminus (3)
- # news-and-articles (1)
- # off-topic (2)
- # other-lisps (3)
- # pathom (8)
- # portal (3)
- # re-frame (3)
- # re-ops (1)
- # shadow-cljs (26)
- # testing (15)
- # tools-deps (34)
- # xtdb (1)
Hey everone. Is there a way to create a custom target configuration? I am trying to get shadow to work with building for Espruino, a JS runtime for microcontrollers. The esprit project accomplishes this by just using cljs.main, but I would like to use shadow for the better integration of external js. I can't quite figure out how to make shadow just accomplish clj -m cljs.main -c myproject.core
As in, I don't want to wrap in any extra stuff like the repl or hot reloading
@me1310 yes, :target
is extensible and meant to enable things like this. Its just not documented very well so writing it may be not so straightforward. do you have an example project for this? would be curious to know what the runtime is capable of. I saw Mike tweeting about about it but haven't looked into it myself yet.
Yeah, I'm working on a simple project here. I'm using make to orchestrate some of the flashing as well
AFAIK no one has tried to like make a project like this yet, Mike's examples were all fooling around in the repl
But I fixed some bugs for him to make it such that "projects" like this just work
In fact, I have CIDER working, and can live code on the device, which is frankly incredible
Its like its own thing https://www.espruino.com/
And its not a perfect implementation of the runtime, I had to muck around with cider's wrap fn as it's implementation of try/catch isn't quite correct
@thheller Do you have an example bare-minimum target I can follow?
Ooh also Espruino provides an npm module that actually does a lot of the heavy lifting, including hot code reloading
https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/build/targets/node_script.clj
Nice, I'll take a look
And so, is this something I need a fork to do? Or is there a mechanism to point to a custom target clj file
someone made a :target
not too long ago. maybe that helps too https://github.com/titonbarua/shadow-cljs-gjs-target
no you just create a namespace with a process fn, then :target that.namespace
just works
oh sweet, thats easy
basically that fn is called repeatedly with :shadow.build/stage
changing and you doing stuff depending on the stage
some of the hooks docs apply too. its pretty similar in structure https://shadow-cljs.github.io/docs/UsersGuide.html#build-hooks
Cool, makes sense