Skip to content
  • bzub's avatar
    Major rework of Base type, renamed to MDCRoot · 4dbc7802
    bzub authored
    base.MDCRoot is now simpler in a number of ways. It now only contains
    the minimum of information needed to start an MDC component: the
    component class and the targeted root element to instantiate with.
    Components now embed MDCRoot directly to automatically implement
    vecty.{Un}Mounter.
    
    API CHANGES
    ===========
    Most of the common fields between components have been replaced by
    functions in a new package, base/applyer. For example, add
    applyer.CSSOnly() to a component's markup to disable Javascript/ripple.
    
    As for the Ripple field, it has been replaced by a dedicated ripple
    package and struct that implements vecty.Applyer as well.
    
    Finally, this commit begins using a convention in all components where
    the major elements in a component are struct fields of type
    vecty.MarkupOrChild. Every component has a Root field like this, which
    essentially replaces the Markup field. If Root is set to something other
    than just Markup, it is considered a wholesale replacement of the
    built-in component element. Built-in root element markup is then applied
    in an Apply() method of the component, which means you can use any
    component as an Applyer on existing HTML. This type of customization is
    a WIP.
    4dbc7802