Skip to content

Commit 0bdeb56

Browse files
committed
unify shadow and deps.edn build config/tooling
1 parent 6198a14 commit 0bdeb56

File tree

5 files changed

+52
-37
lines changed

5 files changed

+52
-37
lines changed

README.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,12 +483,24 @@ The great thing about static sites is that they are easy and cheap to deploy and
483483

484484
## Local CLJS development
485485

486-
Oz is now compiled (on the cljs side) with [Shadow-CLJS](http://shadow-cljs.org/).
487-
A typical workflow involves running `shadow-cljs watch app devcards`.
488-
This will compile both the `app.js` and `devcards.js` compile targets (to `resources/oz/public/js/`), meaning you can run the REPL/JVM tooling locally, and it will serve up the latest edition of the `app.js` for calling `view!`, etc.
489-
But also, visiting <https://localhost:7125/devcards.html> will pull up a live view of a set of example components defined at `src/cljs/oz/core_devcards.cljs`.
486+
Oz is now compiled (on the cljs side) with [Shadow-CLJS](http://shadow-cljs.org/), together with the Clojure CLI tooling.
487+
A typical workflow involves running `clj -M:shadow-cljs watch devcards app` (note, older versions of `clj` use `-A` instead of `-M`; consider updating).
488+
This will watch your cljs files for changes, and immediately compile both the `app.js` and `devcards.js` targets (to `resources/oz/public/js/`).
489+
490+
In general, the best way to develop is to visit <https://localhost:7125/devcards.html>, which will pull up a live view of a set of example Reagent components defined at `src/cljs/oz/core_devcards.cljs`.
490491
This is the easiest way to tweak functionality and test new features, as editing `src/cljs/oz/core.cljs` will trigger updates to the devcards views.
491492

493+
If it's necessary or desirable to test the app (live-view, etc) functionality "in-situ", you can also use the normal Clj REPL utilities to feed plots to the `app.js` target using `oz/view!`, etc.
494+
Note that if you do this, you will need to use whatever port is passed to `oz/view!` (by default, 10666) and not the one printed out when you start `clj -M:shadow-cljs`.
495+
496+
See documentation for your specific editing environment if you'd like your editor to be able to connect to the Shadow-CLJS repl.
497+
For `vim-fireplace`, the initial Clj connection should establish itself automatically when you attempt to evaluate your first form.
498+
From there simply execute the vim command `:CljEval (shadow/repl :app)`, and you should be able to evaluate code in the `*.cljs` files from vim.
499+
Code in `*.clj` files should also continue to evaluate as before as well.
500+
501+
IMPORTANT NOTE: If you end up deploying a version of Oz to Clojars or elsewhere, make sure you stop your `clj -M:shadow-cljs watch` process before running `make release`.
502+
If you don't, shadow will continue watching files and rebuild js compilation targets with dev time configuration (shadow, less minification, etc), that shouldn't be in the final release build.
503+
If however you are simply making changes and pushing up for me to release, please just leave any compiled changes to the js targets out of your commits.
492504

493505

494506
## Debugging & updating Vega/Vega-Lite versions

deps.edn

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,54 @@
11
{:paths ["src/clj" "src/cljs" "resources"]
2-
:deps {org.clojure/clojure {:mvn/version "1.10.0"}
3-
org.clojure/clojurescript {:mvn/version "1.10.439"} ;; equivalent of :scope "provided"?
2+
:deps {org.clojure/clojure {:mvn/version "1.10.1"}
3+
org.clojure/clojurescript {:mvn/version "1.10.764"} ;; equivalent of :scope "provided"?
44
;; this appears to be necessary for fiwheel to work for some applications
55
org.clojure/tools.reader {:mvn/version "1.3.2"}
66
org.clojure/core.async {:mvn/version "0.4.490"}
7-
cheshire {:mvn/version "5.8.1"}
8-
clj-http {:mvn/version "3.9.1"}
7+
cheshire/cheshire {:mvn/version "5.8.1"}
8+
clj-http/clj-http {:mvn/version "3.9.1"}
99
com.taoensso/sente {:mvn/version "1.13.1"}
1010
com.taoensso/timbre {:mvn/version "4.10.0"}
11+
com.taoensso/encore {:mvn/version "2.120.0"}
12+
devcards/devcards {:mvn/version "0.2.6"}
13+
reagent/reagent {:mvn/version "0.10.0"}
14+
;; consider using this for lazy loading clojupyter stuff
1115
;com.clojure-goes-fast/lazy-require {:mvn/version "0.1.1"}
12-
aleph {:mvn/version "0.4.6"}
13-
ring {:mvn/version "1.8.1"}
16+
aleph/aleph {:mvn/version "0.4.6"}
17+
ring/ring {:mvn/version "1.8.1"}
1418
ring/ring-defaults {:mvn/version "0.3.2"}
1519
bk/ring-gzip {:mvn/version "0.3.0"}
16-
compojure {:mvn/version "1.6.1"}
17-
;hiccup {:mvn/version "1.0.5"}
18-
hiccup {:mvn/version "2.0.0-alpha2"}
20+
compojure/compojure {:mvn/version "1.6.1"}
21+
hiccup/hiccup {:mvn/version "2.0.0-alpha2"}
1922
com.cognitect/transit-clj {:mvn/version "0.8.313"}
2023
com.cognitect/transit-cljs {:mvn/version "0.8.256"}
21-
reagent {:mvn/version "0.10.0"}
22-
;cljsjs/vega {:mvn/version "5.9.0-0"}
23-
;cljsjs/vega-lite {:mvn/version "4.0.2-0"}
24-
;cljsjs/vega-embed {:mvn/version "6.0.0-0"}
25-
;cljsjs/vega-tooltip {:mvn/version "0.20.0-0"}
26-
markdown-clj {:mvn/version "1.10.0"}
27-
hickory {:mvn/version "0.7.1"}
28-
markdown-to-hiccup {:mvn/version "0.6.2"}
29-
;; leave this out; causes dependency issues
30-
;org.clojars.didiercrunch/clojupyter {:mvn/version "0.1.5"}
31-
;; must be above yaml for jvm compilation fix
24+
markdown-clj/markdown-clj {:mvn/version "1.10.0"}
25+
hickory/hickory {:mvn/version "0.7.1"}
26+
markdown-to-hiccup/markdown-to-hiccup {:mvn/version "0.6.2"}
3227
org.flatland/ordered {:mvn/version "1.5.7"}
3328
io.forward/yaml {:mvn/version "1.0.9"}
34-
commonmark-hiccup {:mvn/version "0.1.0"}
29+
commonmark-hiccup/commonmark-hiccup {:mvn/version "0.1.0"}
3530
org.clojure/spec.alpha {:mvn/version "0.2.176"}
3631
irresponsible/tentacles {:mvn/version "0.6.3"}
37-
respeced {:mvn/version "0.0.1"}
32+
respeced/respeced {:mvn/version "0.0.1"}
3833
org.clojure/test.check {:mvn/version "0.10.0"}
39-
hawk {:mvn/version "0.2.11"}
34+
hawk/hawk {:mvn/version "0.2.11"}
4035
metasoarous/darkstar {:mvn/version "0.1.0"}}
4136
;applied-science/darkstar {:git/url "https://github.com/applied-science/darkstar/"
4237
;:sha "ef93147377d09a3894959c2c43faabf1a527a7d5"}}
4338
;timofreiberg/bultitude {:mvn/version "0.3.0"}
4439
;org.clojure/tools.namespace {:mvn/version "0.2.11"}
4540
:aliases {:dev {:extra-paths ["dev"]
46-
:extra-deps {alembic {:mvn/version "0.3.2"}}}
41+
:extra-deps {alembic/alembic {:mvn/version "0.3.2"}}}
4742
;binaryage/devtools {:mvn/version "0.9.10"}}}
48-
:clojupyter {:extra-deps {clojupyter {:mvn/version "0.3.2"}}}
43+
:clojupyter {:extra-deps {clojupyter/clojupyter {:mvn/version "0.3.2"
44+
:exclusions [hiccup/hiccup]}}}
45+
:shadow-cljs {:extra-deps {thheller/shadow-cljs {:mvn/version "2.11.5"}
46+
cider/cider-nrepl {:mvn/version "0.21.1"}}
47+
:main-opts ["-m" "shadow.cljs.devtools.cli"]}
48+
:codox {:extra-deps {codox/codox {:mvn/version "0.10.7"}}
49+
:exec-fn codox.main/generate-docs
50+
:exec-args {:language :clojure
51+
:output-path "docs"}}
4952
:pack {:extra-deps {pack/pack.alpha {:git/url "https://github.com/juxt/pack.alpha.git"
5053
:sha "c70740ffc10805f34836da2160fa1899601fac02"}}
5154
:main-opts ["-m"]}}}

package-lock.json

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"vega-lite": "4.17.0",
1313
"vega-util": "1.16.0",
1414
"vega-embed": "6.12.2",
15-
"vega-canvas": "1.2.6"
15+
"vega-canvas": "1.2.6",
16+
"marked": "1.2.5"
1617
},
1718
"devDependencies": {
1819
"create-react-class": "15.6.3",

shadow-cljs.edn

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
1-
{:source-paths ["src/cljs"]
2-
;:deps true
3-
:dependencies [[reagent "1.0.0-alpha2"]
4-
[devcards "0.2.6"]
5-
[com.taoensso/timbre "4.10.0"]
6-
[com.taoensso/encore "2.120.0"]
7-
[com.taoensso/sente "1.13.1"]]
1+
{:deps true
82
:builds {:lib {:target :browser
93
:output-dir "resources/oz/public/js"
104
:modules {:oz {:entries [oz.core]}}}

0 commit comments

Comments
 (0)