Skip to content
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

[Eslint] Resolve deprecation warnings #8350

Open
mgadewoll opened this issue Feb 26, 2025 · 0 comments
Open

[Eslint] Resolve deprecation warnings #8350

mgadewoll opened this issue Feb 26, 2025 · 0 comments
Labels
low hanging fruit An issue, often a bug, that is lower effort and clearly ought to be fixed tech debt

Comments

@mgadewoll
Copy link
Contributor

mgadewoll commented Feb 26, 2025

Description

This issue is a follow-up to this PR.

After implementing eslint-plugin-deprecation there are linting warnings left around deprecated code.
We want to replace the deprecated usages with the expected alternatives where already possible to reduce the warnings.

Note

The are warnings around EuiSelectFilterItem being deprecated. For EuiComboBox this will be handled by updating it with EuiSelectable in this separate issue.

Guidance for picking up this task:

  • Address the smaller deprecations, that can be cleaned up now, in a straightforward way.
  • Anything larger that would take substantial effort is moved to a separate task.

Additional insight

ESLint output

eui/packages/eui/src-docs/src/store/configure_store.js
  22:42  warning  'createStore' is deprecated. **We recommend using the `configureStore` method
of the `@reduxjs/toolkit` package**, which replaces `createStore`.

Redux Toolkit is our recommended approach for writing Redux logic today,
including store setup, reducers, data fetching, and more.

**For more details, please read this Redux docs page:**
**https://redux.js.org/introduction/why-rtk-is-redux-today**

`configureStore` from Redux Toolkit is an improved version of `createStore` that
simplifies setup and helps avoid common bugs.

You should not be using the `redux` core package by itself today, except for learning purposes.
The `createStore` method from the core `redux` package will not be removed, but we encourage
all users to migrate to using Redux Toolkit for all Redux code.

If you want to use `createStore` without this visual deprecation warning, use
the `legacy_createStore` import instead:

`import { legacy_createStore as createStore} from 'redux'`  deprecation/deprecation

eui/packages/eui/src-docs/src/views/elastic_charts/accessibility_bullet.tsx
  49:10  warning  'Goal' is deprecated. please use `Bullet` spec instead  deprecation/deprecation

eui/packages/eui/src-docs/src/views/elastic_charts/goal.tsx
  49:12  warning  'Goal' is deprecated. please use `Bullet` spec instead  deprecation/deprecation

eui/packages/eui/src/components/breadcrumbs/_breadcrumb_content.tsx
   44:3  warning  'color' is deprecated. - if a custom color is wanted, use the `css` prop to pass custom css  deprecation/deprecation
  150:7  warning  'color' is deprecated. - if a custom color is wanted, use the `css` prop to pass custom css  deprecation/deprecation

eui/packages/eui/src/components/button/button_group/button_group.tsx
  154:3  warning  'name' is deprecated. No longer needed. You can safely remove this prop entirely  deprecation/deprecation

eui/packages/eui/src/components/combo_box/combo_box_options_list/combo_box_options_list.tsx
  205:8  warning  'EuiFilterSelectItem' is deprecated. - Use EuiSelectable instead  deprecation/deprecation

eui/packages/eui/src/components/datagrid/controls/data_grid_toolbar.stories.tsx
  269:41  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation
  290:41  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation
  316:35  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation
  328:41  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation
  348:35  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation

eui/packages/eui/src/components/datagrid/controls/full_screen_selector.stories.tsx
  60:35  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation

eui/packages/eui/src/components/datagrid/data_grid.stories.tsx
  153:35  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation
  208:35  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation

eui/packages/eui/src/components/drag_and_drop/drag_drop_context.stories.tsx
  117:35  warning  'PlayFunctionContext' is deprecated. Use {@link StoryContext } instead  deprecation/deprecation

eui/packages/eui/src/components/filter_group/filter_select_item.test.tsx
  17:29  warning  'EuiFilterSelectItem' is deprecated. - Use EuiSelectable instead  deprecation/deprecation
  20:35  warning  'EuiFilterSelectItem' is deprecated. - Use EuiSelectable instead  deprecation/deprecation

eui/packages/eui/src/components/filter_group/filter_select_item.tsx
  192:3  warning  'EuiFilterSelectItemClass' is deprecated. - Use EuiSelectable instead  deprecation/deprecation

eui/packages/eui/src/components/filter_group/index.ts
  19:10  warning  'EuiFilterSelectItem' is deprecated. - Use EuiSelectable instead  deprecation/deprecation
  19:10  warning  'EuiFilterSelectItem' is deprecated. - Use EuiSelectable instead  deprecation/deprecation

eui/packages/eui/src/components/markdown_editor/markdown_actions.ts
  271:35  warning  'execCommand' is deprecated.   deprecation/deprecation

eui/packages/eui/src/components/markdown_editor/markdown_editor.test.tsx
  286:14  warning  'execCommand' is deprecated.   deprecation/deprecation

eui/packages/eui/src/components/popover/popover.tsx
  638:7  warning  'hasDragDrop' is deprecated. - use `usePortal` prop on children `EuiDraggable` components instead  deprecation/deprecation

eui/packages/eui/src/services/color_picker/index.ts
  10:31  warning  'useColorStopsState' is deprecated.   deprecation/deprecation
  10:31  warning  'useColorStopsState' is deprecated.   deprecation/deprecation

eui/packages/eui/src/services/copy/copy_to_clipboard.ts
  42:17  warning  'execCommand' is deprecated.   deprecation/deprecation

eui/packages/eui/src/services/index.ts
  66:31  warning  'useColorStopsState' is deprecated.   deprecation/deprecation
  66:31  warning  'useColorStopsState' is deprecated.   deprecation/deprecation

✖ 29 problems (0 errors, 29 warnings)

warnings in the src-docs folder

These warnings will be removed after the new documentation site is released. They don't require any action right now.

#7401

"'color' is deprecated" warning

Looks like color can be safely removed (no uses in Kibana or cloud). No mention in the #1469. Verify the impact.

PlayFunctionContext warning

Replace with StoryContext. Drop-in replacement.

"Use EuiSelectable instead" warning

These warnings can only be removed with refactoring components to use EuiSelectable:

Skip for now.

"hasDragDrop is deprecated" warning

Looks like hasDragDrop can be safely removed (no uses in Kibana or cloud). It is mentioned in #1469.

"execCommand is deprecated" warning

There is no clear, drop-in replacement to execCommand but it's recommended to move away from it if possible because the support can be dropped at any time (MDN).

Functionalities needed and their replacements:

Requires separate tasks to refactor the code and verify the functionality is working as expected.

"useColorStopsState is deprecated" warning

Looks like useColorStopsState can be safely removed (no uses in Kibana or cloud). No mention in the #1469. Verify the impact before removing.

@JasonStoltz JasonStoltz added the low hanging fruit An issue, often a bug, that is lower effort and clearly ought to be fixed label Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low hanging fruit An issue, often a bug, that is lower effort and clearly ought to be fixed tech debt
Projects
None yet
Development

No branches or pull requests

2 participants