-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Lens] Register all expression functions to the server #107836
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
Had a first code review of this PR. While 1 and 2 seems ok, the 3rd point is what makes up the most of the file count. |
const getStartServices = async (): Promise<LensEmbeddableStartServices> => { | ||
const [coreStart, deps] = await core.getStartServices(); | ||
this.initParts(core, data, embeddable, charts, expressions, usageCollection); |
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.
Just want to clarify is it expected that we execute initParts without await?
@dej611 This fix allow me to simplify typing, cause now for all cases it's not a promise. Plus in all cases where we execute initParts we already have all needed start services to remove |
Maybe I would ask @ppisljar to check as well here. |
expressions, | ||
editorFrame, | ||
charts, | ||
}: IndexPatternDatasourceSetupPlugins | ||
) { | ||
editorFrame.registerDatasource(async () => { | ||
const { |
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.
registration of functions on the client seems to happen late (after setup lifecycle)
this should be fixed (not necesarry as part of this PR) as we plan to introduce checks in expression service that will prevent this.
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.
yes you are right, I also wanted to highlight that in my PR, but then decided that it's not related.... In Lens we have some setup methods which executed on start phase =(
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.
Yes this is important, but we will take care of it in another PR
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.
code 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.
code LGTM!
@elasticmachine merge upstream |
💚 Build SucceededMetrics [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: cc @alexwizp |
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.
Code LGTM, I can't find any regression caused by these changes. I tested it locally in safari. If @mbondyra is also fine, let's merge it
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 and couldn't break it. Code LGTM 🆗
Part of: elastic#97134 Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Part of: #97134
Summary
What was done in that PR:
data.fieldsFormats
service. This service was moved into separate plugin which should be used independently of data plugin.formatFactory
method was refactored to avoid using of the following code:const formatFactory = await dependencies.formatFactory;