-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[TSVB] Custom renderer #83554
[TSVB] Custom renderer #83554
Conversation
# Conflicts: # src/plugins/vis_type_timeseries/common/constants.ts # src/plugins/vis_type_timeseries/public/metrics_type.ts
@@ -267,7 +267,6 @@ export const visPayloadSchema = schema.object({ | |||
}) | |||
), | |||
}), | |||
savedObjectId: schema.maybe(schema.string()), |
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.
I didn't found any usage of this param, removed as legacy
*/ | ||
|
||
// @ts-expect-error | ||
import { TimeseriesVisualization as timeseries } from './timeseries/vis'; |
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.
what do you think about lazy loading of these components? I just think if the user sees only one type on the dashboard, why do we need to load all
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 is a good idea. I tried to implement this approach, but noticed that it creates a lot of small chunks.
So I have a concern, what is a better approach here..
You could take a look at 2 screenshots below:
-
lazy load each visualization type, present couple of them in dashboard mode -> 13 small sized chunks for 4 vis types:
-
current approach -> 2 chunks, but they are not so huge also
So I wonder, is it worthy to do such a split?.. What are your thoughts?
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.
@stratoula what do you think? I like idea with small chunks cause not sure that users use all tabs of TSVB on dashboard. But I'm ok with both solutions.
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.
I like the idea too 🙂 I don't think that they load each TSVB chart type on a dashboard too. But as Daniil said the two chunks are not so big so I don't have strong objections here
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.
@sulemanof please do what you think is right =)
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.
@alexwizp @stratoula I'll pay more attention at the loading time of both variants in that case, and will post a comparison )
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.
Sounds great
src/plugins/vis_type_timeseries/public/timeseries_vis_renderer.tsx
Outdated
Show resolved
Hide resolved
Pinging @elastic/kibana-app (Team:KibanaApp) |
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.
LGTM! thank you
filters?: any; | ||
state?: any; | ||
query?: any; | ||
timerange: { |
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.
Well done for anys removal 👏
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.
LGTM, tested it locally on Safari, no regressions found. This seems to be our last renderer! Conrats @sulemanof, great job 💯
@stratoula @alexwizp |
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Distributable file count
Page load bundle
History
To update your PR or re-run it, just comment with: |
* Implement custom renderer * Remove legacy code * Use custom expression * Convert to typescript * Remove savedObjectId extra param * Other updates * Fix types * Cleanup * Fix functional tests * Bind uiSettings * Update snapshot * Update types * Remove extra params * Move common types * Return back validation error message * Use panel types enum * Fix types * Lazy load visualizations
* Implement custom renderer * Remove legacy code * Use custom expression * Convert to typescript * Remove savedObjectId extra param * Other updates * Fix types * Cleanup * Fix functional tests * Bind uiSettings * Update snapshot * Update types * Remove extra params * Move common types * Return back validation error message * Use panel types enum * Fix types * Lazy load visualizations
Summary
Part of #46801
Implement own renderer for TSVB visualization;
remove
NoDataComponent
, changed to use common for all visualizationsVisualizationNoResults
component;lazy load the timeseries visualization component -> shrink initial bundle size, split with more chunks - for the visualization and the editor itself:
Implement
toExpressionAst
function for building pipeline;cleanup the code, remove extra wrappers, convert to typescript
Checklist
Delete any items that are not applicable to this PR.
For maintainers