Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#17018 closed defect (fixed)

[dojox/app] multipleAppConfigLayers includes modules in view controllers which have already been loaded by the dojo layer

Reported by: Paul Christopher Owned by: Ed Chatelain
Priority: undecided Milestone: 1.9
Component: DojoX App Version: 1.9.0b2
Keywords: Cc: cjolif
Blocked By: Blocking:

Description

Description

When setting "multipleAppConfigLayers:true" in the build profile, the view-level controllers get quite thick - too thick. So far, the view controllers include only modules which are not included in the main app layer. Good. However the build discovery tool does not check, whether those very modules have already been loaded with the dojo layer.

Solution

In discoverAppConfig.js, line 20, the build tool should not only check for the mainLayer but also for the dojoLayer?

if(!bc.layers[mid] && bc.multipleAppConfigLayers){
   bc.layers[mid] = { include: [], exclude: [ mainLayer, dojoLayer ] };
   mids = bc.layers[mid].include;
}

But I don't know how to pass in the dojoLayer in discoverAppConfig.js...

Steps to reproduce the issue

Build an app with "multipleAppConfigLayers" set to true. Examine the build-report.txt file, especially the description which modules are included in which layer at the very end of the file.

Most of the modules in dojo/dojo can be found in each of the page-level controller files (such as dojo/_base/kernel, dojo/domReady etc.). Due to this duplication, the view controllers get very thick.

Attachments (1)

ManualLayerAnalysis.xlsx (24.2 KB) - added by Paul Christopher 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 Changed 7 years ago by cjolif

Cc: cjolif added

comment:3 Changed 7 years ago by cjolif

Milestone: tbd1.9
Resolution: fixed
Status: newclosed

comment:4 Changed 7 years ago by Paul Christopher

Salut Christophe!

The output of the build tool looks very nice now! By the way: I have used Excel to analyze the layer files and optimize them. It is quite easy using Pivot tables. So you can quickly figure out, which view controllers use the same files (that's the only thing our build tool does not check for at the moment: it checks against the dojo layer and the app's main layer but it does not check for duplicates in view controllers).

Having found out, how often a module is used, you can further optimize the build by moving those "common" view controller modules into the app main layer file and add them there as new global dependencies.

Changed 7 years ago by Paul Christopher

Attachment: ManualLayerAnalysis.xlsx added

comment:5 Changed 7 years ago by cjolif

right, doing an analysis as you suggested makes this feature even more useful. Ideally we should do it automatically for our users. Any desire to contribute? :)

Note: See TracTickets for help on using tickets.