Summary

Functions

Creates the instance of an element, with its panel or its rendered child, inside a container panel.
Parses one element, with its attributes and children, starting at its <, and returns the Lua code that creates it.
Reconciles one slot of the tree: updates the instance if the element is of the same type and key, replaces it otherwise.
Reconciles the children of a host, a fragment or the root against a list of elements, matching them by key or by position.
Copies Lua code from the current position, replacing every piece of markup with a call to Lumen.element.
Takes an instance down: runs the effect cleanups of its components, clears its refs and removes its panels.
Brings an instance in line with a new element of the same type.

Functions

instantiate(element, container, root, parent)

client packages/lumen/lib/cl_reconciler.lua:168

Creates the instance of an element, with its panel or its rendered child, inside a container panel.

Parameters

  • element Map
  • container Panel the panel that hosts are created in
  • root Map the root the instance belongs to
  • parent Map the parent instance, nil at the root

Returns

  • Map the instance, or nil if the element could not be created

mount(panel, _props)

client packages/lumen/lib/cl_elements.lua:262

No documentation available.

mount(panel, _props)

client packages/lumen/lib/cl_elements.lua:292

No documentation available.

mount(panel, _props)

client packages/lumen/lib/cl_elements.lua:342

No documentation available.

mount(panel, _props)

client packages/lumen/lib/cl_elements.lua:394

No documentation available.

parse_element(state)

shared packages/lumen/lib/sh_compiler.lua:422

Parses one element, with its attributes and children, starting at its <, and returns the Lua code that creates it. Newlines inside of the markup are kept in the code at the places where they were, so that the lines of embedded expressions do not move.

Parameters

  • state Map compiler state; pos is at the < and is left right after the element

Returns

  • String Lua code

reconcile(instance, element, container, root, parent)

client packages/lumen/lib/cl_reconciler.lua:297

Reconciles one slot of the tree: updates the instance if the element is of the same type and key, replaces it otherwise.

Parameters

  • instance Map the instance in the slot, or nil
  • element Map the element for the slot, or nil to empty it
  • container Panel
  • root Map
  • parent Map

Returns

  • Map the instance now in the slot, or nil

reconcile_children(parent, old_children, children)

client packages/lumen/lib/cl_reconciler.lua:323

Reconciles the children of a host, a fragment or the root against a list of elements, matching them by key or by position.

Parameters

  • parent Map the instance whose children they are
  • old_children List<Map> the current instances
  • children List the new children: elements, text and false for left out children

Returns

  • List<Map> the instances now there

transform(state, stop_at_brace)

shared packages/lumen/lib/sh_compiler.lua:279

Copies Lua code from the current position, replacing every piece of markup with a call to Lumen.element. Stops at the end of the source, or at the } that closes the expression when asked to.

Parameters

  • state Map compiler state; pos is where to start and is left at the } when stopping there
  • stop_at_brace Boolean stop at the first } that is not matched by a { of its own

Returns

  • String the transformed code
  • Number how many tokens other than comments and spaces it has

unmount(instance)

client packages/lumen/lib/cl_reconciler.lua:368

Takes an instance down: runs the effect cleanups of its components, clears its refs and removes its panels.

Parameters

  • instance Map

update(panel, props, _old_props)

client packages/lumen/lib/cl_elements.lua:208

No documentation available.

update(panel, props, _old_props)

client packages/lumen/lib/cl_elements.lua:230

No documentation available.

update(panel, props, _old_props)

client packages/lumen/lib/cl_elements.lua:241

No documentation available.

update(panel, props, old_props)

client packages/lumen/lib/cl_elements.lua:249

No documentation available.

update(panel, props, _old_props)

client packages/lumen/lib/cl_elements.lua:271

No documentation available.

update(panel, props, _old_props)

client packages/lumen/lib/cl_elements.lua:297

No documentation available.

update(panel, props, old_props)

client packages/lumen/lib/cl_elements.lua:351

No documentation available.

update(panel, props, _old_props)

client packages/lumen/lib/cl_elements.lua:401

No documentation available.

update(panel, props, old_props)

client packages/lumen/lib/cl_elements.lua:419

No documentation available.

update(panel, props, old_props)

client packages/lumen/lib/cl_elements.lua:435

No documentation available.

update(instance, element)

client packages/lumen/lib/cl_reconciler.lua:247

Brings an instance in line with a new element of the same type.

Parameters

  • instance Map
  • element Map

Defined in