-
Notifications
You must be signed in to change notification settings - Fork 654
Angular: Configuration Components Deprecation Warning #31511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 25_2
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 introduces a deprecation warning system for legacy nested configuration components in the DevExtreme Angular wrapper. The implementation detects when developers use generic legacy nested components (like dxi-item, dxo-animation) and warns them to upgrade to component-specific variants (like dxi-accordion-item, dxo-accordion-animation).
Key changes:
- New deprecation warning utility that detects legacy nested component usage and suggests modern replacements
- Integration of the warning system into the nested option lifecycle
- Comprehensive mapping of legacy to modern selectors across all DevExtreme components
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/devextreme-angular/src/core/nested-option.ts |
Added import and integration of the deprecation warning into NestedOptionHost.setNestedOption() |
packages/devextreme-angular/src/core/deprecated-config-warning.ts |
New file implementing the deprecation warning logic with class name parsing, host component detection, and console warning emission |
packages/devextreme-angular/src/core/deprecated-config-map.ts |
New generated file containing mappings from host components to their legacy/modern nested component selector pairs |
There was a problem hiding this comment.
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 7 out of 7 changed files in this pull request and generated 1 comment.
There was a problem hiding this comment.
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 7 out of 7 changed files in this pull request and generated no new comments.
There was a problem hiding this comment.
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 7 out of 7 changed files in this pull request and generated 2 comments.
| export * from './warning-helper'; | ||
| export * from './warning-codes'; |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting warning-helper and warning-codes as part of the public API may expose internal implementation details. Consider whether these utilities should be publicly exported or if only specific functions like logWarning need to be part of the public API. If they are intended for internal use only, they should not be exported from the package index.
| export * from './warning-helper'; | |
| export * from './warning-codes'; |
| function getHostMapping(host: INestedOptionContainer | undefined): DeprecatedConfigEntry | undefined { | ||
| const visited = new Set<INestedOptionContainer>(); | ||
| let current = host; | ||
|
|
||
| while (current && !visited.has(current)) { | ||
| visited.add(current); | ||
|
|
||
| const ctorName = current.constructor?.name; | ||
| if (ctorName && Object.prototype.hasOwnProperty.call(DEPRECATED_CONFIG_COMPONENTS, ctorName)) { | ||
| return DEPRECATED_CONFIG_COMPONENTS[ctorName] as DeprecatedConfigEntry; | ||
| } | ||
|
|
||
| current = (current as { _host?: INestedOptionContainer })._host; | ||
| } | ||
|
|
||
| return undefined; | ||
| } |
Copilot
AI
Nov 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use hasOwn (available in ES2022) or check the property directly on the object instead of using Object.prototype.hasOwnProperty.call. The current approach is overly verbose. Consider: if (ctorName && ctorName in DEPRECATED_CONFIG_COMPONENTS) or if (ctorName && DEPRECATED_CONFIG_COMPONENTS[ctorName]) since DEPRECATED_CONFIG_COMPONENTS is a const object with known properties.
No description provided.