Search code examples
sapui5manifest.jsondescriptor

SAPUI5: DIfference between app/component/library in manifest sap.app property?


Can somebody explain me the difference in the sap.app property in manifest.json between "application, component, and library" ? Or is it only a description for the type of program? So does it not make any difference at all?

"sap.app": {
    "id": "mainapp",
    "type": "application",
    "i18n": "i18n/i18n.properties",
    "applicationVersion": {
      "version": "0.0.1"
    },

Solution

  • The loading of the app will differ for each type of module defined in the sap.app property of the manifest.json file in SAPUI5. Here is how the loading will change for each type:

    App: When an app is launched, the entire app and its dependencies are loaded into the browser in one go. This includes all the controllers, views, models, and other resources needed to run the app. Once the app is loaded, it initializes and runs in the browser. Since the app is a standalone module, it doesn't have any dependencies on other modules.

    Component: When a component is used in an app, only the component's metadata is loaded initially. This includes the component's configuration settings, controller and view definitions, and other metadata. When the component is instantiated within the app, the component's dependencies are loaded on demand. This includes any views, models, services, or other resources that are required to run the component. This allows for more efficient loading and better performance since only the required resources are loaded.

    Library: When a library is used in an app or component, only the library's metadata is loaded initially. This includes the library's configuration settings, control definitions, and other metadata. When a control or other resource from the library is used in an app or component, the control and its dependencies are loaded on demand. This includes any other controls, models, services, or other resources that are required to run the control. This also allows for more efficient loading and better performance since only the required resources are loaded.

    The loading in SAPUI5 is optimized based on the specific type of module and its dependencies.