Fulcro RAD can be used with any Fulcro application. The only global configuration that is required
is to initialize the attribute registry, but the more feature you use, the more you’ll want
to configure. RAD applications that uses HTML5 routing and UI generation, for example, will also
need to configure those.
Here is what a client might look like that also includes some logging output improvements and
supports hot code reload at development time:
(ns com.example.client
(:require
[com.example.ui :refer [Root]]
[com.fulcrologic.fulcro.application :as app]
[com.fulcrologic.rad.application :as rad-app]
[com.fulcrologic.rad.rendering.semantic-ui.semantic-ui-controls :as sui]
[com.fulcrologic.fulcro.algorithms.timbre-support :refer [console-appender prefix-output-fn]]
[taoensso.timbre :as log]
[com.fulcrologic.rad.type-support.date-time :as datetime]
[com.fulcrologic.rad.routing.html5-history :refer [html5-history]]
[com.fulcrologic.rad.routing.history :as history]))
(defonce app (rad-app/fulcro-rad-app
{:client-did-mount (fn [app]
;; Adds improved logging support to js console
(log/merge-config! {:output-fn prefix-output-fn
:appenders {:console (console-appender)}}))}))
(defn refresh []
;; hot code reload of installed controls
(log/info "Reinstalling controls")
(rad-app/install-ui-controls! app sui/all-controls)
(app/mount! app Root "app"))
(defn init []
(log/info "Starting App")
;; a default tz, for date/time support
(datetime/set-timezone! "America/Los_Angeles")
;; Optional HTML5 history support
(history/install-route-history! app (html5-history))
;; Install UI plugin that can auto-render forms/reports
(rad-app/install-ui-controls! app sui/all-controls)
(app/mount! app Root "app"))
Additional RAD plugins and templates will include additional features, and you should
see the Fulcro and Ring documentation for setting up customizations to things like sessions, cookies, security, CSRF, etc.