Liking cljdoc? Tell your friends :D

com.fulcrologic.fulcro.algorithms.denormalize

The algorithm and support functions for converting a normalized Fulcro database to a tree of denormalized props.

The algorithm and support functions for converting a normalized Fulcro database to a tree of denormalized props.
raw docstring

com.fulcrologic.fulcro.algorithms.do-not-use

Some misc. utility functions. These are primarily meant for internal use, and are subject to relocation and removal in the future.

You have been warned. Changes to this ns (or its complete removal) will not be considered breaking changes to the library, and no mention of said changes will even appear in the changelog.

Some misc. utility functions. These are primarily meant for internal use, and are subject to
relocation and removal in the future.

You have been warned. Changes to this ns (or its complete removal)
will not be considered breaking changes to the library, and no mention of said changes
will even appear in the changelog.
raw docstring

com.fulcrologic.fulcro.algorithms.form-state

Functions that assist with supporting form editing/checking/diffing in Fulcro UI. These functions work by making a pristine copy of your entity, and tracking what fields have been touched. You are responsible for triggering these various states by marking fields as complete (mark-complete!), telling it to copy the data to/from pristine (e.g. entity->pristine), and by asking for out-of-date data for the current vs. pristine copy (dirty-fields).

There is also support for detecting which fields have been marked complete and are dirty.

Validation can be done via Clojure spec, or by defining your own field validation functions via make-validator. This general-purpose validation factor function can easily be used to create more automated validation factories that can be more configuration-driven, but this is left as an exercise for the community.

See the Developer's Guide for more information.

Functions that assist with supporting form editing/checking/diffing in Fulcro UI.  These functions work
by making a pristine copy of your entity, and tracking what fields have been touched.  You are responsible
for triggering these various states by marking fields as complete (`mark-complete!`), telling it to
copy the data to/from pristine (e.g. `entity->pristine`), and by asking for out-of-date data for the current
vs. pristine copy (`dirty-fields`).

There is also support for detecting which fields have been marked complete and are dirty.

Validation can be done via Clojure spec, or by defining your own field validation functions via
`make-validator`. This general-purpose validation factor function can easily be used to create more
automated validation factories that can be more configuration-driven, but this is left as an exercise for the community.

See the Developer's Guide for more information.
raw docstring

com.fulcrologic.fulcro.algorithms.indexing

Functions that implement the query and component indexing.

Functions that implement the query and component indexing.
raw docstring

com.fulcrologic.fulcro.algorithms.lookup

Namespace with support for finding plug-in algorithms on the app. Avoids circular references within the library itself.

Namespace with support for finding plug-in algorithms on the app. Avoids circular references
within the library itself.
raw docstring

com.fulcrologic.fulcro.algorithms.normalize

Functions for dealing with normalizing Fulcro databases. In particular tree->db.

Functions for dealing with normalizing Fulcro databases. In particular `tree->db`.
raw docstring

com.fulcrologic.fulcro.algorithms.normalized-state

Functions that can be used against a normalized Fulcro state database. This namespace also includes some handy aliases to useful functions that work on normalized state from other namespaces.

Functions that can be used against a normalized Fulcro state database. This namespace also includes some handy aliases
to useful functions that work on normalized state from other namespaces.
raw docstring

com.fulcrologic.fulcro.algorithms.scheduling

Algorithms for delaying some action by a particular amount of time.

Algorithms for delaying some action by a particular amount of time.
raw docstring

com.fulcrologic.fulcro.algorithms.tempid

Functions for making and consuming Fulcro temporary IDs.

Functions for making and consuming Fulcro temporary IDs.
raw docstring

com.fulcrologic.fulcro.algorithms.timbre-support

Logging helpers to make js console logging more readable. The recommended use of these functions is as follows:

  • Make sure you're using Binaryage devtools (on classpath. shadow-cljs will auto-add it when detected).
  • IMPORTANT: Enable custom formatters in console settings for Chrome. This will print cljs data as cljs (instead of raw js).
  • Make a development preload cljs file, and tell shadow-cljs to preload it.
  • In the preload file, add something like this:
(ns app.development-preload
  (:require
    [taoensso.timbre :as log]
    [com.fulcrologic.fulcro.algorithms.timbre-support :refer [console-appender prefix-output-fn]))

(log/set-level! :debug)
(log/merge-config! {:output-fn prefix-output-fn
                    :appenders {:console (console-appender)}})

and you'll get much more readable error messages in the js console.

NOTE: when logging errors, be sure to log the exception first. This is documented in timbre, but easy to miss:

(try
  ...
  (catch :default ex
    (log/error ex ...))

See the development_preload.cljs and shadow-cljs.edn files in the latest Fulcro 3 template for an example.

Logging helpers to make js console logging more readable. The recommended use of these functions is as follows:

- Make sure you're using Binaryage devtools (on classpath. shadow-cljs will auto-add it when detected).
- IMPORTANT: Enable custom formatters in console settings for Chrome. This will print cljs data as cljs (instead of raw js).
- Make a development preload cljs file, and tell shadow-cljs to preload it.
- In the preload file, add something like this:

```
(ns app.development-preload
  (:require
    [taoensso.timbre :as log]
    [com.fulcrologic.fulcro.algorithms.timbre-support :refer [console-appender prefix-output-fn]))

(log/set-level! :debug)
(log/merge-config! {:output-fn prefix-output-fn
                    :appenders {:console (console-appender)}})
```

and you'll get much more readable error messages in the js console.

NOTE: when logging errors, be sure to log the exception first. This is documented in timbre, but easy to miss:

```
(try
  ...
  (catch :default ex
    (log/error ex ...))
```

See the development_preload.cljs and shadow-cljs.edn files in the latest Fulcro 3 template for an example.
raw docstring

com.fulcrologic.fulcro.algorithms.transit

Transit functions for the on-the-wire EDN communication to common remotes. Includes support for Fulcro tempids, and can be extended to support additional application-specific data types.

Transit functions for the on-the-wire EDN communication to common remotes. Includes support for Fulcro tempids,
and can be extended to support additional application-specific data types.
raw docstring

com.fulcrologic.fulcro.algorithms.tx-processing-debug

Helper functions for debugging tx processing. Uses pprint, which adds a lot to build size, so it is in a separate ns to keep it out of prod builds.

Helper functions for debugging tx processing.  Uses pprint, which adds
a lot to build size, so it is in a separate ns to keep it out of prod builds.
raw docstring

com.fulcrologic.fulcro.dom

clj

MACROS for generating CLJS code. See dom.cljs

MACROS for generating CLJS code. See dom.cljs
cljs

Client-side DOM macros and functions. For isomorphic (server) support, see also com.fulcrologic.fulcro.dom-server

Client-side DOM macros and functions. For isomorphic (server) support, see also com.fulcrologic.fulcro.dom-server
raw docstring

com.fulcrologic.fulcro.dom-server

Support for rendering DOM from CLJ. Must be separate to enable same-named macros in CLJS for performance.

Usage: Create your UI in CLJC files, and require with conditional reader tags:

(ns app.ui (:require #?(:clj [com.fulcrologic.fulcro.dom-server :as dom] :cljs [com.fulcrologic.fulcro.dom :as dom])))

Support for rendering DOM from CLJ. Must be separate to enable same-named macros in CLJS for performance.

Usage: Create your UI in CLJC files, and require with conditional reader tags:

(ns app.ui
  (:require
    #?(:clj [com.fulcrologic.fulcro.dom-server :as dom] :cljs [com.fulcrologic.fulcro.dom :as dom])))
raw docstring

com.fulcrologic.fulcro.dom.html-entities

Defs of the proper unicode characters so you can use html entities in your DOM functions without having to look them up (or type out silly things like "\u00C6"

For example:

(ns my.ui
  (:require
    [com.fulcrologic.fulcro.dom.html-entities :as ent]))
    
...
   (dom/div ent/nbsp ent/copy)
...
Defs of the proper unicode characters so you can use html entities in your DOM functions without having to
look them up (or type out silly things like "\u00C6"

For example:

```
(ns my.ui
  (:require
    [com.fulcrologic.fulcro.dom.html-entities :as ent]))
    
...
   (dom/div ent/nbsp ent/copy)
...
```
raw docstring

com.fulcrologic.fulcro.dom.icons

SVG-encoded material UI icons.

See https://material-ui.com/components/icons

SVG-encoded material UI icons.

See https://material-ui.com/components/icons
raw docstring

com.fulcrologic.fulcro.dom.inputs

A namespace for specialized tool for dealing with inputs in HTML DOM to control a value in the data model that cannot be directly represented by normal HTML inputs. For example, you want to have an int in your data model, but HTML5 number inputs return a string and do not constrain the input to integers.

A namespace for specialized tool for dealing with inputs in HTML DOM to control a value in the data model
that cannot be directly represented by normal HTML inputs. For example, you want to have an int in
your data model, but HTML5 number inputs return a string and do not constrain the input to integers.
raw docstring

com.fulcrologic.fulcro.networking.file-upload

cljs

Client-side middleware that can be used with HTTP remotes so that mutations can attach file uploads to mutation parameters.

Client-side middleware that can be used with HTTP remotes so that mutations can attach file uploads to mutation
parameters.
raw docstring

com.fulcrologic.fulcro.networking.file-url

Support for converting binary network responses to a usable File URL in a browser. This file is CLJC so the functions exist for SSR, but they do nothing in CLJ.

Support for converting binary network responses to a usable File URL in a browser. This
file is CLJC so the functions exist for SSR, but they do nothing in CLJ.
raw docstring

com.fulcrologic.fulcro.networking.mock-server-remote

Simple adapter code that allows you to use a generic parser 'as if' it were a client remote in CLJS.

Simple adapter code that allows you to use a generic parser 'as if' it were a client remote in CLJS.
raw docstring

com.fulcrologic.fulcro.rendering.ident-optimized-render

A render optimization algorithm for refreshing the UI via props tunnelling (setting new props on a component's state in a pre-agreed location). This algorithm analyzes database changes and on-screen components to update components (by ident) whose props have changed.

Prop change detection is done by scanning the database in only the locations that on-screen components are querying (derived by the mounted component idents, and any ident-joins in the queries).

A render optimization algorithm for refreshing the UI via props tunnelling (setting new props on a component's
state in a pre-agreed location). This algorithm analyzes database changes and on-screen components to update
components (by ident) whose props have changed.

Prop change detection is done by scanning the database in *only* the locations that on-screen components are querying
(derived by the mounted component idents, and any ident-joins in the queries).
raw docstring

com.fulcrologic.fulcro.rendering.keyframe-render

The keyframe optimized render.

The keyframe optimized render.
raw docstring

com.fulcrologic.fulcro.rendering.keyframe-render2

Just like keyframe render, but supports :only-refresh option.

Just like keyframe render, but supports `:only-refresh` option.
raw docstring

com.fulcrologic.fulcro.rendering.multiple-roots-renderer

Like keyframe-render2, but also supports free-floating roots.

WARNING: THIS RENDERER IS ALPHA. Lightly tested, but not heavily used yet.

General usage:

  1. Set this nses render! as your application's optimized render function.
  2. Create a class that follows all of the normal rules for a Fulcro root (no ident, has initial state, composes children queries/initial-state, etc. a. Add mount/unmount register/deregister calls
  3. Use floating-root-factory to generate a Fulcro factory, or floating-root-react-class to generate a vanilla React wrapper class that renders the new root. a. Use the factory in normal Fuclro rendering, but don't pass it props, or b. Use (dom/create-element ReactClass) to render the vanilla wrapper, or c. Use the vanilla wrapper class when a js library controls rendering (like routing).

Example:

(defonce app (app/fulcro-app {:optimized-render! mroot/render!}))

(defsc AltRoot [this {:keys [alt-child]}]
  ;; query is from ROOT of the db, just like normal root.
  {:query                 [{:alt-child (comp/get-query OtherChild)}]
   :componentDidMount     (fn [this] (mroot/register-root! this {:app app}))
   :componentWillUnmount  (fn [this] (mroot/deregister-root! this {:app app}))
   :shouldComponentUpdate (fn [] true)
   :initial-state         {:alt-child [{:id 1 :n 22}
                                       {:id 2 :n 44}]}}
  (dom/div
    (mapv ui-other-child alt-child)))

;; For use in the body of normal defsc components.
(def ui-alt-root (mroot/floating-root-factory AltRoot))

;; For use as plain React class
(def PlainAltRoot (mroot/floating-root-react-class AltRoot app))

...

(some-js-library #js {:thing PlainAltRoot})

(defsc NormalFulcroClass [this props]
  {:query [:stuff]
   :ident (fn [] [:x 1])
   ...}
  (dom/div
    ;; ok to use within defsc components:
    (ui-alt-root)
    ;; how to use the plain react class, which is how js libs would use it:
    (dom/create-element PlainAltRoot)))

Like keyframe-render2, but also supports free-floating roots.

WARNING: THIS RENDERER IS ALPHA. Lightly tested, but not heavily used yet.

General usage:

1. Set this nses `render!` as your application's optimized render function.
2. Create a class that follows all of the normal rules for a Fulcro root (no ident, has initial state,
composes children queries/initial-state, etc.
   a. Add mount/unmount register/deregister calls
2. Use floating-root-factory to generate a Fulcro factory, or floating-root-react-class to generate
a vanilla React wrapper class that renders the new root.
   a. Use the factory in normal Fuclro rendering, but don't pass it props, or
   b. Use `(dom/create-element ReactClass)` to render the vanilla wrapper, or
   c. Use the vanilla wrapper class when a js library controls rendering (like routing).

Example:

```
(defonce app (app/fulcro-app {:optimized-render! mroot/render!}))

(defsc AltRoot [this {:keys [alt-child]}]
  ;; query is from ROOT of the db, just like normal root.
  {:query                 [{:alt-child (comp/get-query OtherChild)}]
   :componentDidMount     (fn [this] (mroot/register-root! this {:app app}))
   :componentWillUnmount  (fn [this] (mroot/deregister-root! this {:app app}))
   :shouldComponentUpdate (fn [] true)
   :initial-state         {:alt-child [{:id 1 :n 22}
                                       {:id 2 :n 44}]}}
  (dom/div
    (mapv ui-other-child alt-child)))

;; For use in the body of normal defsc components.
(def ui-alt-root (mroot/floating-root-factory AltRoot))

;; For use as plain React class
(def PlainAltRoot (mroot/floating-root-react-class AltRoot app))

...

(some-js-library #js {:thing PlainAltRoot})

(defsc NormalFulcroClass [this props]
  {:query [:stuff]
   :ident (fn [] [:x 1])
   ...}
  (dom/div
    ;; ok to use within defsc components:
    (ui-alt-root)
    ;; how to use the plain react class, which is how js libs would use it:
    (dom/create-element PlainAltRoot)))

```
raw docstring

com.fulcrologic.fulcro.server.config

Utilities for managing server configuration via EDN files. These functions expect a config/defaults.edn to exist on the classpath as a definition for server configuration default values. When you call load-config! it will deep merge the file you supply with the base defaults to return the 'complete' configuration. When loading configurations a relative path is evaluated against CLASSPATH and an absolute path against the real filesystem.

The values in the EDN files can be :env/VAR to pull a string from an env variable, and :env.edn/VAR to do a read-string against the value of an environment variable.

Utilities for managing server configuration via EDN files.  These functions expect a config/defaults.edn to exist
on the classpath as a definition for server configuration default values.  When you call `load-config!` it will
deep merge the file you supply with the base defaults to return the 'complete' configuration.  When loading
configurations a relative path is evaluated against CLASSPATH and an absolute path against the real filesystem.

The values in the EDN files can be :env/VAR to pull a string from an env variable, and :env.edn/VAR to do a `read-string`
against the value of an environment variable.
raw docstring

com.fulcrologic.fulcro.specs

No vars found in this namespace.

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close