Three dev-only diagnostics, only the first gated (ADR 0017, ADR 0019). All are warn-only: none ever rejects or alters what AG Grid receives (ADR 0002).
DEV VALIDATIONS — position-aware validation of the EDN options map, run at the conversion boundary (ADR 0007 §4-5). It does the strictly-kebab-native layer AG Grid's own ValidationModule cannot: unknown-key warnings with a kebab did-you-mean. It NEVER reimplements type/dependency/row-model or deprecation checks — those are ValidationModule's, which create-grid! registers in every dev build (ADR 0020). Position-aware: top-level keys validate against :grid-options (+ event handlers); the known ColDef-bearing positions (:column-defs items, :default-col-def, :auto-group-column-def, and group :children) validate against :col-def / :col-group-def; everything else is opaque and never touched. OFF by default — ag-grid-cljs.core/ enable-dev-validations! flips it on, because these checks test consumer keys against a registry pinned to one AG Grid version and so drift.
CLASS-RULE KEYS — check-class-rules!, which warns when a :row-class-rules or :cell-class-rules key is a keyword conversion would rename, since those keys are CSS class names the consumer coins and the stylesheet matches literally (ADR 0019). ALWAYS ON, for the same reason as the field check: registry-free.
FIELD CHECK — install-field-check!, which compares each column's emitted field string against the keys of one sampled row and warns once per field with a did-you-mean. ALWAYS ON: it is registry-free (it compares two consumer-supplied things to each other), so the drift argument behind the gate does not apply and enable-dev-validations! does not cover it.
Every registry reference here sits inside ^boolean goog.DEBUG guards and the whole namespace is reached only from goog.DEBUG-guarded call sites, so :advanced compilation with {goog.DEBUG false} dead-code-eliminates it (ADR 0007 §1).
Three dev-only diagnostics, only the first gated (ADR 0017, ADR 0019). All
are warn-only: none ever rejects or alters what AG Grid receives (ADR 0002).
DEV VALIDATIONS — position-aware validation of the EDN options map, run at the
conversion boundary (ADR 0007 §4-5). It does the strictly-kebab-native layer
AG Grid's own ValidationModule cannot: unknown-key warnings with a kebab
did-you-mean. It NEVER reimplements type/dependency/row-model or deprecation
checks — those are ValidationModule's, which create-grid! registers in every
dev build (ADR 0020). Position-aware: top-level keys validate against
:grid-options (+ event handlers); the known ColDef-bearing positions
(:column-defs items, :default-col-def, :auto-group-column-def, and group
:children) validate against :col-def / :col-group-def; everything else is
opaque and never touched. OFF by default — ag-grid-cljs.core/
enable-dev-validations! flips it on, because these checks test consumer keys
against a registry pinned to one AG Grid version and so drift.
CLASS-RULE KEYS — check-class-rules!, which warns when a :row-class-rules or
:cell-class-rules key is a keyword conversion would rename, since those keys
are CSS class names the consumer coins and the stylesheet matches literally
(ADR 0019). ALWAYS ON, for the same reason as the field check: registry-free.
FIELD CHECK — install-field-check!, which compares each column's emitted field
string against the keys of one sampled row and warns once per field with a
did-you-mean. ALWAYS ON: it is registry-free (it compares two consumer-supplied
things to each other), so the drift argument behind the gate does not apply and
enable-dev-validations! does not cover it.
Every registry reference here sits inside ^boolean goog.DEBUG guards and the
whole namespace is reached only from goog.DEBUG-guarded call sites, so
:advanced compilation with {goog.DEBUG false} dead-code-eliminates it
(ADR 0007 §1).(check-class-rules! opts)Always-on check over the consumer-keyed class-rule options: a keyword key that conversion would rename emits a CSS class the stylesheet cannot match, and fails silently (ADR 0019). Registry-free, so no enable-dev-validations! gate — unlike the four consumer-keyed options whose names are cited from inside the options map, where a keyword key is correct and a keyword-key warning would be a false positive (ADR 0019 §3).
Called with the full options map at creation and with the PATCH on update: update-grid! is a merge differ, so anything already applied was checked when it arrived.
Always-on check over the consumer-keyed class-rule options: a keyword key that conversion would rename emits a CSS class the stylesheet cannot match, and fails silently (ADR 0019). Registry-free, so no enable-dev-validations! gate — unlike the four consumer-keyed options whose names are cited from inside the options map, where a keyword key is correct and a keyword-key warning would be a false positive (ADR 0019 §3). Called with the full options map at creation and with the PATCH on update: update-grid! is a merge differ, so anything already applied was checked when it arrived.
(check-fields! state targets row)Warn once for each of targets whose :row-key is absent from row (public
for the node suite). state is an atom holding the set of resolved field
strings, where resolved means a verdict was reached — warned or found present;
the warning fires on the transition into the set. A non-object row (including
nil: no rows loaded yet) resolves nothing and warns nothing.
Presence is deliberately asymmetric with the suggestion pool: in walks the
prototype chain, so class instances with prototype getters stay quiet, while
js-keys does not, so "toString" is never suggested.
Warn once for each of `targets` whose `:row-key` is absent from `row` (public for the node suite). `state` is an atom holding the set of resolved field strings, where resolved means a verdict was reached — warned or found present; the warning fires on the transition into the set. A non-object `row` (including nil: no rows loaded yet) resolves nothing and warns nothing. Presence is deliberately asymmetric with the suggestion pool: `in` walks the prototype chain, so class instances with prototype getters stay quiet, while `js-keys` does not, so "toString" is never suggested.
(disable!)Turn the dev validations back off (test helper). enable! has no other counterpart, and the always-on checks are only observable with the gate down.
Turn the dev validations back off (test helper). enable! has no other counterpart, and the always-on checks are only observable with the gate down.
(enable!)Turn the wrapper's dev validations on. No-op in production builds.
Turn the wrapper's dev validations on. No-op in production builds.
(field-targets col)The checkable targets of one AG Grid Column — a vector of
{:kind :field|:tooltip-field :field <emitted string> :row-key <key read>}
(public for the node suite).
Skipping is per field, not per ColDef: a valueGetter supersedes field and
drops it, but nothing drops tooltipField — v36's cell tooltip resolver reads
data[tooltipField] before consulting tooltipValueGetter. Dot notation is
whatever the Column already resolved, so :suppress-field-dot-notation is
honoured for free.
The checkable targets of one AG Grid `Column` — a vector of
`{:kind :field|:tooltip-field :field <emitted string> :row-key <key read>}`
(public for the node suite).
Skipping is per field, not per ColDef: a `valueGetter` supersedes `field` and
drops it, but nothing drops `tooltipField` — v36's cell tooltip resolver reads
`data[tooltipField]` before consulting `tooltipValueGetter`. Dot notation is
whatever the Column already resolved, so `:suppress-field-dot-notation` is
honoured for free.(first-row api)The first loaded leaf data row, or nil (public for the node suite). Group rows are skipped: a CSRM group node carries no data at all, and an SSRM group row carries only its grouping field — sampling one would read as every other field being absent.
The first loaded leaf data row, or nil (public for the node suite). Group rows are skipped: a CSRM group node carries no data at all, and an SSRM group row carries only its grouping field — sampling one would read as every other field being absent.
(install-field-check! api)Install the field check on a live grid: register modelUpdated (data arriving
by any route) and newColumnsLoaded (columnDefs replaced), then run the check
once. The immediate run is load-bearing, not belt-and-braces — addEventListener
is only reachable after createGrid returns, by which point both events have
already fired for the initial columns and rows, so a grid that is never
subsequently modified would otherwise never be checked.
State is per-grid, held in the listener closure: the "present in this grid's rows" half is inherently per-grid, and the module-global dedup set would both silence a real bug on a second grid with differently-shaped rows and survive hot reload. Not gated by enable-dev-validations! (ADR 0017).
Install the field check on a live grid: register `modelUpdated` (data arriving by any route) and `newColumnsLoaded` (columnDefs replaced), then run the check once. The immediate run is load-bearing, not belt-and-braces — addEventListener is only reachable after createGrid returns, by which point both events have already fired for the initial columns and rows, so a grid that is never subsequently modified would otherwise never be checked. State is per-grid, held in the listener closure: the "present in this grid's rows" half is inherently per-grid, and the module-global dedup set would both silence a real bug on a second grid with differently-shaped rows and survive hot reload. Not gated by enable-dev-validations! (ADR 0017).
(reset-warnings!)Clear the dedup set (test helper).
Clear the dedup set (test helper).
(validate-options! opts)Position-aware dev validation of the top-level EDN options map. No-op unless dev validations are enabled and this is a goog.DEBUG build. Never rejects or alters — it only emits js/console.warn.
Position-aware dev validation of the top-level EDN options map. No-op unless dev validations are enabled and this is a goog.DEBUG build. Never rejects or alters — it only emits js/console.warn.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |