Skip to content

Grids: create dataSourceController - #35040

Open
anna-shakhova wants to merge 6 commits into
DevExpress:mainfrom
anna-shakhova:data_source_controller_main
Open

Grids: create dataSourceController#35040
anna-shakhova wants to merge 6 commits into
DevExpress:mainfrom
anna-shakhova:data_source_controller_main

Conversation

@anna-shakhova

Copy link
Copy Markdown
Contributor

No description provided.

@anna-shakhova anna-shakhova self-assigned this Sep 3, 2026
@anna-shakhova
anna-shakhova force-pushed the data_source_controller_main branch from 6aba1f7 to bc02336 Compare September 3, 2026 14:02
@anna-shakhova
anna-shakhova marked this pull request as ready for review September 3, 2026 14:02
@anna-shakhova
anna-shakhova requested a review from a team as a code owner September 3, 2026 14:02
Copilot AI lite review requested due to automatic review settings September 3, 2026 14:02
@anna-shakhova
anna-shakhova force-pushed the data_source_controller_main branch from bc02336 to 86bce1c Compare September 3, 2026 14:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

DataController assigns/uses this.dataSourceController without declaring the field, which is a TypeScript compile/lint error.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Introduces a new dataSource controller/module in the shared grid core to encapsulate access to the DataSourceAdapter, and wires it into both DataGrid and TreeList so other controllers can depend on it consistently.

Changes:

  • Added DataSourceController + dataSourceModule in grid_core and exposed it via Controllers['dataSource'].
  • Registered the new dataSource module (and placed it first in module order) for both DataGrid and TreeList.
  • Added Jest unit + integration coverage, and updated grid test mocks to always include the new leaf module.
File summaries
File Description
packages/devextreme/testing/helpers/gridBaseMocks.js Ensures dataSource module is always included in mock module setup.
packages/devextreme/js/__internal/grids/tree_list/module_not_extended/data_source.ts Registers dataSourceModule for TreeList.
packages/devextreme/js/__internal/grids/tree_list/m_widget_base.ts Imports TreeList dataSource module and adds it to modules order.
packages/devextreme/js/__internal/grids/grid_core/m_types.ts Adds dataSource to the Controllers interface.
packages/devextreme/js/__internal/grids/grid_core/data_source/data_source_module.ts Defines the dataSourceModule mapping to DataSourceController.
packages/devextreme/js/__internal/grids/grid_core/data_source/data_source_controller.ts Implements a controller wrapper around the DataSourceAdapter.
packages/devextreme/js/__internal/grids/grid_core/data_source/tests/data_source_controller.test.ts Unit tests for controller delegation and adapter lifecycle semantics.
packages/devextreme/js/__internal/grids/grid_core/data_source/tests/data_source_controller.integration.test.ts Integration tests verifying module registration/order and runtime linkage with DataController.
packages/devextreme/js/__internal/grids/grid_core/data_controller/data_controller.ts Caches the new controller and pushes adapter updates into it.
packages/devextreme/js/__internal/grids/data_grid/module_not_extended/data_source.ts Registers dataSourceModule for DataGrid.
packages/devextreme/js/__internal/grids/data_grid/m_widget_base.ts Imports DataGrid dataSource module and adds it to modules order.
Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 3, 2026 14:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The new controller is consistently registered in both grids, adapter synchronization is correctly wired through the single _dataSource assignment point, and the PR includes focused unit and integration coverage for behavior and registration.

Review details
  • Files reviewed: 11/11 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 4, 2026 08:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The module wiring is consistent across DataGrid/TreeList and the adapter lifecycle change is backed by both unit and integration Jest coverage.

Review details
  • Files reviewed: 13/13 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 4, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The refactor cleanly centralizes adapter creation behind a new controller, updates callers/tests accordingly, and adds both unit and integration coverage for the new module wiring.

Review details
  • Files reviewed: 17/17 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 4, 2026 12:24

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The updated DataGrid QUnit test directly mutates a private controller field and TreeList’s new module uses an inconsistent core import style that should be corrected before merging.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

packages/devextreme/js/__internal/grids/tree_list/data_source/data_source_module.ts:1

  • In TreeList internals, modules consistently import the core via relative paths (e.g. ../m_core in tree_list/editing/m_editing.ts:18). This file is the only one using the @ts/grids/tree_list/m_core alias, which makes imports inconsistent and harder to grep/relocate within the folder.
  • Files reviewed: 19/19 changed files
  • Comments generated: 1
  • Review effort level: Lite

Copilot AI review requested due to automatic review settings September 4, 2026 13:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

TreeList’s new dataSource module/controller introduce inconsistent module import specifiers compared to established TreeList conventions, which should be aligned before merging to avoid module-resolution edge cases.

Review details

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

packages/devextreme/js/__internal/grids/tree_list/data_source/data_source_controller.ts:3

  • TreeList implementation files generally reference the local data source adapter via a relative path (e.g. tree_list/data_source_adapter/m_data_source_adapter.ts is imported from other TreeList modules as "../data_source_adapter/m_data_source_adapter"). Aligning this new controller with that pattern avoids inconsistent module specifiers and reduces the chance of bundler alias/relative duplication issues.
    packages/devextreme/js/__internal/grids/tree_list/data_source/data_source_module.ts:1
  • In the TreeList codebase, modules typically import the local core via a relative path (e.g. tree_list/data_controller/m_data_controller.ts:8 and tree_list/data_source_adapter/m_data_source_adapter.ts:20 use "../m_core"). Using the @ts alias here introduces an inconsistent import pattern and can risk duplicate module instances if alias/relative resolution diverges in the build pipeline. Consider switching this to a relative import like the rest of the TreeList modules.
  • Files reviewed: 19/19 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants