GridCore data: Relocate _editingController to editing data-extenders (virtual scrolling) - #34875
Conversation
_editingController to editing data-extenders (virtual scrolling)
There was a problem hiding this comment.
Pull request overview
This PR refactors GridCore virtual scrolling internals by extracting the virtual scrolling data-controller extender into a dedicated extender file, and separating module registration and shared constants into standalone modules. This aligns the virtual scrolling structure with the “summary module” layout and updates dependent modules (TreeList/DataGrid/keyboard navigation) to use the new import paths.
Changes:
- Extracted
virtualScrollingDataControllerExtenderintovirtual_scrolling/extenders/virtual_scrolling_data_controller.tsand updated consumers. - Moved virtual scrolling module definition into
virtual_scrolling_module.tsand shared constants intoconst.ts. - Adjusted TreeList/DataGrid/keyboard navigation imports to the new module/extender structure.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/devextreme/js/__internal/grids/tree_list/m_virtual_scrolling.ts | Updates TreeList virtual scrolling wiring to import the extracted data-controller extender and new module definition. |
| packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/virtual_scrolling_module.ts | New file: defines virtualScrollingModule and registers extenders via the extracted data-controller extender. |
| packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/m_virtual_scrolling.ts | Removes embedded data-controller extender/module; moves constants to const.ts and exports helper functions for the extracted extender. |
| packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/extenders/virtual_scrolling_data_controller.ts | New file: contains the extracted data-controller extender logic (including _editingController initialization). |
| packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/const.ts | New file: centralizes virtual scrolling constants previously defined in m_virtual_scrolling.ts. |
| packages/devextreme/js/__internal/grids/grid_core/keyboard_navigation/m_keyboard_navigation.ts | Updates type import for VirtualScrollingDataControllerExtension to the new extender file. |
| packages/devextreme/js/__internal/grids/data_grid/module_not_extended/virtual_scrolling.ts | Updates DataGrid module registration to import virtualScrollingModule from the new module file. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ceda37c to
b7a36e1
Compare
b7a36e1 to
8c7cc3e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Suppressed comments (1)
packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/extenders/virtual_scrolling_data_controller.ts:5
- The file introduces a large set of file-level eslint disables that were not present when this code lived in virtual_scrolling/m_virtual_scrolling.ts, which weakens lint coverage for this logic. Prefer removing these global disables and addressing any lint violations locally (or with narrowly scoped eslint-disable-next-line).
/* eslint-disable consistent-return */
/* eslint-disable @typescript-eslint/no-this-alias */
/* eslint-disable @typescript-eslint/init-declarations */
/* eslint-disable prefer-rest-params */
/* eslint-disable @stylistic/max-len */
| return pageSize && pageSize < rowPageSize ? pageSize : rowPageSize; | ||
| } | ||
|
|
||
| public reload() { |
There was a problem hiding this comment.
lets type methods we already typed in base
| import { resizing, rowsView } from './m_virtual_scrolling'; | ||
|
|
||
| interface VirtualScrollingModuleOptions { | ||
| scrolling: { |
There was a problem hiding this comment.
extend public type, so we don't have to duplicate public options
| import type { ModuleType } from '@ts/grids/grid_core/m_types'; | ||
| import gridCoreUtils from '@ts/grids/grid_core/m_utils'; | ||
| import type { RowsView } from '@ts/grids/grid_core/views/m_rows_view'; | ||
| import { virtualScrollingDataControllerExtender } from '@ts/grids/grid_core/virtual_scrolling/extenders/virtual_scrolling_data_controller'; |
There was a problem hiding this comment.
nitpick: for imports like this index file at module core looks reasonable
| > => class VirtualScrollingDataControllerExtender extends Base { | ||
| protected _editingController!: EditingController; | ||
|
|
||
| public init(): void { |
There was a problem hiding this comment.
reorganize, please: all fields declaration -> methods
5c4002e to
b2fd575
Compare
b2fd575 to
66ec03e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.
Suppressed comments (1)
packages/devextreme/js/__internal/grids/grid_core/virtual_scrolling/extenders/virtual_scrolling_data_controller.ts:16
- This new extender file disables a large set of ESLint/TS rules for the entire module. This is a maintainability risk because it can mask new issues in future edits (and other grid_core/*/extenders files typically avoid blanket disables and instead keep the code lint-clean or use narrow per-line suppressions). Consider removing the file-wide disables and addressing the specific lint violations (or replacing them with targeted
eslint-disable-next-linefor the few unavoidable legacy patterns).
/* eslint-disable consistent-return */
/* eslint-disable @typescript-eslint/no-this-alias */
/* eslint-disable @typescript-eslint/init-declarations */
/* eslint-disable prefer-rest-params */
/* eslint-disable @stylistic/max-len */
/* eslint-disable no-plusplus */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/explicit-function-return-type */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
/* eslint-disable prefer-spread */
/* eslint-disable @stylistic/no-mixed-operators */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
/* eslint-disable @typescript-eslint/no-unused-expressions */
/* eslint-disable @typescript-eslint/no-shadow */
/* eslint-disable no-param-reassign */
What
Extracts the virtual scrolling data-controller extender into its own file and moves the module registration and constants into separate files
How
Mirrors the summary module structure with extenders/virtual_scrolling_data_controller.ts, virtual_scrolling_module.ts and const.ts; the data extender now declares
_editingControllerlocally