⚙️

json-renderers-build

v3.0.0

Headless UI Specification Compiler

Ecosystem Story: Spec Compiler Layer

Build Declarative UI Specifications Headless, Pure, and Config-Driven

json-renderers-build transforms raw data arrays and column definitions into a pure DOM specification AST (specAsJsonToDom). This repo does not live in the browser DOM layer. It is the headless spec generator, while the actual DOM creation is handled by @keshavsoft/json-to-tag and the runtime mount step is performed by json-renderers.

Architecture Overview

The 3-Tier Declarative Pipeline

Understanding the division of labor between json-to-spec, json-renderers-build (this repo), and json-renderers.

Tier 1 • Compiler Core ⚙️

json-to-spec

The low-level template compiler engine. Evaluates operations like loopCollection, loopObject, and loopArray on raw skeleton files.

jsonToSpec(skeleton, context)
This Repo
Tier 2 • Spec Builder 📦

json-renderers-build

Headless UI Spec Builder. Encapsulates predefined component blueprints (table, select, selectOptionsOnly) and returns pure JSON-to-DOM AST specifications. Zero DOM coupling.

render({ type, data, columns })
Tier 3 • DOM Runtime 🖥️

json-renderers & json-to-tag

The browser DOM consumer. Ingests the specification AST generated by json-renderers-build, instantiates concrete DOM nodes, and mounts into container elements.

container.append(jsonToTag(spec))
Source layout Current public entry
src/index.js → src/v24/index.js

The package entry always points to the active version in src/v24. Each renderer type sits in its own folder, and the index files stay thin by delegating to focused helper modules.

Live Workbench

Interactive Specification Compiler

📝 Input Data (JSON)
📊 Columns (for table)
💡 Headless Execution

The compiler runs purely in memory via render({ type, data, columns }). No DOM nodes are created during this stage.

specAsJsonToDom output 0 nodes generated
// Click Compile to generate spec
Component Blueprints

Available Skeletons in v3

type: "table" Full Grid

Constructs complete Bootstrap-ready data tables with <table class="table table-hover table-striped mb-0">, repeating headers from columns, and row values from data.

// Calling signature
render({ type: "table", data, columns })
type: "select" Dropdown

Constructs a complete <select id="LedgerName"> containing an array of <option value="..."> elements from a primitive array of strings.

// Calling signature
render({ type: "select", data: ["A", "B"] })
type: "selectOptionsOnly" Fragment

Generates an un-wrapped fragment spec containing only the array of <option> nodes, tailored for appending into existing select inputs.

// Calling signature
render({ type: "selectOptionsOnly", data: ["A", "B"] })
Browser Demos

Included Verification Samples

📦 Installation & Distribution

npm install json-renderers-build
import render from "https://cdn.jsdelivr.net/gh/keshavsoft/json-renderers-build@main/docs/dist/v3/min.js";