bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
53 stars 6 forks source link

Test suite hides missing class dependencies #9985

Open arcady-zherdev opened 2 weeks ago

arcady-zherdev commented 2 weeks ago

Gantt tests/index,js has these lines:

    preload : [
        ...preloads,
        placeOnWindow([
            '../lib/Core/Base.js',
            '../lib/Core/data/DomDataStore.js',
            '../lib/Core/helper/AjaxHelper.js',
            '../lib/Core/helper/BrowserHelper.js',
            '../lib/Core/helper/DateHelper.js',
            '../lib/Core/helper/DomHelper.js',
            '../lib/Core/helper/util/Rectangle.js',
            '../lib/Core/localization/LocaleManager.js',
            '../lib/Core/localization/LocaleHelper.js',
            '../lib/Core/mixin/Events.js',
            '../lib/Core/widget/Combo.js',
            '../lib/Core/widget/DateField.js',
            '../lib/Core/widget/TimeField.js',
            '../lib/SchedulerPro/view/ResourceUtilization.js',
            '../lib/Gantt/data/AssignmentStore.js',
            '../lib/Gantt/data/DependencyStore.js',
            '../lib/Gantt/data/ResourceStore.js',
            '../lib/Gantt/data/TaskStore.js',
            '../lib/Gantt/model/ProjectModel.js',
            '../lib/Gantt/view/Gantt.js'
        ])
    ],

They specify preloads for Using ES 6 modules (lib) group. This definition hides cases when we miss imports in classes. The reason is Gantt class for example imports a lot of classes.

There are plenty of tests where we do not use Gantt at all but it still imports 90% of the product code. Classes should be preloaded only where we need them.