Skip to content

Grids: remove stateStoring self extension - #34776

Open
anna-shakhova wants to merge 2 commits into
DevExpress:mainfrom
anna-shakhova:refactor_state_storing_main
Open

Grids: remove stateStoring self extension#34776
anna-shakhova wants to merge 2 commits into
DevExpress:mainfrom
anna-shakhova:refactor_state_storing_main

Conversation

@anna-shakhova

Copy link
Copy Markdown
Contributor

No description provided.

@anna-shakhova anna-shakhova self-assigned this Aug 14, 2026
Copilot AI lite review requested due to automatic review settings August 14, 2026 10:44
@anna-shakhova
anna-shakhova requested a review from a team as a code owner August 14, 2026 10:44

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.

Pull request overview

This PR refactors grid state storing to remove the “self extender” pattern and instead introduce a dedicated GridStateStoringController implementation shared by DataGrid/TreeList, along with stronger typing for the persisted state shape.

Changes:

  • Introduces GridState/PersistentState typings and a new GridStateStoringController to encapsulate previously extender-based controller logic.
  • Updates TreeList state storing to override the controller directly (instead of extending via stateStoringModule.extenders.controllers.stateStoring).
  • Tightens/expands related grid typings (e.g., selectionFilter, expandedRowKeys, column user-state fields) and adjusts related utilities.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/devextreme/js/__internal/grids/tree_list/state_storing.ts Switches TreeList to a dedicated controller subclass and updates module registration accordingly.
packages/devextreme/js/__internal/grids/grid_core/state_storing/types.ts Adds typed definitions for persisted grid state (GridState, PersistentState).
packages/devextreme/js/__internal/grids/grid_core/state_storing/state_storing_module.ts Replaces the old controller/extender wiring with the new shared controller class.
packages/devextreme/js/__internal/grids/grid_core/state_storing/state_storing_controller.ts New shared controller implementation for state storing (migrated from the previous extender).
packages/devextreme/js/__internal/grids/grid_core/state_storing/m_state_storing.ts Removes the old stateStoring controller extender code (now in the new controller file).
packages/devextreme/js/__internal/grids/grid_core/state_storing/m_state_storing_controller.ts Improves typing and load/save flow for state persistence.
packages/devextreme/js/__internal/grids/grid_core/state_storing/extenders/state_storing_data_controller.ts Extends the data controller extension contract and adjusts deferred failure typing/handling.
packages/devextreme/js/__internal/grids/grid_core/selection/m_selection.ts Removes a no-longer-needed TS suppression around selectionFilter option usage.
packages/devextreme/js/__internal/grids/grid_core/m_types.ts Adds selectionFilter to the internal option pick type for grid options.
packages/devextreme/js/__internal/grids/grid_core/data_controller/types.ts Narrows expandedRowKeys to an array type for consistency with usage.
packages/devextreme/js/__internal/grids/grid_core/columns_controller/types.ts Adds/extends column typing to match state-storing user state fields.
packages/devextreme/js/__internal/grids/grid_core/columns_controller/m_columns_controller_utils.ts Adjusts field-name includes check to work with as const field arrays.
packages/devextreme/js/__internal/grids/grid_core/columns_controller/const.ts Converts user-state field name lists to as const tuples for stronger typing.
packages/devextreme/js/__internal/core/utils/m_storage.ts Tightens session storage helper typing.
packages/devextreme/js/__internal/core/m_devices.ts Adjusts sessionStorage device override retrieval behavior.

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

}

const deviceOrName = sessionStorage.getItem('dx-force-device');
const deviceOrName = sessionStorage.getItem('dx-force-device') ?? '';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

will be renamed to state_storing_controller_core.ts in a separate PR

Copilot AI review requested due to automatic review settings August 14, 2026 11:59
};

export class GridStateStoringController extends StateStoringController<GridState> {
// eslint-disable-next-line @typescript-eslint/prefer-readonly

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fields set in utils that are marked for refactoring, so skipped checks, as resolving readonly issue required all TODOs to be resolved first

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.

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

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