First pass at default order convention

Justin Obara obara.justin at
Thu Jan 31 14:40:26 UTC 2013

As part of the community meeting yesterday we talked about developing a convention for how we order our options in a components defaults. Below is the first pass at developing that convention. Please provide feedback and alternatives as necessary. Also, feel free to add in any missing options.


// I've tried to group common options and common groups of options close together.

fluid.defaults("fluid.component", {

    // gradeNames shoudl always go first, so we know what "type" of component is being defined.
    gradeNames: ["fluid.rendererComponent", "autoInit"],
    // init functions should go next
    // note these can be infered by the framework now, and soon will be obsolete
    preInitFunction: "fluid.component.preInit",
    postInitFunction: "fluid.component.postInit",
    finalInitFunction: "fluid.component.finalInit",
    // standard option for model defaults
    model: {},
    applier: ""
    // standard options for defining view related options
    selectors: {},
    strings: {},
    styles: {},
    // standard options for renderer components 
    selectorsToIgnore: [],
    repeatingSelectors: [],
    produceTree: "",
    rendererFnOptions: {},
    rendererOptions: {},
    // templates, usually used with renderer components
    resources: {} // template
    // component specific options
    compOpt1: "",
    compOpt2: {},
    compOptETC: [],
    // event related options
    events: {},
    listeners: {},
    // component methods
    invokers: {},
    // child components
    components: {}

More information about the fluid-work mailing list