Resolves an :el-id value into the id string rendered into the DOM.
Callers never build strings themselves. Components and the SDK both call
el-id, so a view and a test using the same value always agree:
:first-name -> "first-name" :app.person/first-name -> "app.person/first-name" [:person "Bla" "ble"] -> "person--bla--ble" [some-element-fn "Bla"] -> whatever (some-element-fn "Bla") resolves to "already-built" -> "already-built"
Suffixes are joined with "--" so scanned ids can be split back into a nested path.
Resolves an :el-id value into the id string rendered into the DOM. Callers never build strings themselves. Components and the SDK both call `el-id`, so a view and a test using the same value always agree: :first-name -> "first-name" :app.person/first-name -> "app.person/first-name" [:person "Bla" "ble"] -> "person--bla--ble" [some-element-fn "Bla"] -> whatever (some-element-fn "Bla") resolves to "already-built" -> "already-built" Suffixes are joined with "--" so scanned ids can be split back into a nested path.
El-id data for gallery demos. Returns plain :el-id values (vectors), so a view passes them straight to a primitive's :el-id and a test passes the same value to the SDK; neither builds an id string.
(el :autocomplete :basic) -> [:autocomplete :basic] ; "autocomplete--basic" (el :slider :basic :readout) -> [:slider :basic :readout] ; "slider--basic--readout" (testid :slider :basic :readout) -> "slider--basic--readout" ; for raw :data-testid
El-id data for gallery demos. Returns plain :el-id values (vectors), so a view passes them straight to a primitive's :el-id and a test passes the same value to the SDK; neither builds an id string. (el :autocomplete :basic) -> [:autocomplete :basic] ; "autocomplete--basic" (el :slider :basic :readout) -> [:slider :basic :readout] ; "slider--basic--readout" (testid :slider :basic :readout) -> "slider--basic--readout" ; for raw :data-testid
Read every element carrying an el-id and nest the readings by el-id path.
Shared by the SDK (runs the scripts in the browser via Playwright) and the gallery (runs them directly), so both see exactly the same snapshot.
"first-name" -> {:first-name {:type :input :value "John" :label "First name"}} "person--bla--ble" -> {:person {:bla {:ble {:type :text :text "Ble"}}}}
Each leaf says what it is (:type). Controls carry their :value (and :label when the control has one); everything else carries its visible :text.
Read every element carrying an el-id and nest the readings by el-id path.
Shared by the SDK (runs the scripts in the browser via Playwright) and the
gallery (runs them directly), so both see exactly the same snapshot.
"first-name" -> {:first-name {:type :input :value "John" :label "First name"}}
"person--bla--ble" -> {:person {:bla {:ble {:type :text :text "Ble"}}}}
Each leaf says what it is (:type). Controls carry their :value (and :label
when the control has one); everything else carries its visible :text.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 |