Liking cljdoc? Tell your friends :D

ag-grid-cljs.impl.validate

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).
raw docstring

check-class-rules!cljs

(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.
sourceraw docstring

check-fields!cljs

(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.
sourceraw docstring

disable!cljs

(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.
sourceraw docstring

enable!cljs

(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.
sourceraw docstring

field-targetscljs

(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.
sourceraw docstring

first-rowcljs

(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.
sourceraw docstring

install-field-check!cljs

(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).
sourceraw docstring

reset-warnings!cljs

(reset-warnings!)

Clear the dedup set (test helper).

Clear the dedup set (test helper).
sourceraw docstring

validate-options!cljs

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close