TreeList - DataSourceAdapter - Extract tree building utils - #35053
Open
Tucchhaa wants to merge 1 commit into
Open
TreeList - DataSourceAdapter - Extract tree building utils#35053Tucchhaa wants to merge 1 commit into
Tucchhaa wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟡 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.tswith functions to build the node map/tree, computehasChildren/expansion, and flatten visible nodes. - Added Jest tests covering tree building, visibility,
hasChildrencalculation, andfullBranchbehavior. - Introduced TreeList-specific
LoadOperation/TreeNode/NodeByKeytypes 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.