-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[PoC] Cached panel field specs #242335
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
base: main
Are you sure you want to change the base?
[PoC] Cached panel field specs #242335
Conversation
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
| @@ -1073,7 +1079,8 @@ export class DataViewsService { | |||
| get = async ( | |||
| id: string, | |||
| displayErrors: boolean = true, | |||
| refreshFields = false | |||
| refreshFields = false, | |||
| fieldSpecs?: FieldSpec[] | |||
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.
This new parameter allows a client to supply the fields list for the data view, removing the need for a field fetch.
| initialState.serializedSearchSource | ||
| discoverServices.data, | ||
| initialState.serializedSearchSource, | ||
| initialState.fieldSpecs |
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.
Here, the embeddable factory supplies the field list for the data view backing the search source. This allows the data views service to forego a fields fetch.
Summary
In this PoC the field specs that panels depend on are cached in the state of each panel, removing the need to load any field information through the
fieldsendpoint when the dashboard loads.Discover session — all fields this panel depends on are cached on the
searchsaved object. Then, they are used to hydrate the data view.Lens — all fields for all data views in the layers cached on the
lenssaved object. Then, they are used to hydrate the Lens "IndexPattern" objects which the panel depends on.