Profiles

General rules

  • Do not use default as a “launchable” profile

Examples

Base profile

Use base as a prefix, so you will know that those profiles are not “launchable” ones.

WRONG :

{
    "default": {
        "resolution": {
            "name": "fullHd",
            "width": 1920,
            "height": 1080
        },
        "Logger": {
            "ConsoleAppender": {
                "level": "info"
            }
        },
        "locales": [
            "fr-FR"
        ],
        "firstRoute": {
            "id": "splash"
        }
    },
    "hdReady": {
        "resolution": {
            "name": "hdReady",
            "width": 1280,
            "height": 720
        }
    }
}

GOOD :

{
    "default": {
        "resolution": {
            "name": "fullHd",
            "width": 1920,
            "height": 1080
        },
        "Logger": {
            "ConsoleAppender": {
                "level": "info"
            }
        },
        "locales": [
            "fr-FR"
        ],
        "firstRoute": {
            "id": "splash"
        }
    },
    "base-720p": {
        "resolution": {
            "name": "hdReady",
            "width": 1280,
            "height": 720
        }
    }
}

Create base profile to mutualise configuration of specific renderer, vendors…

WRONG :

{
    "default": {
        "resolution": {
            "name": "fullHd",
            "width": 1920,
            "height": 1080
        },
        "Logger": {
            "ConsoleAppender": {
                "level": "info"
            }
        },
        "locales": [
            "fr-FR"
        ],
        "firstRoute": {
            "id": "splash"
        }
    },

    //////////////////////////////////////////////////////////
    // BROWSER PROFILE
    //////////////////////////////////////////////////////////
    "browser-1080p": {
        "mixins": ["default",],
        "base": {
            "name": "Html5",
            "vendors": [
                "@dana/renderer-lightning-html5",
            ]
        }
    },
    "browser-720p": {
        "mixins": ["default"],
        "base": {
            "name": "Html5",
            "vendors": [
                "@dana/renderer-lightning-html5",
            ]
        },
        "resolution": {
            "name": "hdReady",
            "width": 1280,
            "height": 720
        }
    }
}

GOOD :

{
    "default": {
        "resolution": {
            "name": "fullHd",
            "width": 1920,
            "height": 1080
        },
        "Logger": {
            "ConsoleAppender": {
                "level": "info"
            }
        },
        "locales": [
            "fr-FR"
        ],
        "firstRoute": {
            "id": "splash"
        }
    },

    //////////////////////////////////////////////////////////
    // BASE PROFILE
    //////////////////////////////////////////////////////////

    "base-720p": {
        "resolution": {
            "name": "hdReady",
            "width": 1280,
            "height": 720
        }
    },
    "base-browser-lightning": {
        "base": {
            "name": "Html5Css",
            "vendors": [
                "@dana/renderer-lightning-html5",
            ]
        }
    },

    //////////////////////////////////////////////////////////
    // BROWSER PROFILE
    //////////////////////////////////////////////////////////
    "browser-1080p": {
        "mixins": [
            "default",
            "base-browser-lightning"
        ]
    },
    "browser-720p": {
        "mixins": [
            "browser-1080p",
            "base-720p"
        ]
    }
}

Vendor dependencies should not duplicate vendors

Only add useful dependencies in the vendors part.

Example: @dana/renderer-lightning-html5 has a dependency to @dana/engine-html5 and @dana/renderer-lightning so we only add @dana/renderer-lightning-html5 in package.json and profile in app.config.json.

You should add the dependency to @dana/engine-html5 in package.json only if a profile uses it directly without lightning renderer for example.

Wrong :

{
    "browser-1080p": {
        "mixins": ["default",],
           "base": {
            "name": "Html5",
            "vendors": [
                "@dana/engine-html5",
                "@dana/renderer-lightning",
                "@dana/renderer-lightning-html5",
            ]
        }
    }
}

Good :

{
    "browser-1080p": {
        "mixins": ["default",],
        "base": {
            "name": "Html5",
            "vendors": [
                "@dana/renderer-lightning-html5",
            ]
        }
    }
}