Skip to main content

Module compile

Module compile 

Source
Expand description

Schema → runtime compilation. Turns a validated Document into the shapes the existing engines consume:

  • fixed fields / rows / groups → Widgets (rendered by the shared _widget.html macro; inputs namespaced pb__…),
  • repeaters / flex zones → one WidgetKind::Stream Widget each + DynBlockDefs in a DynBlockSet overlay,
  • conditional rules → flat RuleBindings for the editor’s rules island + server-side visibility checks.

Compilation is cheap (no I/O) — callers compile per request from the published schema row + the component library.

Structs§

CompiledSchema
The compiled, render-ready schema.
RuleBinding
A conditional rule bound to the field it governs.

Enums§

BodyItem
One editor-facing layout item, in authored order.

Constants§

FIELD_PREFIX
Prefix for every builder-owned form input — keeps UI-defined fields from colliding with base-page fields and code handlers’ extension fields.

Functions§

compile
Compile a validated document. schema_version is the published version (stamped on zone/repeater dyn blocks so stored entries carry it); component dyn blocks carry their own component version.
field_to_widget
Map one authored field into an admin Widget, namespaced by prefix (pb__ or pb__<group>__).