code: function loadPageRecursively( page, pageRef, extensionChain ) {
  
        const { definition, name } = page;
  
        if( extensionChain.indexOf( name ) !== -1 ) {
           return Promise.reject( formatError(
              page,
              `Cycle in page extension detected: ${extensionChain.concat( [ name ] ).join( ' -> ' )}`
           ) );
        }
  
        if( !validators.page( definition ) ) {
           return Promise.reject( validators.error(
              `Validation failed for page "${pageRef}"`,
              validators.page.errors
           ) );
        }
  
        if( !definition.areas ) {
           definition.areas = {};
        }
  
        return processExtends( page, extensionChain )
           .then( () => {
              generateMissingIds( page );
              // we need to check ids before and after expanding compositions
              checkForDuplicateIds( page );
              return processCompositions( page, pageRef );
           } )
           .then( () => {
              checkForDuplicateIds( page );
              validateWidgetItems( page, pageRef );
              return page;
           } );
     }
docs: /////////////////////////////////////////////////////////////////////////////////////////////////////////