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

React 18 types test #191738

Draft
wants to merge 34 commits into
base: main
Choose a base branch
from
Draft

React 18 types test #191738

wants to merge 34 commits into from

Conversation

Dosant
Copy link
Contributor

@Dosant Dosant commented Aug 29, 2024

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:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@Dosant
Copy link
Contributor Author

Dosant commented Aug 29, 2024

/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",
Copy link
Contributor Author

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:
Copy link
Contributor Author

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

@Dosant Dosant changed the title test React 18 types test Aug 29, 2024
@Dosant
Copy link
Contributor Author

Dosant commented Aug 29, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Aug 30, 2024

/ci

@Dosant
Copy link
Contributor Author

Dosant commented Sep 2, 2024

/ci

@kibana-ci
Copy link
Collaborator

kibana-ci commented Sep 2, 2024

💔 Build Failed

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
aiops 654 652 -2
apm 1939 1937 -2
canvas 1288 1286 -2
cloudSecurityPosture 709 707 -2
core 516 514 -2
dashboard 637 635 -2
dataQuality 162 160 -2
datasetQuality 295 293 -2
dataVisualizer 811 809 -2
discover 1030 1028 -2
enterpriseSearch 2303 2301 -2
esql 84 82 -2
esqlDataGrid 418 416 -2
eventAnnotationListing 642 640 -2
exploratoryView 255 253 -2
files 12 13 +1
fleet 1215 1213 -2
home 269 267 -2
infra 1578 1576 -2
lens 1510 1508 -2
logsExplorer 619 617 -2
maps 1234 1233 -1
ml 2025 2024 -1
observability 1118 1116 -2
savedObjectsTagging 180 178 -2
securitySolution 5725 5723 -2
slo 899 897 -2
stackAlerts 155 153 -2
transform 512 510 -2
unifiedDocViewer 283 281 -2
total -55

Any counts in public APIs

Total count of every any typed public API. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats any for more detailed information.

id before after diff
@kbn/user-profile-components 1 0 -1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
aiops 633.3KB 630.7KB -2.7KB
apm 3.5MB 3.5MB -2.6KB
canvas 1.1MB 1.1MB -2.6KB
core 150.9KB 148.3KB -2.6KB
dashboard 547.3KB 544.6KB -2.7KB
dataQuality 114.1KB 111.4KB -2.7KB
datasetQuality 289.9KB 287.2KB -2.7KB
dataViewFieldEditor 176.8KB 176.9KB +68.0B
dataVisualizer 811.0KB 808.4KB -2.7KB
discover 855.8KB 853.2KB -2.7KB
enterpriseSearch 2.6MB 2.6MB -2.6KB
esql 180.8KB 178.1KB -2.7KB
eventAnnotationListing 312.9KB 310.2KB -2.7KB
exploratoryView 268.7KB 266.0KB -2.7KB
fleet 1.8MB 1.8MB -2.6KB
infra 1.5MB 1.5MB -2.7KB
lens 1.5MB 1.5MB -2.7KB
maps 3.0MB 3.0MB -1.7KB
ml 4.6MB 4.6MB -1.7KB
savedObjectsTagging 132.6KB 129.9KB -2.7KB
securitySolution 18.0MB 18.0MB -5.5KB
slo 916.5KB 913.8KB -2.7KB
transform 634.6KB 631.9KB -2.7KB
unifiedDocViewer 205.3KB 202.6KB -2.7KB
total -61.9KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
esUiShared 158.9KB 158.9KB +33.0B
files 10.1KB 11.1KB +950.0B
kbnUiSharedDeps-npmDll 6.1MB 6.1MB +62.8KB
kbnUiSharedDeps-srcJs 3.3MB 3.3MB +1.0B
total +63.8KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Dosant added a commit that referenced this pull request Sep 6, 2024
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants