Skip to content

Data source adapter, virtual data loader, TreeList data controller and data source adapter - type virtual data loader - #35523

Open
bit-byte0 wants to merge 2 commits into
DevExpress:mainfrom
bit-byte0:refactor/type-virtual-data-loader-main
Open

bit-byte0 wants to merge 2 commits into
DevExpress:mainfrom
bit-byte0:refactor/type-virtual-data-loader-main

Conversation

@bit-byte0

Copy link
Copy Markdown
Contributor

What

Added strict types to the grid_core virtual data loader, so m_virtual_data_loader.ts passes the strict lint rules while keeping the m_ prefix

How

Annotated fields, parameters and return types, moved the loader contract types into types.ts and replaced the bare @ts-expect-error directives with real types

@bit-byte0
bit-byte0 requested a review from a team as a code owner October 6, 2026 18:19
Copilot AI balanced review requested due to automatic review settings October 6, 2026 18:19
@bit-byte0 bit-byte0 added the 26_2 label Oct 6, 2026
@bit-byte0 bit-byte0 self-assigned this Oct 6, 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.

Copilot review overview

🟡 Changes recommended

Several declared contracts contradict existing implementations, while a double assertion bypasses controller validation.

Review effort: Balanced
Findings: 4 Medium severity

Open (4)
What changed in this PR

Adds strict typing to the legacy grid virtual data loader and extracts its contracts.

Changes:

  • Defines loader controller, cache, callback, and data-option contracts.
  • Annotates loader fields, parameters, and return types.
  • Connects the virtual-scroll controller to the typed loader.
File Description
m_virtual_scrolling_core.ts Passes the controller to the typed loader.
virtual_data_loader/​types.ts Defines loader contracts.
m_virtual_data_loader.ts Adds strict annotations and removes type suppressions.

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

Comment thread packages/devextreme/js/__internal/grids/grid_core/virtual_data_loader/types.ts Outdated
Comment thread packages/devextreme/js/__internal/grids/grid_core/virtual_data_loader/types.ts Outdated
export type ChangedCallback = (args?: unknown) => void;

export interface ProcessedChange {
changeType?: unknown;

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.

can DataChange or StoreChange type help here with better typing?

const processChanged = (
that: VirtualDataLoader,
changed: ChangedCallback,
changeType?: unknown,

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.

is it corresponds DataChange changeType or StoreChange type?

}

private handleDataChanged(callBase, e) {
private handleDataChanged(callBase: ChangedCallback, e?: { changes?: unknown }): void {

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.

same for changes type

Copilot AI balanced review requested due to automatic review settings October 7, 2026 09:26

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.

Copilot review overview

🔵 Needs a closer look

The controller’s double assertion bypasses validation of the newly introduced loader contract.

Review effort: Balanced
Findings: None

Resolved since last review (4)

This branch has not been deployed

No deployments
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.

3 participants