![]() |
9 lat temu | |
---|---|---|
clojure-objc-sample | 9 lat temu | |
core | 9 lat temu | |
ios-client | 9 lat temu | |
pubsub-service | 9 lat temu | |
resources | 9 lat temu | |
MIT-LICENSE.txt | 9 lat temu | |
README.md | 9 lat temu | |
project.clj | 9 lat temu | |
project.org | 9 lat temu |
An industry grade project using clojure everywhere.
To be presented at ForwardJS 4.
A baseline Clojure stack that runs on any and all platforms, that is nice to develop and horizontally scalable.
The fundamental data structures representing code and data; nothing more, nothing less.
Based on reagent, which using a special atom as the client side sate. Stacks a nice pattern for composable reactive processing of UI actions. Plays well with CQRS and Doman Driven Design.
A separation of concerns model for use on all platforms.
We use a custom lifecycle dispatcher that uses multimethods, as suggested by the author's documentation.
(ns my.component
(:require [clojure.tools.logging :refer [debugf infof]
[component :refer [react-to] :as c]))
(defmulti react)
; namespaced keywords for dispatch
; (when (= *ns* 'my.component) (= ::my-message :my.component/my-message))
(defmethod react :component/start [c]
(debugf "Starting my.component"))
(defmethod react :component/stop [c]
(debugf "Stopping my.component"))
(defmethod react ::my-message [c msg]
(infof "Got a message, what are we going to do about it? %s" msg))
; alternative syntax (experimental)
(react-to ::my-message [event]
(infof "Got a message, what are we going to do about it? %s" msg))
(defmacro defupon
""
[command & body]
(let [react-symbol (symbol (str *ns*) "upon")
react-multi `(defmulti ~react-symbol #(:component/event %2))]
`(do
(when-not ~(find-var react-symbol)
(println "Defining default react dispatcher: ")
~react-multi)
(defmethod ~react-symbol ~command [~'component ~'event]
~@body))))
(let [say-reactor '(defupon :say
(format "say with component=%s, event=%s" component event))]
(println (macroexpand-1 say-reactor))
(eval say-reactor))
(let [component {:name :my.component}
event {:component/event :say
:message "hi"}]
(upon component event))
(defmacro defaction
""
[command & body]
`(let [react-symbol# ~(find-var (symbol (str *ns*) "react"))]
(when-not react-symbol#
(println "Defining default react dispatcher")
(defmulti ~'react-symbol# #(:command %2)))
(defmethod react-symbol# ~command [~'component ~'event]
~@body)))
Deploy non-Docker packages. Nothing in particular against Docker, but I don't see the case for it with Marathon and debootstrap.
familiar with it. yaml basaed DSL. as simple as you want it to be. downside? not edn.
APT debootstrap
IntelliJ Idea with Cursive (free licenses for OSS!)
emacs with clojure-mode and org-mode
homebrew + cask
Thanks to all the authors and contributors of the projects used and literature referenced.