Skip to content

Core(utils): type 6 m_ files ahead of the rename, part 2 - #35504

Merged
EugeniyKiyashko merged 47 commits into
DevExpress:mainfrom
EugeniyKiyashko:typescript/core/utils_typing_5039_part2
Oct 8, 2026
Merged

EugeniyKiyashko merged 47 commits into
DevExpress:mainfrom
EugeniyKiyashko:typescript/core/utils_typing_5039_part2

Conversation

@EugeniyKiyashko

Copy link
Copy Markdown
Contributor

No description provided.

@EugeniyKiyashko EugeniyKiyashko self-assigned this Oct 6, 2026
@EugeniyKiyashko
EugeniyKiyashko force-pushed the typescript/core/utils_typing_5039_part2 branch 2 times, most recently from 2493509 to 4628235 Compare October 6, 2026 13:48
@EugeniyKiyashko
EugeniyKiyashko marked this pull request as ready for review October 6, 2026 13:48
@EugeniyKiyashko
EugeniyKiyashko requested review from a team as code owners October 6, 2026 13:48
Copilot AI balanced review requested due to automatic review settings October 6, 2026 13:48

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

The normalized load-result contract incorrectly guarantees that extra is an object even when runtime returns undefined or another value.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Types six core utility modules ahead of renaming and updates affected consumers across the DevExtreme codebase.

Changes:

  • Adds typings for shadow DOM, selection, iterator, extension, error, and date utilities.
  • Adds comprehensive Jest coverage for those utilities.
  • Updates dependent UI, Scheduler, visualization, data, and grid code.
File Description
packages/​devextreme/​js/​__internal/​viz/​vector_map/​map_layer.ts Types map layer strategies.
packages/​devextreme/​js/​__internal/​viz/​series/​financial_series.ts Types financial point styles.
packages/​devextreme/​js/​__internal/​viz/​core/​base_widget.ts Types incident logging arguments.
packages/​devextreme/​js/​__internal/​ui/​tree_view/​tree_view.base.ts Refines defaults and action types.
packages/​devextreme/​js/​__internal/​ui/​toolbar/​toolbar.base.ts Types grouped toolbar items.
packages/​devextreme/​js/​__internal/​ui/​text_box/​text_editor.base.ts Documents attribute typing limitation.
packages/​devextreme/​js/​__internal/​ui/​speed_dial_action/​speed_dial_main_item.ts Refines merged option typing.
packages/​devextreme/​js/​__internal/​ui/​selection/​selection.ts Types merged selection options.
packages/​devextreme/​js/​__internal/​ui/​scroll_view/​scrollable.simulated.ts Broadens action event typing.
packages/​devextreme/​js/​__internal/​ui/​scroll_view/​scrollable.native.ts Types scrollbar orientation.
packages/​devextreme/​js/​__internal/​ui/​scroll_view/​scroll_view.simulated.ts Marks initialized text elements.
packages/​devextreme/​js/​__internal/​ui/​scroll_view/​scroll_view.native.pull_down.ts Marks refreshing text initialized.
packages/​devextreme/​js/​__internal/​ui/​responsive_box.ts Types screen items and layouts.
packages/​devextreme/​js/​__internal/​ui/​popup/​popup.ts Types toolbar shortcuts and placement.
packages/​devextreme/​js/​__internal/​ui/​gantt/​ui.gantt.cache.ts Removes obsolete suppression.
packages/​devextreme/​js/​__internal/​ui/​form/​form.layout_manager.utils.ts Refines label option casting.
packages/​devextreme/​js/​__internal/​ui/​form/​form.items_runtime_info.ts Types generic widget results.
packages/​devextreme/​js/​__internal/​ui/​file_manager/​file_items_controller.ts Types root directory metadata.
packages/​devextreme/​js/​__internal/​ui/​diagram/​ui.diagram.ts Refines diagram option typing.
packages/​devextreme/​js/​__internal/​ui/​diagram/​ui.diagram.toolbar.ts Types export defaults.
packages/​devextreme/​js/​__internal/​ui/​date_range_box/​date_range_box.ts Corrects serialized date return type.
packages/​devextreme/​js/​__internal/​ui/​date_box/​date_box.base.ts Refines date serialization types.
packages/​devextreme/​js/​__internal/​ui/​context_menu/​menu_base.edit.strategy.ts Types flattened menu items.
packages/​devextreme/​js/​__internal/​ui/​color_box/​color_view.ts Types editor options.
packages/​devextreme/​js/​__internal/​ui/​collection/​collection_widget.live_update.ts Documents grouped data typing.
packages/​devextreme/​js/​__internal/​ui/​collection/​collection_widget.base.ts Refines action event typing.
packages/​devextreme/​js/​__internal/​ui/​chat/​messagelist.ts Makes timestamp coercion explicit.
packages/​devextreme/​js/​__internal/​ui/​calendar/​calendar.ts Refines calendar date types.
packages/​devextreme/​js/​__internal/​ui/​calendar/​calendar.base_view.ts Types serialized DOM attributes.
packages/​devextreme/​js/​__internal/​ui/​action_sheet.ts Refines shared overlay configuration.
packages/​devextreme/​js/​__internal/​scheduler/​workspaces/​work_space.ts Removes redundant casts.
packages/​devextreme/​js/​__internal/​scheduler/​utils/​data_accessor/​appointment_data_accessor.ts Types appointment date access.
packages/​devextreme/​js/​__internal/​scheduler/​scheduler.ts Refines merged scheduler options.
packages/​devextreme/​js/​__internal/​scheduler/​appointment_popup/​form.ts Types appointment form dates.
packages/​devextreme/​js/​__internal/​m_sortable.ts Documents reorder promise typing.
packages/​devextreme/​js/​__internal/​grids/​tree_list/​m_widget_base.ts Documents module API mismatches.
packages/​devextreme/​js/​__internal/​grids/​tree_list/​core.ts Makes traversal flag optional.
packages/​devextreme/​js/​__internal/​grids/​pivot_grid/​m_widget.ts Types pivot cell events.
packages/​devextreme/​js/​__internal/​grids/​new/​grid_core/​widget.ts Uses inferred merged defaults.
packages/​devextreme/​js/​__internal/​grids/​new/​grid_core/​toolbar/​utils.ts Uses inferred toolbar item type.
packages/​devextreme/​js/​__internal/​grids/​new/​grid_core/​options_validation/​utils.ts Requires an error code.
packages/​devextreme/​js/​__internal/​grids/​new/​grid_core/​options_controller/​options_controller_base.ts Types cloned options.
packages/​devextreme/​js/​__internal/​grids/​new/​grid_core/​options_controller/​component.mock.ts Types cloned mock properties.
packages/​devextreme/​js/​__internal/​grids/​new/​grid_core/​filtering/​filter_controller.ts Types built-in operations.
packages/​devextreme/​js/​__internal/​grids/​new/​card_view/​widget.ts Uses inferred default options.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​views/​m_rows_view.ts Aligns row method visibility.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​views/​m_grid_view.ts Refines width and view typing.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​views/​m_columns_view.ts Defines view extension contracts.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​validating/​m_validating.ts Uses processed column types.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​header_filter/​m_header_filter_core.ts Preserves literal option types.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​filter/​__tests__/​filter_controller.normalize_filter_selectors.test.ts Types tagged test filters.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​filter_sync/​utils.ts Removes obsolete constructor suppression.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​filter_sync/​m_filter_custom_operations.ts Types custom filter operations.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​filter_row/​m_filter_row.ts Aligns row method visibility.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​data_controller/​data_controller.ts Requires error identifiers.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​columns_resizing_reordering/​utils.ts Types dragging panels.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​columns_controller/​types.ts Adds processed column types.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​columns_controller/​columns_controller.ts Applies processed column typing.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​columns_controller/​__tests__/​columns_controller.integration.test.ts Types mocked errors.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​column_headers/​m_column_headers.ts Aligns extension method visibility.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​column_chooser/​m_column_chooser.ts Exposes panel bounds method.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​column_chooser/​__tests__/​column_chooser.integration.test.ts Types mocked errors.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_column/​__tests__/​ai_column.integration.test.ts Types mocked errors.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_column/​__tests__/​ai_column.data_source_change.test.ts Types mocked errors.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_column/​__tests__/​ai_column.cache.test.ts Types mocked errors.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_column/​__tests__/​ai_column.api_handlers.test.ts Types mocked errors.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​ai_column/​__tests__/​ai_column.ai_data.test.ts Types mocked errors.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​adaptivity/​m_adaptivity.ts Uses processed columns.
packages/​devextreme/​js/​__internal/​grids/​grid_core/​adaptivity/​extenders/​adaptivity_rows_view.ts Aligns context-menu visibility.
packages/​devextreme/​js/​__internal/​grids/​data_grid/​summary/​m_summary.ts Aligns row method visibility.
packages/​devextreme/​js/​__internal/​grids/​data_grid/​grouping/​m_grouping.ts Aligns extension method visibility.
packages/​devextreme/​js/​__internal/​filter_builder/​m_utils.ts Removes obsolete constructor suppressions.
packages/​devextreme/​js/​__internal/​filter_builder/​m_filter_builder.ts Types action definitions.
packages/​devextreme/​js/​__internal/​exporter/​exceljs/​export_format.ts Types converted formats.
packages/​devextreme/​js/​__internal/​data/​errors.ts Types logged error identifiers.
packages/​devextreme/​js/​__internal/​data/​data_source/​utils.ts Types normalized load results.
packages/​devextreme/​js/​__internal/​core/​widget/​dom_component.ts Refines attributes and nested options.
packages/​devextreme/​js/​__internal/​core/​widget/​component.ts Uses typed action events.
packages/​devextreme/​js/​__internal/​core/​utils/​m_shadow_dom.ts Types shadow DOM utilities.
packages/​devextreme/​js/​__internal/​core/​utils/​m_selection_filter.ts Types selection filter construction.
packages/​devextreme/​js/​__internal/​core/​utils/​m_iterator.ts Adds iterator overloads.
packages/​devextreme/​js/​__internal/​core/​utils/​m_extend.ts Adds typed merge overloads.
packages/​devextreme/​js/​__internal/​core/​utils/​m_error.ts Types error factories and logging.
packages/​devextreme/​js/​__internal/​core/​utils/​m_date_serialization.ts Types date serialization utilities.
packages/​devextreme/​js/​__internal/​core/​utils/​m_data.ts Removes obsolete constructor suppression.
packages/​devextreme/​js/​__internal/​core/​utils/​m_common.ts Types mapped match candidates.
packages/​devextreme/​js/​__internal/​core/​utils/​__tests__/​m_shadow_dom.test.ts Adds shadow DOM utility tests.
packages/​devextreme/​js/​__internal/​core/​utils/​__tests__/​m_selection_filter.test.ts Adds selection filter tests.
packages/​devextreme/​js/​__internal/​core/​utils/​__tests__/​m_iterator.test.ts Adds iterator utility tests.
packages/​devextreme/​js/​__internal/​core/​utils/​__tests__/​m_extend.test.ts Adds merge utility tests.
packages/​devextreme/​js/​__internal/​core/​utils/​__tests__/​m_error.test.ts Adds error utility tests.
packages/​devextreme/​js/​__internal/​core/​utils/​__tests__/​m_date_serialization.test.ts Adds date utility tests.
packages/​devextreme/​js/​__internal/​core/​r1/​dom_component_wrapper.tsx Types wrapper properties.
packages/​devextreme/​js/​__internal/​core/​devices.ts Uses inferred device type.
packages/​devextreme/​js/​__internal/​core/​action.ts Exports action event typing.
packages/​devextreme/​js/​__internal/​common/​core/​animation/​m_position.ts Types calculated positions.
packages/​devextreme/​js/​__internal/​common/​core/​animation/​fx.ts Uses typed regular-expression matches.

💡 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/data/data_source/utils.ts Outdated
Copilot AI balanced review requested due to automatic review settings October 6, 2026 14:00

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 new extend return type incorrectly treats nullable sources as always present.

Review effort: Balanced
Findings: None

Resolved since last review (1)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Preserve nullish uncertainty in merged return types

packages/​devextreme/​js/​__internal/​core/​utils/​m_extend.ts:29

NonNullable<T> makes a nullable source look unconditional in the return type. For example, const source: { value: string } | undefined = ...; const merged = extend({}, source) now types merged.value as string, although at runtime the undefined source is skipped and value is absent. Please preserve nullish uncertainty (for example, model the non-null branch as Partial<NonNullable<T>> when T also contains an EmptySource) so callers cannot access properties that may not exist.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 21:36
@EugeniyKiyashko
EugeniyKiyashko force-pushed the typescript/core/utils_typing_5039_part2 branch from 6857f7e to 1e58f59 Compare October 6, 2026 21:36

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

Core utility contracts still mishandle optional merge sources, constructor usage, and a nullable Shadow DOM stylesheet path.

Review effort: Balanced
Findings: 1 High severity · 2 Medium severity

Open (3)

Comment thread packages/devextreme/js/__internal/core/utils/m_shadow_dom.ts Outdated
Comment thread packages/devextreme/js/__internal/core/utils/m_extend.ts Outdated
Comment thread packages/devextreme/js/__internal/core/utils/m_selection_filter.ts Outdated
Copilot AI balanced review requested due to automatic review settings October 7, 2026 08:49

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 new extend return type incorrectly intersects overwritten properties, producing impossible types for common merges.

Review effort: Balanced
Findings: None

Resolved since last review (3)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Model extend overrides as later property types, not intersections

packages/​devextreme/​js/​__internal/​core/​utils/​m_extend.ts:38

The merged result is modeled as an intersection, but extend overwrites earlier properties. For example, extend({ value: 1 }, { value: 'x' }).value is inferred as number & string (never), although the runtime value is a string. This will make ordinary overriding merges incorrectly unusable; accumulate sources with overwrite semantics (for example, omit keys supplied by the next non-skipped source before adding that source), while preserving the optional-source behavior.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 09:12
@EugeniyKiyashko
EugeniyKiyashko force-pushed the typescript/core/utils_typing_5039_part2 branch from 9fbfb91 to c63dff3 Compare October 7, 2026 09:12

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 broad core utility contracts and numerous downstream assertions warrant final human verification despite the added regression coverage.

Review effort: Balanced
Findings: None

@EugeniyKiyashko
EugeniyKiyashko force-pushed the typescript/core/utils_typing_5039_part2 branch from 06cca64 to 1c4ebe2 Compare October 7, 2026 14:44
@github-actions github-actions Bot added the .d.ts label Oct 7, 2026
@EugeniyKiyashko
EugeniyKiyashko force-pushed the typescript/core/utils_typing_5039_part2 branch from 86aeee8 to a16a115 Compare October 7, 2026 20:46
dmlvr
dmlvr previously approved these changes Oct 8, 2026
Comment thread packages/devextreme/js/__internal/exporter/exceljs/export_format.ts
Comment thread packages/devextreme/js/__internal/grids/grid_core/columns_controller/types.ts Outdated
FilterBuilder types moved to types.ts: the internal operations keep a nullable
filter expression and the value-text customizeText; the items get their id on
creation. Sortable passes the element type to getPublicElement.
…replaces

- DOMComponent, Widget, DiagramFloatingPanel: the default options are a spread;
  the undefined entries were skipped by extend and are dropped
- grids: a hasCellValueCalculator guard instead of ProcessedColumn casts,
  an explicit index check in adaptivity
- SpeedDial: the action options are a partial patch, onClick can be null
- satisfies DataType[], parseFloat(String(width))
…pointment date reads

- findBestMatches is generic by the filter and the item, no cast of the item
- Form: the runtime info returns the widget union, getEditor and getButton narrow it
  by instanceof (getButton is typed by the Button wrapper it returns)
- Scheduler: the date field of the form and of the data accessor is read in one place
OptionAction<THandler> derives the arguments of an action from the handler of its
option without the EventInfo fields that the action adds itself; the panel events
are EventInfo<panel> plus their own fields. The visibility actions no longer pass
the component, the action sets it.
getEditor narrowed the widget instance by `instanceof Editor`, but dxCheckBox is
an r1 wrapper (ComponentWrapper), not a subclass of the internal Editor, so
getEditor returned undefined for a check box. Editor.isEditor is the guard that
the check box wrapper extends for this case.
…p-merged arrays

- a union source is applied member by member: a target property that only one
  member overrides is no longer typed by the target alone
- the kept target properties are picked by key remapping instead of Omit, so the
  known properties of a target with an index signature keep their types
- a deep merge of two arrays is typed by the items of both arrays, as in the
  shallow merge
- a nested source value that can be undefined keeps the target value in the type,
  and a nested target value that can be missing gives a copy of the source value
… a generic source

`extend({}, source, ...patches)` and `extend(true, {}, source, ...patches)` copy the
source into a new object, so the result has the type of the source when the patches
only hold its own properties. The conditional result type of the general overloads
stays unresolved for a generic source, which needed casts and a directive at the
callers: options_controller_base, component.mock and the clone of an export cell
(its empty cell is typed as a patch of the prepared item).
…ads type

devices, mergeColumns, the grid state storing and the html editor form dialog copy
an object into `{}`, so extend gives the type of the copied object without a cast.
- allowGrouping of the common column settings is `'auto'` again when
  groupPanel.visible is 'auto' (the Boolean() wrapper changed the value that
  columnOption returns); ColumnCommonSettings types it as boolean | 'auto'
- the lookup and the validator read calculateCellValue without a guard again,
  createColumn initializes it, as _updateColumnOptions already states
- the reset of the expand columns is a typed Partial<Column>, so only the null
  minWidth needs a directive instead of the whole map callback
…e handler

The options of the header filter TreeView are a typed Pick of its properties,
so the directive covers only onOptionChanged, whose handler takes the internal
TreeView while the option declares the public one.
…f guarding its nodes

A removed node is null only inside _removeNode and _markChildren, which splice
it out before they return, so the stored structure, getData, getFullData and
search hold nodes only. The marking goes through a nullable view of the same
array, and the `if (!node)` guards that the typed each() had added are gone.
… literal

- the config is Partial: the workspace defaults fill what a view does not set
  (agendaDuration, the scrolling mode)
- startDate is DateLike, the startDate of a view reaches the workspace as is
- the resources option of the workspace holds the resource configs, not loaders
  (the workspace never reads it)
- the remaining mismatch has a directive on its own line: the workspace types
  the selected cells of onSelectedCellsClick as object
…g literal

A directive on a property of the literal also hid the scrolling mismatch that
comes from the spread view options: TypeScript reports only the failing literal
property then. The handler gets its own typed declaration with the directive, and
the resolved scrolling (the same object as the view scrolling) is passed
explicitly, so the rest of the literal is checked again. The scrolling mode is
not filled by the partial type, as the previous commit message said.
…nd getButton

Narrowing the found widget (instanceof Editor, then Editor.isEditor) changed the
public methods: getEditor('<button item name>') and getEditor('<tabbed item
name>') returned undefined instead of the Button and the TabPanel the runtime info
stores for those items. Both methods return the stored widget as before; their
internal type is the FormWidgetInstance union, the public d.ts is unchanged.
The Jest test pins the check box, the button and the tab panel lookups.
…itions

formatObjectConverter takes a Format and a DataType and returns the format, the
precision and the currency typed by Format and FormatObject. The precision is read
from any format as before; a string or a function format has none, so that read
keeps a directive.
…e typed hubs

The rebase onto main brought the typed m_columns_view (DevExpress#35510); its code meets the
typed extend and each:
- _afterRowPrepared takes the ActionEvent of the row prepared action
- the local ScrollableOptions of this PR gives way to the one of the views types;
  the copied useNative: 'auto' of the grid scrolling keeps a directive, it is
  normalized right below
- _renderRows reads the columns that _renderTable sets on its options
- the header filter of a group panel column reads its groupIndex
- the cells of a fixed table row are HTML elements
getBoundingRect is protected again in the views: main reaches it through View.
@EugeniyKiyashko
EugeniyKiyashko force-pushed the typescript/core/utils_typing_5039_part2 branch from fdda7c7 to f2c45e6 Compare October 8, 2026 12:43
@EugeniyKiyashko
EugeniyKiyashko merged commit c83034a into DevExpress:main Oct 8, 2026
191 of 196 checks passed
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.

4 participants