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
Use renderComplete handler in maps embeddable #144421
base: main
Are you sure you want to change the base?
Conversation
…rectly await maps loading.
@dmlemeshko is the ecommerce dashboard used in x-pack/performance/journeys/ecommerce_dashboard.ts the same as ecommerce sample data dashboard? Because the ecommerce sample data dashboard does have a map when Maps application is running. |
@tsullivan Do components still need to set |
cc @dokmic Do you have any insight into the #144421 (comment)? |
You no longer need to set the |
@nreese the map loading was taking much longer than the rest of the visualizations, so we moved them to a standalone test called And yes, no need to set |
@nreese yes, that is the one. We decided to move map viz away from original ecommerce dashboard in its own journey (single viz on dashboard) and track performance separately. |
💚 Build Succeeded
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled in files
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
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.
Thanks for putting this PR together. While I agree that MapEmbeddable needs to be updated to use this.renderComplete
, I also believe we need to clean up existing uses of data-
attributes to avoid confusion and overlapping functionality.
For example, in the screen shot below, these 2 elements now contain duplicated data-*
attributes.
This can be cleaned up by removing setting data-
attributes in MapContainer
This PR also introduces different behavior for when data-render-complete
is set to true. MapContainer implementation uses a timeout to fire data-render-complete
after all layers have loaded to account for rendering time that is not possible to measure with a map. this.renderComplete
implementation should include this timeout as well so data-render-complete
is not set to true until a set amount of time. The existing 5000 timeout is likely excessive and maybe we can trim this to something smaller like 1000.
Another thing to consider is that MapEmbeddable may exist within other embeddables. One example is legacy tile_map and region_map visualizations. Those visualizations are now implemented as wrappers around MapEmbeddable so you have something like the below
<VisualizeEmbeddable>
<MapEmbeddable>
</MapEmbeddable>
</VisualizeEmbeddable>
This problem can be solved by only calling this.renderComplete
when this._isSharable
is true.
Can you provide some background into why this change is being made? Is map embeddable not functioning properly now? Is the existing behavior of data-render-complete
incorrect. I think understanding the why will help answer some implementation questions.
Also, if this is something that is too involved, the Maps team can take over the effort.
Summary
Use renderComplete handler in maps embeddable to correctly await maps loading.
Similar to #144243
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