Liking cljdoc? Tell your friends :D

dev.zeko.stube.shell

The HTML shell page served on the first GET of a mounted flow.

The shell is effectively empty: a <div id="root"> placeholder plus a data-init that opens the long-lived SSE stream. Once the browser connects, every UI patch arrives through that stream — so this namespace knows nothing about components or rendering.

The HTML shell page served on the first GET of a mounted flow.

The shell is effectively empty: a `<div id="root">` placeholder
plus a `data-init` that opens the long-lived SSE stream.  Once the
browser connects, every UI patch arrives through that stream — so
this namespace knows nothing about components or rendering.
raw docstring

datastar-cdnclj

source

fragmentclj

(fragment cid
          {:keys [dev? base-path root-selector]
           :or {base-path "" root-selector "#root"}})

Hiccup fragment a host page can slot into its own layout. It opens the SSE stream and contains the DOM target for the first stube patch.

Hiccup fragment a host page can slot into its own layout.  It opens
the SSE stream and contains the DOM target for the first stube patch.
sourceraw docstring

head-tagsclj

(head-tags {:keys [dev? ui-css? base-css eager-scripts base-path root-selector]
            :or {ui-css? true
                 base-css []
                 eager-scripts []
                 base-path ""
                 root-selector "#root"}})

Hiccup nodes a host page should include in <head> for a stube shell fragment, in this order:

  1. Optional stock ui.css.
  2. Kernel-level :base-css <link>s (host-wide stylesheets that should appear regardless of which components are registered).
  3. One <link> per registered component that ships a stylesheet at resources/stube_styles/<ns>/<name>.css (discovered via io/resource).
  4. One <style> block holding inline :styles from every registered component, with each chunk's & prefix scoped to the matching [data-stube-component="ns/name"] selector.
  5. Kernel-level :eager-scripts as a single synchronous <script> block — emitted before any type="module" script so inline Datastar expressions can rely on the globals it sets up.
  6. Datastar and the framework bridges (preserve.js, behaviors.js).
  7. One <script type="module"> per distinct module id declared by a component's :modules vector, served from resources/stube_modules/<id>.js.
  8. Optional halos tooling when :dev? is true.

Standalone html uses this directly; embedders normally call the public dev.zeko.stube.embed/head-tags wrapper for their kernel.

Renderer constraint: the returned tree only renders correctly through chassis. Inline <script> / <style> bodies are wrapped in chassis RawString so quotes and JSON literals survive verbatim; hosts using hiccup2 / rum / reagent SSR must re-wrap those instances in their renderer's own raw primitive before emitting, or the bodies will be HTML-escaped and the scripts will fail to parse.

Hiccup nodes a host page should include in `<head>` for a stube shell
fragment, in this order:

1. Optional stock `ui.css`.
2. Kernel-level `:base-css` `<link>`s (host-wide stylesheets that
   should appear regardless of which components are registered).
3. One `<link>` per registered component that ships a stylesheet at
   `resources/stube_styles/<ns>/<name>.css` (discovered via
   `io/resource`).
4. One `<style>` block holding inline `:styles` from every registered
   component, with each chunk's `&` prefix scoped to the matching
   `[data-stube-component="ns/name"]` selector.
5. Kernel-level `:eager-scripts` as a single synchronous `<script>`
   block — emitted *before* any `type="module"` script so inline
   Datastar expressions can rely on the globals it sets up.
6. Datastar and the framework bridges (`preserve.js`, `behaviors.js`).
7. One `<script type="module">` per distinct module id declared by a
   component's `:modules` vector, served from
   `resources/stube_modules/<id>.js`.
8. Optional halos tooling when `:dev?` is true.

Standalone [[html]] uses this directly; embedders normally call the
public `dev.zeko.stube.embed/head-tags` wrapper for their kernel.

Renderer constraint: the returned tree only renders correctly through
chassis.  Inline `<script>` / `<style>` bodies are wrapped in chassis
`RawString` so quotes and JSON literals survive verbatim; hosts using
hiccup2 / rum / reagent SSR must re-wrap those instances in their
renderer's own raw primitive before emitting, or the bodies will be
HTML-escaped and the scripts will fail to parse.
sourceraw docstring

htmlclj

(html cid opts-or-dev?)

Render the shell document for cid. When dev? is true (server started with :halos? true), inject the halos overlay script and the data-stube-cid hook so the floating pill can activate the overlay.

Render the shell document for `cid`.  When `dev?` is true (server
started with `:halos? true`), inject the halos overlay script and the
`data-stube-cid` hook so the floating pill can activate the overlay.
sourceraw docstring

rendered-fragmentclj

(rendered-fragment cid
                   pre-rendered-html
                   {:keys [dev? base-path root-selector]
                    :or {base-path "" root-selector "#root"}})

Like fragment, but inlines pre-rendered-html inside the <div id=root> placeholder so the host can serve a readable first paint without waiting for the SSE connection to deliver patches.

pre-rendered-html is treated as a raw HTML string (wrapped in chassis/raw); callers must hand back HTML the server itself produced, not user input. The shell's data-init is unchanged, so once the browser connects the conversation is fully interactive.

See dev.zeko.stube.runtime/rendered-shell-for! for the helper that mints the conversation, runs boot, and assembles the shell in one call.

Like [[fragment]], but inlines `pre-rendered-html` inside the
`<div id=root>` placeholder so the host can serve a readable first
paint without waiting for the SSE connection to deliver patches.

`pre-rendered-html` is treated as a raw HTML string (wrapped in
`chassis/raw`); callers must hand back HTML the server itself
produced, not user input.  The shell's `data-init` is unchanged,
so once the browser connects the conversation is fully interactive.

See [[dev.zeko.stube.runtime/rendered-shell-for!]] for the helper
that mints the conversation, runs boot, and assembles the shell in
one call.
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