Skip to content

Latest commit

 

History

History
24 lines (22 loc) · 1.01 KB

driver-spec.md

File metadata and controls

24 lines (22 loc) · 1.01 KB

Driver Spec 1.0

Driver is the key concept that make the application cross-container running. Rax have been implemented dom driver, server driver and weex driver. If want Rax works on other container, only need implement the driver specification. The driver should implement follow method:

  • createBody()
  • createEmpty(component)
  • createText(text, component)
  • updateText(node, text)
  • createElement(type, props, component)
  • appendChild(node, parent)
  • removeChild(node, parent)
  • replaceChild(newChild, oldChild, parent)
  • insertAfter(node, after, parent)
  • insertBefore(node, before, parent)
  • addEventListener(node, eventName, eventHandler)
  • removeEventListener(node, eventName, eventHandler)
  • setAttribute(node, propKey, propValue)
  • removeAttribute(node, propKey)
  • setStyle(node, styleObject)
  • *beforeRender({element, hydrate, container})
  • *afterRender({element, hydrate, container})