-
Notifications
You must be signed in to change notification settings - Fork 660
Fix TS problems and make TS improvements in demos (Editors) - part 1 (#32010) #32038
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
Fix TS problems and make TS improvements in demos (Editors) - part 1 (#32010) #32038
Conversation
…evExpress#32010) Signed-off-by: Andrei Kharitonov <[email protected]>
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 addresses TypeScript issues and improves type safety in React demos for the Editors section (part 1). The changes upgrade the TypeScript lib configuration, add comprehensive type checking for editor demos, and improve code quality through better typing and modern React patterns.
Key Changes
- Upgraded TypeScript lib from ES2020/ES2022 to ES2023 for better feature support
- Added TypeScript checking for 12 demo categories (Editors, Autocomplete, Calendar, Chat, CheckBox, ColorBox, DateBox, DateRangeBox, DropDownBox, DropDownButton)
- Refactored data exports from default exports with methods to named exports with explicit types
- Converted class components to functional components with proper TypeScript typing
- Separated type imports from value imports following best practices
- Improved useCallback dependency arrays by removing redundant setState functions
- Replaced React.Fragment with <> shorthand syntax
Reviewed changes
Copilot reviewed 65 out of 65 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/demos/utils/ts-to-js-converter/converter.ts | Updated TypeScript lib to ES2023 |
| apps/demos/tsconfig.react-check.json | Updated lib and added 28 new demo paths for type checking |
| apps/demos/Demos/DropDownButton/Overview/React/types.ts | Added type definitions for ProfileSetting, Alignment, FontSize, LineHeight, TextAlign |
| apps/demos/Demos/DropDownButton/Overview/React/data.ts | Converted to typed named exports |
| apps/demos/Demos/DropDownButton/Overview/React/ColorIcon.tsx | Converted class to functional component with proper types |
| apps/demos/Demos/DropDownButton/Overview/React/App.tsx | Added comprehensive type annotations and improved imports |
| apps/demos/Demos/DropDownBox/*/React/App.tsx | Added type annotations and improved ref typing |
| apps/demos/Demos/DateRangeBox/*/React/App.tsx | Added type annotations and fixed dependency arrays |
| apps/demos/Demos/DateBox/Overview/React/* | Refactored data exports and added types |
| apps/demos/Demos/Common/PopupAndNotificationsOverview/React/* | Added HouseType and improved type safety |
| apps/demos/Demos/Common/EditorsRightToLeftSupport/React/* | Added EuropeanUnionCountries type |
| apps/demos/Demos/Common/EditorsOverview/React/* | Refactored Logo class to functional component |
| apps/demos/Demos/Common/EditorAppearanceVariants/React/* | Added EditorStyle and LabelMode types |
| apps/demos/Demos/Common/CustomTextEditorButtons/React/App.tsx | Comprehensive type improvements for button handlers |
| apps/demos/Demos/ColorBox/Overview/React/App.tsx | Separated type imports |
| apps/demos/Demos/CheckBox/Overview/React/App.tsx | Separated type imports and added types |
| apps/demos/Demos/Chat//React/ | Added comprehensive type annotations across all Chat demos |
| apps/demos/Demos/Calendar//React/ | Added type annotations and improved CalendarTypes usage |
| apps/demos/Demos/Autocomplete/Overview/React/* | Added type annotations for data and handlers |
Cherry-pick of #32010