-
Notifications
You must be signed in to change notification settings - Fork 655
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.
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.
|
|
||
| const warnedUsages = new Set<string>(); | ||
|
|
||
| const LEGACY_CLASS_NAME_REGEXP = /^Dx([io])([A-Za-z0-9]+)Component$/; |
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.
As I understand this regexp matches any Dx[io]..Component, not only legacy?
Lets name it NESTED_CLASS_NAME_REGEXP?
| const [, type, rest] = match; | ||
| const prefix = type === 'o' ? 'dxo-' : 'dxi-'; | ||
|
|
||
| return `${prefix}${toKebabCase(rest)}`; |
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.
How about this:
if use regexp like /^(Dx[io][A-Z]\w+)Component$/;
then do return toKebabCase(match[1]);
No description provided.