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

Add explicit children types #181257

Merged
merged 14 commits into from
Apr 29, 2024

Conversation

patrykkopycinski
Copy link
Contributor

@patrykkopycinski patrykkopycinski commented Apr 21, 2024

Summary

Prep work for React@18 bump

tl;dr In React@18 React.FC doesn't contain children anymore, so in order to make the bump easier I have decided to split the effort in multiple faces and hopefully this will make it easier for everyone

This PR focuses only on adding explicit children declaration either by using React.PropsWithChildren type or by adding children: React.ReactNode to the existing props types

DefinitelyTyped/DefinitelyTyped#46691

@patrykkopycinski
Copy link
Contributor Author

/ci

@patrykkopycinski
Copy link
Contributor Author

/ci

@patrykkopycinski patrykkopycinski self-assigned this Apr 21, 2024
@patrykkopycinski patrykkopycinski marked this pull request as ready for review April 22, 2024 13:59
@patrykkopycinski patrykkopycinski requested review from a team as code owners April 22, 2024 13:59
Copy link
Contributor

@PhilippeOberti PhilippeOberti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

desk tested and code LGTM for the Threat Intelligence Investigations team! Thanks for making this changes!

Copy link
Contributor

@nikitaindik nikitaindik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @patrykkopycinski! I have checked the types and can confirm that changes cause no issues with our current version of React. Approving on behalf of "security-detection-rule-management".

Couple questions:

  • Why is children optional in some cases and required in others?
  • What's the next step for v18 upgrade? Do we need to upgrade Kibana simultaneously with EUI so that they are compatible?

Copy link
Contributor

@jloleysens jloleysens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Core changes LGTM

@botelastic botelastic bot added the ci:project-deploy-observability Create an Observability project label Apr 29, 2024
@patrykkopycinski
Copy link
Contributor Author

Thank you for the feedback @jgowdyelastic @cnasikas @nikitaindik , I have aligned all the changes to use PropsWithChildren

Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ResponseOps changes LGTM!

patrykkopycinski and others added 3 commits April 29, 2024 14:02
…s/analytics_creation/components/details_step/description.tsx

Co-authored-by: James Gowdy <jgowdy@elastic.co>
…bana into chore/react-18-props

# Conflicts:
#	x-pack/plugins/ml/public/application/data_frame_analytics/pages/analytics_creation/components/details_step/description.tsx
@kibana-ci
Copy link
Collaborator

kibana-ci commented Apr 29, 2024

💚 Build Succeeded

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/cell-actions 46 44 -2
@kbn/react-kibana-mount 7 8 +1
@kbn/search-api-panels 81 82 +1
spaces 65 66 +1
total +1

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/i18n-react 0 1 +1
@kbn/ml-url-state 1 2 +1
esUiShared 3 4 +1
presentationUtil 2 3 +1
total +4

Async chunks

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

id before after diff
enterpriseSearch 2.7MB 2.7MB +77.0B
uiActionsEnhanced 135.7KB 135.7KB +10.0B
total +87.0B

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
module count - 5874 +5874
total size - 6.7MB +6.7MB

Page load bundle

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

id before after diff
infra 102.5KB 102.5KB +13.0B
kibanaReact 40.3KB 40.3KB +4.0B
spaces 25.6KB 25.6KB +11.0B
total +28.0B
Unknown metric groups

API count

id before after diff
@kbn/cell-actions 64 56 -8
@kbn/react-kibana-mount 10 11 +1
@kbn/search-api-panels 81 82 +1
spaces 256 257 +1
total -5

History

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

cc @patrykkopycinski

@patrykkopycinski patrykkopycinski enabled auto-merge (squash) April 29, 2024 14:06
Copy link
Member

@jgowdyelastic jgowdyelastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still quite a lot of places in the ML code where PropsWithChildren can be used rather than children?: React.ReactNode.
But to not hold up this PR I'll approve and I'll fix them in a follow up.

@patrykkopycinski patrykkopycinski merged commit 0780c19 into elastic:main Apr 29, 2024
47 checks passed
@kibanamachine kibanamachine added v8.15.0 backport:skip This commit does not require backporting labels Apr 29, 2024
mistic pushed a commit that referenced this pull request Apr 29, 2024
…ges (#182014)

## Summary
Original problem: `PropsWithChildren` require a generic type parameter
(there's no default). This was not made visible in the merged PR,
because we had type-checking on the PRs temporarily (accidentally)
removed.

Thsi PR fixes the fallout from
#181257 => Errors:
https://buildkite.com/elastic/kibana-on-merge/builds/44454
jgowdyelastic added a commit that referenced this pull request Apr 30, 2024
Following up on #181257, adding `PropsWithChildren` to the types which
were missed.
yuliacech pushed a commit to yuliacech/kibana that referenced this pull request May 3, 2024
## Summary

Prep work for React@18 bump

tl;dr In React@18 `React.FC` doesn't contain `children` anymore, so in
order to make the bump easier I have decided to split the effort in
multiple faces and hopefully this will make it easier for everyone

This PR focuses only on adding explicit `children` declaration either by
using `React.PropsWithChildren` type or by adding `children:
React.ReactNode` to the existing props types

DefinitelyTyped/DefinitelyTyped#46691

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Sergi Massaneda <sergi.massaneda@gmail.com>
Co-authored-by: Marco Vettorello <marco.vettorello@elastic.co>
Co-authored-by: James Gowdy <jgowdy@elastic.co>
yuliacech pushed a commit to yuliacech/kibana that referenced this pull request May 3, 2024
…ges (elastic#182014)

## Summary
Original problem: `PropsWithChildren` require a generic type parameter
(there's no default). This was not made visible in the merged PR,
because we had type-checking on the PRs temporarily (accidentally)
removed.

Thsi PR fixes the fallout from
elastic#181257 => Errors:
https://buildkite.com/elastic/kibana-on-merge/builds/44454
yuliacech pushed a commit to yuliacech/kibana that referenced this pull request May 3, 2024
Following up on elastic#181257, adding `PropsWithChildren` to the types which
were missed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
apm:review backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:obs-ux-infra_services Observability Infrastructure & Services User Experience Team v8.14.0 v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet