-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
React 18 types test #191738
base: main
Are you sure you want to change the base?
React 18 types test #191738
Conversation
/ci |
@@ -1599,6 +1600,7 @@ | |||
"@types/react-window": "^1.8.8", | |||
"@types/redux-actions": "^2.6.1", | |||
"@types/resolve": "^1.20.1", | |||
"@types/scheduler": "^0.23.0", |
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.
needed for old testing-library-version
yarn.lock
Outdated
version "18.2.0" | ||
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" | ||
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== | ||
dependencies: | ||
loose-envify "^1.1.0" | ||
|
||
react@^17.0.1, react@^17.0.2: | ||
react@^17.0.1: |
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.
comes from webpack-visualizer-plugin2
/ci |
/ci |
/ci |
💔 Build FailedFailed CI StepsMetrics [docs]Module Count
Any counts in public APIs
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
## Summary Part of #138222 This is one of the issues that `@types/react@18` upgrade highlights and that needs to be addressed with or before the upgrade. `field.helpText` is `ReactNode`, a function is not a valid `ReactNode`, but `@types/react@17` allowed a function. That is why `typeof field.helpText === 'function' ? field.helpText() : field.helpText` doesn't fail with `@17`, but fails with `@18` as `field.helpText is not callable, as never is not callable`. You can check the types with @types/react@18 yourself here #191738 It looks like the lazy `helpText` isn't needed apart from a hack for index management where documentation service is used as part of helpText that could be not available yet. To keep it supported, I specifically, allowed a function that returns a ReactNode for `helpText` on `FieldConfig`, but to make consumption clean and to now break other places `useField` will call it and pass just a `ReactNode` down
# Conflicts: # packages/kbn-alerts-grouping/src/components/alerts_grouping.tsx # packages/kbn-alerts-ui-shared/src/rule_form/rule_actions/rule_actions_alerts_filter_timeframe.tsx # packages/kbn-alerts-ui-shared/src/rule_form/rule_definition/rule_definition.tsx # packages/kbn-alerts-ui-shared/src/rule_settings/rule_settings_flapping_inputs.tsx # packages/kbn-field-utils/src/components/field_description/field_description.tsx # packages/kbn-management/settings/components/field_input/input/code_editor_input.tsx # packages/kbn-text-based-editor/src/text_based_languages_editor.tsx # packages/kbn-unified-data-table/src/components/data_table.tsx # packages/kbn-unified-data-table/src/hooks/use_selected_docs.ts # src/plugins/controls/public/react_controls/controls/data_controls/options_list_control/components/options_list_popover_suggestions.tsx # src/plugins/data_view_editor/public/components/form_fields/title_field.tsx # src/plugins/discover/public/application/doc/components/doc.tsx # src/plugins/discover/public/application/main/components/field_stats_table/field_stats_table.tsx # src/plugins/discover/public/application/main/components/top_nav/esql_dataview_transition/esql_dataview_transition_modal.tsx # src/plugins/discover/public/embeddable/get_search_embeddable_factory.tsx # src/plugins/es_ui_shared/static/forms/components/fields/button_group_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/card_radio_group_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/checkbox_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/combobox_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/date_picker_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/file_picker_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/multi_button_group_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/multi_select_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/numeric_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/password_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/radio_group_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/range_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/select_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/super_select_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/text_area_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/text_field.tsx # src/plugins/es_ui_shared/static/forms/components/fields/toggle_field.tsx # src/plugins/esql_datagrid/public/data_grid.tsx # src/plugins/unified_doc_viewer/public/components/doc_viewer_table/table.tsx # src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx # x-pack/packages/kbn-elastic-assistant/impl/assistant/assistant_header/index.tsx # x-pack/packages/kbn-elastic-assistant/impl/assistant/common/components/assistant_settings_management/pagination/use_session_pagination.ts # x-pack/packages/kbn-elastic-assistant/impl/assistant/conversations/conversation_settings/conversation_settings_editor.tsx # x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_editor.tsx # x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_modal/system_prompt_selector/system_prompt_selector.tsx # x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_editor/system_prompt/system_prompt_settings_management/default_conversations_column.tsx # x-pack/packages/kbn-elastic-assistant/impl/assistant/prompt_textarea/index.tsx # x-pack/packages/kbn-elastic-assistant/impl/assistant/quick_prompts/quick_prompt_selector/quick_prompt_selector.tsx # x-pack/packages/kbn-elastic-assistant/impl/assistant/settings/evaluation_settings/evaluation_settings.tsx # x-pack/packages/kbn-elastic-assistant/impl/data_anonymization/settings/anonymization_settings_management/index.tsx # x-pack/plugins/cases/public/components/case_form_fields/assignees.tsx # x-pack/plugins/cases/public/components/configure_cases/index.tsx # x-pack/plugins/cases/public/components/markdown_editor/plugins/lens/plugin.tsx # x-pack/plugins/data_visualizer/public/application/index_data_visualizer/embeddables/field_stats/field_stats_esql_editor.tsx # x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/components/agent_policy_advanced_fields/custom_fields/global_data_tags_table.test.tsx # x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/edit_package_policy_page/hooks/use_package_policy_steps.tsx # x-pack/plugins/index_management/public/application/sections/enrich_policy_create/steps/fields/indices_selector.tsx # x-pack/plugins/index_management/public/application/sections/home/index_list/details_page/details_page_filter_fields.tsx # x-pack/plugins/integration_assistant/public/components/create_integration_card_button/create_integration_card_button.tsx # x-pack/plugins/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx # x-pack/plugins/lens/public/visualizations/partition/dimension_editor.tsx # x-pack/plugins/lens/public/visualizations/partition/toolbar.tsx # x-pack/plugins/observability_solution/infra/public/alerting/inventory/components/metric.tsx # x-pack/plugins/observability_solution/infra/public/components/logging/log_analysis_setup/initial_configuration_step/analysis_setup_indices_form.tsx # x-pack/plugins/observability_solution/infra/public/components/logging/log_highlights_menu.tsx # x-pack/plugins/observability_solution/infra/public/pages/metrics/inventory_view/components/waffle/metric_control/custom_metric_form.tsx # x-pack/plugins/observability_solution/logs_shared/public/components/log_stream/log_stream.tsx # x-pack/plugins/security_solution/public/common/components/drag_and_drop/draggable_wrapper.tsx # x-pack/plugins/security_solution/public/common/components/guided_onboarding_tour/tour_step.tsx # x-pack/plugins/security_solution/public/common/components/markdown_editor/plugins/timeline/plugin.tsx # x-pack/plugins/security_solution/public/detection_engine/rule_details_ui/pages/rule_details/execution_log_table/execution_log_table.tsx # x-pack/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/versions_picker/versions_picker.tsx # x-pack/plugins/security_solution/public/detection_engine/rule_management_ui/pages/coverage_overview/rule_source_filter.tsx # x-pack/plugins/security_solution/public/flyout/document_details/left/components/host_details.tsx # x-pack/plugins/security_solution/public/flyout/document_details/left/components/user_details.tsx # x-pack/plugins/security_solution/public/flyout/network_details/components/network_details.tsx # x-pack/plugins/security_solution/public/timelines/components/formatted_ip/index.tsx # x-pack/plugins/security_solution/public/timelines/components/open_timeline/use_timeline_types.tsx # x-pack/plugins/security_solution/public/timelines/components/timeline/body/renderers/host_name.tsx # x-pack/plugins/stack_connectors/public/connector_types/gemini/dashboard_link.tsx # x-pack/plugins/stack_connectors/public/connector_types/servicenow_itsm/servicenow_itsm_params.tsx # x-pack/plugins/stack_connectors/public/connector_types/servicenow_sir/servicenow_sir_params.tsx # x-pack/plugins/stack_connectors/public/connector_types/thehive/params_case.tsx # x-pack/plugins/triggers_actions_ui/public/application/components/mustache_text_field_wrapper.tsx
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.
Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers