-
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
[Dashboard] [Embeddable] Add Ability to Defer Embeddable Loaded State #107227
[Dashboard] [Embeddable] Add Ability to Defer Embeddable Loaded State #107227
Conversation
…ch aren't finished loading after their constructor is finished
@elasticmachine merge upstream master |
src/plugins/dashboard/public/application/lib/sync_dashboard_index_patterns.ts
Show resolved
Hide resolved
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.
looks good, I am in favor of going with such approach and don't have any better alternatives in mind
Pinging @elastic/kibana-presentation (Team:Presentation) |
Pinging @elastic/kibana-app-services (Team:AppServices) |
@elasticmachine merge upstream |
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.
maps changes LGTM
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.
Changes LGTM, I tested different combinations of lenses and tsvbs that have multiple index patterns, didn't notice any regressions in terms of how index patterns and filtering works on a dashboard.
tested that no more wrongly requested default index pattern 👍
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.
Looks good to me 👍
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.
Tested on Chrome Linux. It resolves the issue with requesting the default index pattern even if there is no visualization using it. Talked to Devon offline and suggested moving the parent check into the asbtract embeddable to make the usage in the embeddable a bit nicer to read, but so far everything looks fine for me.
…mentation burden for deferred embeddable loading
…omson/kibana into fix/deferEmbeddableLoaded
Great call @timroes , I've implemented a |
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.
maps changes LGTM
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
Unknown metric groupsAPI count
API count missing comments
History
To update your PR or re-run it, just comment with: |
…elastic#107227) Added defer embeddable loading flag to embeddable for embeddables which aren't finished loading after their constructor is finished
…elastic#107227) Added defer embeddable loading flag to embeddable for embeddables which aren't finished loading after their constructor is finished
Defer Embeddable Loading
This PR introduces a new opt-in method for embeddables to defer the completion of their
loading
state until after their output has been completely initialized.Previously, all embeddables were expected to have their output initialized via the factory create method & the embeddable constructor. This meant that the container could immediately set each embeddable's finished state to
true
as soon as the constructor returned an embeddable. As part of Time to Visualize, some embeddables were simplified to initialize their output after the constructor, so that their input could be eitherby value
orby reference
.This PR changes Lens and Maps embeddables to defer their loading state in this way.
Dashboard Index Patterns
In the initial setup for Time to Visualize, panels could be fully loaded before updating their index patterns. This meant that dashboard needed to check for new index patterns on every output update on every one of its children. By delaying the loaded state until the embeddable setup is complete, this is no longer necessary. In this PR the dashboard index pattern subscription only listens to output updates from the container itself.
Additionally, a new check has been added to cover the case where:
If this case is met, the default index pattern will not be loaded. This fixes #105182
The dashboard app has also been changed to no longer require an index pattern in order to render. This can speed up the initial rendering of the dashboard slightly. It will also introduce some mild layout shifting until #107041 is resolved.
Potential Followup
This change can be a major step towards removing the requirement for embeddable factories to have both
create
andcreateFromSavedObject
methods.Checklist
Delete any items that are not applicable to this PR.