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

[Embeddable] Add seamless React integration #143131

Merged
merged 8 commits into from
Oct 24, 2022
Merged

Conversation

dokmic
Copy link
Contributor

@dokmic dokmic commented Oct 11, 2022

Summary

Resolves #140395.

Checklist

@dokmic dokmic added review Feature:Embedding Embedding content via iFrame release_note:skip Skip the PR/issue when compiling release notes Team:AppServicesUx v8.6.0 labels Oct 11, 2022
@dokmic dokmic force-pushed the feature/140395 branch 2 times, most recently from 87dd283 to 895ed5a Compare October 12, 2022 18:33
@dokmic dokmic marked this pull request as ready for review October 13, 2022 06:50
@dokmic dokmic requested review from a team as code owners October 13, 2022 06:50
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesUx)

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

VisEditors changes LGTM, everything still works fine for the visualize embeddable

Copy link
Contributor

@vadimkibana vadimkibana left a comment

Choose a reason for hiding this comment

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

Code LGTM, also checked dashboards on Mac/Chrome all seems to work.

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Looked through the code and left one nit / question, but otherwise this is looking great! Nicely done, and super exciting for the future of embeddables.

I also ran the storybooks and everything checks out there.

One problem I ran into, I think this PR introduces a regression in Control Error state, where it doesn't appear when running onFatalError. To test this I added this.onFatalError(new Error('FATAL ERROR TEST')); under line 167 of src/plugins/controls/public/options_list/embeddable/options_list_embeddable.tsx.

On main it looks like this:
Screen Shot 2022-10-19 at 4 51 53 PM

but on this branch no error is shown at all. I debugged a little bit, and found that the control frame subscription is receiving the error properly, but I didn't look into it further than that.

Will approve once the error state is fixed.

@@ -33,7 +33,8 @@ export interface EmbeddableOutput {

export interface IEmbeddable<
I extends EmbeddableInput = EmbeddableInput,
O extends EmbeddableOutput = EmbeddableOutput
O extends EmbeddableOutput = EmbeddableOutput,
N = any
Copy link
Contributor

Choose a reason for hiding this comment

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

Any way to get better typing here? Maybe it extends ReactNode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We cannot extend this type parameter from the ReactNode as I wanted to keep the base embeddable class framework agnostic. In that case, the rendering component could specify what kind of rendering it supports.
The unknown type (so as never) is not going to work here as it breaks the existing code. The only option to achieve the same without touching already existing embeddable is using any.

@dokmic dokmic force-pushed the feature/140395 branch 2 times, most recently from e8590e2 to b617a68 Compare October 24, 2022 12:51
@dokmic
Copy link
Contributor Author

dokmic commented Oct 24, 2022

Will approve once the error state is fixed.

@ThomThomson It is fixed and works as before. Could you please take another look?

Copy link
Contributor

@ThomThomson ThomThomson left a comment

Choose a reason for hiding this comment

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

Re-reviewed this locally, and everything LGTM now! Thanks for fixing the error state.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
embeddable 84 79 -5

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
embeddable 412 410 -2
visualizations 730 729 -1
total -3

Async chunks

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

id before after diff
controls 491.5KB 492.2KB +706.0B
visualizations 268.2KB 268.1KB -66.0B
total +640.0B

Page load bundle

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

id before after diff
controls 18.4KB 18.4KB +56.0B
embeddable 70.1KB 68.9KB -1.1KB
total -1.1KB
Unknown metric groups

API count

id before after diff
embeddable 512 510 -2
visualizations 760 759 -1
total -3

History

  • 💚 Build #81759 succeeded f6d8b25f3f91d32af3eb8841f1e260de80f1f28e
  • 💚 Build #80432 succeeded e04ff7135c78a50b9b37c09aa289c7e95464d128
  • 💚 Build #79917 succeeded f47f42bf3eb773e21f73989f187c0c6c64c14114
  • 💔 Build #79759 failed 87dd28326ed01e7f1a48e24f094cb12d43a5d08e
  • 💔 Build #79602 failed 11a8b2aaf4bf3da3149d73d9526028242dde3050

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

@dokmic dokmic merged commit b921a49 into elastic:main Oct 24, 2022
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Oct 24, 2022
@dokmic dokmic deleted the feature/140395 branch October 24, 2022 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting Feature:Embedding Embedding content via iFrame release_note:skip Skip the PR/issue when compiling release notes review v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Embeddable] Seamless React integration
7 participants