[Lens][Embeddable] Make UI react faster to click actions like create or edit#210084
Closed
dej611 wants to merge 6 commits intoelastic:mainfrom
Closed
[Lens][Embeddable] Make UI react faster to click actions like create or edit#210084dej611 wants to merge 6 commits intoelastic:mainfrom
dej611 wants to merge 6 commits intoelastic:mainfrom
Conversation
Contributor
Author
|
/ci |
Contributor
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
Contributor
Author
|
/ci |
Contributor
Author
|
/ci |
dej611
commented
Feb 10, 2025
| }) => Promise<void | boolean>; | ||
|
|
||
| async function expectRerenderOnDataLoder( | ||
| async function expectRerenderOnDataLoader( |
dej611
commented
Feb 10, 2025
| ('attributes' in rawState ? rawState : { attributes: rawState }) as LensRuntimeState, | ||
| references?.length ? references : undefined | ||
| ); | ||
| if (newState.isNewPanel) { |
Contributor
Author
There was a problem hiding this comment.
If it's a new panel, we can safely assume (for now) that is a ES|QL panel.
Therefore try to load the attributes from the query here
dej611
commented
Feb 10, 2025
| const query = initialState.attributes.state.query; | ||
|
|
||
| const panelEsqlVariables$ = new BehaviorSubject<ESQLControlVariable[]>([]); | ||
| esqlVariables$.subscribe((newVariables) => { |
Contributor
Author
There was a problem hiding this comment.
This led to a memory leak as it wasn't removed at unmount.
The code has moved into the data_loader where the subscription is correctly removed at umount.
dej611
commented
Feb 10, 2025
| editorFrameService, | ||
| const lensEmbeddable = await embeddable.addNewPanel<object, LensApi>({ | ||
| panelType: 'lens', | ||
| serializedState: { |
Contributor
Author
There was a problem hiding this comment.
Moving away from the runtime state as requested by the presentation team.
Also it has the benefit to move the loading logic into the deserializeState helper
Contributor
Author
|
/ci |
Contributor
💔 Build Failed
Failed CI StepsHistory
cc @dej611 |
Contributor
Author
|
Closing for now as I'm breaking this up into multiple smaller PRs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is based on the idea in #209361 and tries to improve perceived performances for all the scenarios where the
editorFrameis loaded.On fast connections this is now perceived very fast:
On Fast 4g is still fast
On Slow 4g is acceptable
As a bonus extra tests have been added for the ES|QL creation flow.
cc @thomasneirynck @nreese
Checklist