Skip to content

Fayde.json

BSick7 edited this page Jul 18, 2015 · 9 revisions

The following is the basic structure for a fayde.json configuration file.

{
    "libs": {
        ...
    },
    "themes": {
        ...
    },
    "debug": {
        ...
    }
}

libs

This area is used to configure the loading of libraries. The object is a key-value object where the key represents the library name and the value an object configuring the load. This configuration will directly affect how XAML is loaded.

Example usage

<Application
    xmlns:controls="lib://fayde.controls">
    <controls:TabControl>
    </controls:TabControl>
</Application>

Example library definition

    "libs": {
        "fayde.controls": {
            "path": "lib/fayde.controls/dist/fayde.controls",
            "base": "lib/fayde.controls",
            "exports": "Fayde.Controls",
            "deps": [],
        }
    }

Specification

path: string - This is the app-relative path to the library. Fayde uses requirejs to asynchronously load libraries. NOTE: Typically, the .js file extension is not specified.

base: string - This is the app-relative path to the library's root directory. This is used for things like Library Resources.

exports: string - If the library does not conform to AMD spec, this is a way to export the root module.

deps: string[] - This is a way of specifying dependencies load before this library is loaded.

themes

This area is used to configure loading of library themes in much the same way libraries are configured. A template path can be specified to modify how a theme is loaded or a theme can be turned off. There are reserved phrases that can be used in the template path to automate theme loading.

  • <libname> - The library name is mainly used for the default template path, but can be used to make for consistent configuration files.
  • <themename> - The theme name is applied on an Application.

Turn off a theme

    "themes": {
        "fayde.controls": "none"
    }

Use default theme path

Default - lib/<libname>/themes/<themename>.Theme.xml

    "themes": {
        "fayde.controls": {}
    }

Change theme path

    "themes": {
        "fayde.controls": {
            "path": "lib/<libname>/themes/<themename>.Theme.xml"
        }
    }

debug

  • warnMissingThemes - Will console.warn when a theme fails to load.
  • warnBrokenPath - Will console.warn when a Binding.Path fails to resolve.