What is this and what will I see, when I run the Dockerfile?
A simple, but interactive event calendar for the city of Mainz, Germany. With search and filters and xhr calls in the background and such โฎ๏ธ
When you walk to the edge of all the light you have and take that first step into the darkness of the unknown, you must believe that one of two things will happen. There will be something solid for you to stand upon or you will be taught to fly.โ
- Patrick Overton, The leaning tree
I wanted to see how far I can push it, having dabbled with Clojure/-Script for a few weeks after work.
So, there you have it: an example of an artisinal (most probably bad ๐ซ ) NodeJS-independent Frontend Project ๐ป ๐
what's in for me learning clojure(-script?)
- everyone not writing lisp
well, if you thought Elm was cool, but you struggled with the types... or maybe you think types hinder from greatness... Rich never said this, but I heard it anyways in his talks.
- firing and receiving a http json request
- json extraction
- process data, extract information
- dynamic data binding / state management
- DOM creation/manipulation
- state management
- very basic Browser Event Management
- user interaction
- filtering
- parameterized build for dev/prod scenarios
$ docker build . -t clj-events-spa
$ docker run --rm -p 8080:80 clj-events-spa
then open http://localhost:8080
- have Clojure installed
- skim this page about quick starting ClojureScript: https://clojurescript.org/guides/quick-start
- curl
I code clojure in VS Code using VSCode with Calva or a similar Editor supporting Clojure(-Script)
./build-production.sh
and then http-serve the files
I solve that task using node's http-server
other may use Python for that
- state management abstraction, faster filtering may (see medium low hanging fruits)
- lookup table for the calendar events
- memoizing results ๐คทโโ๏ธ
- clojure(-script) isn't witchcraft and has some really nice docs/api/reference
- almost no dependencies needed ๐คฏ
- one language to rule them all
- start a REPL
deps.edn + ClojureScript build for Browser
- a Browser will open, then
- evaluate
core.cljs
line by line - evaluate requirements in
events.cljs
and inspect the events in state