Skip to content

TreeList - DataSourceAdapter - Extract tree building utils - #35053

Open
Tucchhaa wants to merge 1 commit into
DevExpress:mainfrom
Tucchhaa:treelist-adapter-extract-buildtree_26_2
Open

TreeList - DataSourceAdapter - Extract tree building utils#35053
Tucchhaa wants to merge 1 commit into
DevExpress:mainfrom
Tucchhaa:treelist-adapter-extract-buildtree_26_2

Conversation

@Tucchhaa

@Tucchhaa Tucchhaa commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@Tucchhaa Tucchhaa self-assigned this Sep 4, 2026
@Tucchhaa
Tucchhaa requested a review from a team as a code owner September 4, 2026 11:38
Copilot AI lite review requested due to automatic review settings September 4, 2026 11:38
@Tucchhaa Tucchhaa added the 26_2 label Sep 4, 2026

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 new node-keyed maps use plain objects with data-derived keys, which can enable prototype-pollution edge cases and should be hardened before approval.

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

Pull request overview

This PR extracts TreeList node/tree-building logic from DataSourceAdapterTreeList into reusable utilities and introduces dedicated types and Jest coverage for that logic.

Changes:

  • Added utils/nodes.ts with functions to build the node map/tree, compute hasChildren/expansion, and flatten visible nodes.
  • Added Jest tests covering tree building, visibility, hasChildren calculation, and fullBranch behavior.
  • Introduced TreeList-specific LoadOperation/TreeNode/NodeByKey types and updated TreeList/GridCore adapters with stronger typing.
File summaries
File Description
packages/devextreme/js/__internal/grids/tree_list/data_source_adapter/utils/nodes.ts New extracted tree-building/flattening utilities for TreeList nodes
packages/devextreme/js/__internal/grids/tree_list/data_source_adapter/utils/tests/nodes.test.ts New Jest coverage for extracted node utilities
packages/devextreme/js/__internal/grids/tree_list/data_source_adapter/types.ts New TreeList-specific adapter/node types used by the extracted utilities and adapter
packages/devextreme/js/__internal/grids/tree_list/data_source_adapter/m_data_source_adapter.ts Refactors TreeList adapter to consume extracted utilities and new types
packages/devextreme/js/__internal/grids/grid_core/data_source_adapter/m_data_source_adapter.ts Adds typing to the base adapter hook method signature
Review details
  • Files reviewed: 5/5 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.

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