lein new re-frame my-app
template had a major new release today. It now creates a pure shadow-cljs
build using shadow-cljs.edn
and package.json
as the source of configuration. Appreciate any testing, feedback, issues or PRs from the shadow-cljs community to improve it further.
https://github.com/day8/re-frame-template
nice! one thing you might want to consider is using npm-run-all
and cross-env
like this setup does https://github.com/jacekschae/shadow-cljs-tailwindcss/blob/main/package.json#L2-L10
cross-env
to make things work in windows, since it doesn't support the FOO=thing
env vars otherwise
npm-run-all
contains the run-p
and run-s
utils to run things in parallel or sequentially
(might be useful if you ever intend to add something like that)
https://github.com/mysticatea/npm-run-all/blob/HEAD/docs/run-p.md
also please consider updating the use of the :devtools
:http-root
and :http-port
. they have been deprecated for years and :dev-http
should be used instead https://shadow-cljs.github.io/docs/UsersGuide.html#dev-http
thanks for the link re npm-run-all
/ cross-env
, that will be very helpful.
I'll fix the :devtools
usage now.
:dev-http {8280 {:root "resources/public" :handler foo.bar}}
would be the handler variant
Thanks, but have removed the handler support as we decided to focus purely on the best possible client side experience (being a 're-frame' template) and leave the backend impl to other projects.
I have released v2.0.1 that fixes the deprecated use of devtools
, uses dev-http
.
thanks
does the top-level :build-hooks
actually work? I can't remember 😛
:build-defaults {:build-hooks ...}
should but otherwise no right?
oh ops; maybe I messed up the template
Thanks for spotting that @thheller. v2.0.2 is releasing on ci now, will be live in 10 minutes. Tested w/ build-defaults
and the version is set correctly.
How do I keep my package.json updated? I updated my cljs dependencies, how do I prune and update the JS packages they were depending on?
manually checking it I guess? shadow-cljs provides no tools to do so
How can I get a 'nice' stand-alone terminal REPL going with shadow-cljs? Ideally something like https://github.com/bhauman/rebel-readline
you only get a basic REPL for the terminal. most people use REPL provided by their editor so terminal REPL hasn't had much work
not aware of anyone working on one either
My favorite way is yarn upgrade-interactive --exact
Alright. How would I go about making one?
I'm thinking it shouldn't be that much work to add at least basic readline support/autocompletion to the existing one
you could build one on top of nrepl, maybe using cider-nrepl. then you basically get all the features that has out of the box and you just write the readline code
alright
is the basic shadow-cljs repl talking to an nrepl server, or is it hosting one?
no the basic repl is using a plain streaming socket repl. thats why it has basically no extra features
if you have a shadow-cljs server
or shadow-cljs watch
running you can find the nrepl port via the .shadow-cljs/nrepl.port
file
alright
nrepl is a fairly simple protocol so should be easy to do
right yeah
would it be possible to instead hook into the existing shadow-cljs command? so I wouldn't have to keep track of two services
i.e. could I extend it with my own command that runs my REPL and also manages a shadow-cljs server?
that would be something your tool would do
I mean since that needs to control the input stream to hook up the readline stuff
if you run the shadow-cljs command separately or from whatever process you launch is your choice
alright